From patchwork Mon Dec 21 15:33:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 41497 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 823C8386F443; Mon, 21 Dec 2020 15:34:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 823C8386F443 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608564846; bh=tmb0belq/pED2K+kHg1NrTlvFvIRemUnMpZNNNW1hOQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=nYuWAbh9N3yAanve8BhxWTzb2bSYCnTIgp6R+F/TYi8RCjbLAWpGOu594ZA1M0Xlk aJtWTV2rHTIgL8IhuDWYigICp6WO/ie/neCpnzx+oAzuh5GoT5hfUT05awMdH+noKK dxOe6ygv5towZwVIMAQpfzreU3tBlxH+q+3Qh/4s= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id BC18F386F000 for ; Mon, 21 Dec 2020 15:34:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BC18F386F000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 296FA1FB; Mon, 21 Dec 2020 07:34:00 -0800 (PST) Received: from eagle.buzzard.freeserve.co.uk (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F3F93F6CF; Mon, 21 Dec 2020 07:33:59 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v5 0/6] [committed] Memory tagging support Date: Mon, 21 Dec 2020 15:33:39 +0000 Message-Id: <20201221153345.3742-1-rearnsha@arm.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Richard Earnshaw via Libc-alpha From: Richard Earnshaw Reply-To: Richard Earnshaw Cc: Richard Earnshaw Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Final version, as committed to master. The following minor tweaks were made: - Move some preprocessor definitions from malloc/malloc.h to include/malloc.h - Fix a comment in arena.c - Fix non-GNU style in sysdeps/aarch64/libc-mtag.h - updated one commit message to indicate version of linux that supports MTE. - sprinkle some Reviewed-by where appropriate. With thanks to Szabolcs and Siddhesh for prompt reviews. R. Richard Earnshaw (6): config: Allow memory tagging to be enabled when configuring glibc elf: Add a tunable to control use of tagged memory malloc: Basic support for memory tagging in the malloc() family linux: Add compatibility definitions to sys/prctl.h for MTE aarch64: Add sysv specific enabling code for memory tagging aarch64: Add aarch64-specific files for memory tagging support INSTALL | 14 + config.h.in | 3 + config.make.in | 2 + configure | 22 ++ configure.ac | 15 + elf/dl-tunables.list | 9 + include/malloc.h | 8 + malloc/arena.c | 59 ++- malloc/hooks.c | 79 ++-- malloc/malloc.c | 336 ++++++++++++++---- manual/install.texi | 13 + manual/tunables.texi | 35 ++ sysdeps/aarch64/Makefile | 5 + sysdeps/aarch64/__mtag_address_get_tag.S | 32 ++ sysdeps/aarch64/__mtag_memset_tag.S | 53 +++ sysdeps/aarch64/__mtag_new_tag.S | 37 ++ sysdeps/aarch64/__mtag_tag_region.S | 51 +++ sysdeps/aarch64/libc-mtag.h | 57 +++ sysdeps/generic/libc-mtag.h | 52 +++ sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/mman.h | 1 + .../unix/sysv/linux/aarch64/cpu-features.c | 30 ++ .../unix/sysv/linux/aarch64/cpu-features.h | 2 + sysdeps/unix/sysv/linux/sys/prctl.h | 18 + 24 files changed, 837 insertions(+), 97 deletions(-) create mode 100644 sysdeps/aarch64/__mtag_address_get_tag.S create mode 100644 sysdeps/aarch64/__mtag_memset_tag.S create mode 100644 sysdeps/aarch64/__mtag_new_tag.S create mode 100644 sysdeps/aarch64/__mtag_tag_region.S create mode 100644 sysdeps/aarch64/libc-mtag.h create mode 100644 sysdeps/generic/libc-mtag.h