From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by sourceware.org (Postfix) with ESMTPS id CC58F385022C for ; Sat, 18 Mar 2023 16:51:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC58F385022C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru Received: from myt6-1289f562e823.qloud-c.yandex.net (myt6-1289f562e823.qloud-c.yandex.net [IPv6:2a02:6b8:c12:259d:0:640:1289:f562]) by forward106j.mail.yandex.net (Yandex) with ESMTP id B55316BD61E6 for ; Sat, 18 Mar 2023 19:51:41 +0300 (MSK) Received: by myt6-1289f562e823.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id cpp3fcrbC8c1-MjfO4cfx; Sat, 18 Mar 2023 19:51:41 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1679158301; bh=ihY0MPVYLDeQ2o1y94YU+pEO25ZQ9cmxa1BSa8haMHc=; h=Message-Id:Date:Cc:Subject:To:From; b=A9NTLgkoyXLbVBFNy0g5G4XZAw4FPauKA9WTq69OW+h3n7AmmliisEmAC4jry1OlG dpYy2c2JWMHN+7EvY4On+UrFScd7FF7Nq1STcxRJ09Sdt8cgPcni9HzwjxOBcsDQV1 eJBQewB0FmWB9/3/VW6kMLodqd8gG70XeZCe5ibU= Authentication-Results: myt6-1289f562e823.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru From: Stas Sergeev To: libc-alpha@sourceware.org Cc: Stas Sergeev Subject: [PATCH v9 0/13] implement dlmem() function Date: Sat, 18 Mar 2023 21:50:57 +0500 Message-Id: <20230318165110.3672749-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=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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 List-Id: Changes in v9: - use "zero-copy" machinery instead of memcpy(). It works on linux 5.13 and newer, falling back to memcpy() otherwise. Suggested by Florian Weimer. - implement fdlopen() using the above functionality. It is in a new test tst-dlmem-fdlopen. Suggested by Carlos O'Donell. - add DLMEM_DONTREPLACE flag that doesn't replace the backing-store mapping. It switches back to memcpy(). Test-case is called tst-dlmem-shm. 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 -- 2.37.2