Message ID | 20230303120643.1280815-1-stsp2@yandex.ru |
---|---|
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 568763858004 for <patchwork@sourceware.org>; Fri, 3 Mar 2023 12:07:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 568763858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677845232; bh=wiTwkjWm+vA0tIc+7Shewhbs4PXkYTLGbQF6lHpdfpA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=pbQ978t6w+YRTR+oACnUZIBw6fdwehuRzd8Z4Qa7+aB6c8JWSRL2pEc9+vVEY2h3O 2+bvC5G2HzYyrA9P+K8nf0RzHq9NktiuAGX2g3br/5pv4e54476EvODxrbMDVpNES2 sLaj3yvGL+3/OWeEwDnEQjeJkT2T91EzdT5DDsvA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from forward200b.mail.yandex.net (forward200b.mail.yandex.net [178.154.239.157]) by sourceware.org (Postfix) with ESMTPS id C71653858D37 for <libc-alpha@sourceware.org>; Fri, 3 Mar 2023 12:06:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C71653858D37 Received: from sas8-d2832c3b6ed7.qloud-c.yandex.net (sas8-d2832c3b6ed7.qloud-c.yandex.net [IPv6:2a02:6b8:c1b:2a09:0:640:d283:2c3b]) by forward200b.mail.yandex.net (Yandex) with ESMTP id 4A3EF60106 for <libc-alpha@sourceware.org>; Fri, 3 Mar 2023 15:06:46 +0300 (MSK) Received: by sas8-d2832c3b6ed7.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id i6WICH9bouQ1-faLUNDl4; Fri, 03 Mar 2023 15:06:45 +0300 X-Yandex-Fwd: 1 To: libc-alpha@sourceware.org Cc: Stas Sergeev <stsp2@yandex.ru> Subject: [PATCH v9 0/3] minimal run-time audit support Date: Fri, 3 Mar 2023 17:06:40 +0500 Message-Id: <20230303120643.1280815-1-stsp2@yandex.ru> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Stas Sergeev via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Stas Sergeev <stsp2@yandex.ru> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
minimal run-time audit support
|
|
Message
stsp
March 3, 2023, 12:06 p.m. UTC
Changes in v9: address the review comment of Jonathon Anderson: add "cookie" arg to dlload_audit_module(), and la_dynload() call-back that takes this cookie. This allows the auditor to be notified about the dynamic (rather than the usual static) loading. la_dynload() can even reject the loading. Extend test-case for these new features. Changes in v8: resolve conflicts on abilists... Changes in v7: address the review comment of Jonathon Anderson: allow dynamically loaded audit module to work with previously loaded modules. The technique is the same as in dl_main(): call la_objopen() for every pre-existing object to "introduce" it to an auditor. Changes in v6: fix what seems to be a problem in v5: call unload_audit_module() before _dl_signal_error(), rather than after. It seems _dl_signal_error() may involve longjmp() so it should be called the last, after any clean-ups. Changes in v5: address the review comment of Jonathon Anderson: Disabling existing audit call-backs may break some existing auditors if they attempted to be loaded with dlload_audit_module(). Instead return an error EINVAL and refuse to load an audit module that has the unallowed call-backs (symbind, pltenter, pltexit). Extend test to make sure the error is reported as expected. Changes in v4: rebased, conflicts resolved. Changes in v3: address the review comment of Jonathon Anderson: Disable 3 audit call-backs for dynamically loaded modules. Namely symbind, pltenter, pltexit. Extend test-case to make sure they are not resolved and not called. Changes in v2: address the review comment of Jonathon Anderson: Add per-linkmap l_naudit counter to make sure each object is audited only with the modules loaded before it. That avoids the possibility of getting the "unrecognized" cookie. Test-case was enhanced to check for unrecognized cookies. This patch-set introduces the bare minimum functionality for working with audit modules at run-time. Patch1 fixes the check in dlmopen() which avoids loading solibs into the auditing namespace. But RTLD_NOLOAD was forgotten to check, and with that flags nothing gets loaded into auditing namespace, so dlmopen() should succeed and return the handle for auditing object. Patch2 adds dlload_audit_module() function and a test-case for it.