From patchwork Fri Feb 24 16:53:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stsp X-Patchwork-Id: 55523 Return-Path: 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 3D5DF385417E for ; Fri, 24 Feb 2023 16:55:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D5DF385417E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677257703; bh=2qJjZJBOOjn3lVYi9dT+c7b0FAP9tsugTAMrCj8BtDs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=E++7HD544MXtuOGar3Tu7UzXyerjQVpKN0chxxqBirhN8mBI73pQJ9gu6+sMC0xP6 ys4enN4tjDPlK8HtU0spq4dG0dW5e8dULmfoYyQwrNYhIhaWaUWB4LZ/boFiK4avtq +002nRx7A//qhCRLwlgnlNuKLhp+TfYuZOnm9DOE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by sourceware.org (Postfix) with ESMTPS id F059A385483F for ; Fri, 24 Feb 2023 16:54:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F059A385483F Received: from sas1-61ab5dc724a3.qloud-c.yandex.net (sas1-61ab5dc724a3.qloud-c.yandex.net [IPv6:2a02:6b8:c08:162d:0:640:61ab:5dc7]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 0F3FE102A48 for ; Fri, 24 Feb 2023 19:54:09 +0300 (MSK) Received: by sas1-61ab5dc724a3.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 7sTr1tFbZqM1-6l2cV4Ss; Fri, 24 Feb 2023 19:54:08 +0300 X-Yandex-Fwd: 1 To: libc-alpha@sourceware.org Cc: Stas Sergeev Subject: [PATCH v3 0/2] minimal run-time audit support Date: Fri, 24 Feb 2023 21:53:58 +0500 Message-Id: <20230224165400.3417104-1-stsp2@yandex.ru> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stas Sergeev via Libc-alpha From: stsp Reply-To: Stas Sergeev Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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.