From patchwork Fri Mar 17 06:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stsp X-Patchwork-Id: 1758081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=fjFCQqTN; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PdDpD1FpTz2473 for ; Fri, 17 Mar 2023 17:32:52 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F08F63850852 for ; Fri, 17 Mar 2023 06:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F08F63850852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679034769; bh=vtk7ks4IpyfiZE5zlpONbK5hVcbGzn6TJuWzfoHAhJs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=fjFCQqTNpTGW3Ff2lJDkhffLBMkYaof1XuAruXVAKgs/9rBHuPY6IonOUjAhXtLcp /sW0SXDzQpIw70POhzWfXh+EUYQC+Y/6OT5s5zRauq1WI+tkW+IEio73mmH9bXCXeQ Xf+MMjnSlPslIROP1ZNen05xsTfIzf3KXOCspjTM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from forward102c.mail.yandex.net (forward102c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d102]) by sourceware.org (Postfix) with ESMTPS id 9B1603858423 for ; Fri, 17 Mar 2023 06:32:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B1603858423 Received: from sas9-2d24a7e69f58.qloud-c.yandex.net (sas9-2d24a7e69f58.qloud-c.yandex.net [IPv6:2a02:6b8:c11:2298:0:640:2d24:a7e6]) by forward102c.mail.yandex.net (Yandex) with ESMTP id 31C8D600D7 for ; Fri, 17 Mar 2023 09:32:28 +0300 (MSK) Received: by sas9-2d24a7e69f58.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id QWeJF9abi0U1-BbAs5LqV; Fri, 17 Mar 2023 09:32:27 +0300 X-Yandex-Fwd: 1 To: libc-alpha@sourceware.org Cc: Stas Sergeev Subject: [PATCH v8 0/11] implement dlmem() function Date: Fri, 17 Mar 2023 11:31:59 +0500 Message-Id: <20230317063210.4118076-1-stsp2@yandex.ru> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Changes in v8: - drop audit machinery and instead add an extra arg (optional pointer to a struct) to dlmem() itself that allows to install a custom premap callback or to specify nsid. Audit machinery was meant to allow controling over the pre-existing APIs like dlopen(), but if someone ever needs such extensions to dlopen(), he can trivially implement dlopen() on top of dlmem(). Changes in v7: - add _dl_audit_premap audit extension and its usage example Changes in v6: - use __strdup("") for l_name as suggested by Andreas Schwab Changes in v5: - added _dl_audit_premap_dlmem audit extension for dlmem - added tst-auditmod-dlmem.c test-case that feeds shm fd to dlmem() Changes in v4: - re-target to GLIBC_2.38 - add tst-auditdlmem.c test-case to test auditing - drop length page-aligning in tst-dlmem: mmap() aligns length on its own - bugfix: in do_mmapcpy() allow mmaps past end of buffer Changes in v3: - Changed prototype of dlmem() (and all the internal machinery) to use "const unsigned char *buffer" instead of "const char *buffer". Changes in v2: - use instead of "../test-skeleton.c" - re-target to GLIBC_2.37 - update all libc.abilist files