All of lore.kernel.org
 help / color / mirror / Atom feed
From: "irgstg@gmail.com" <irgstg@gmail.com>
To: buildroot@buildroot.org
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>,
	Romain Naour <romain.naour@gmail.com>,
	"irgstg@gmail.com" <irgstg@gmail.com>
Subject: [Buildroot] [PATCH] package/glibc: optional MTE support in glibc
Date: Sat, 30 Oct 2021 11:37:50 +0300	[thread overview]
Message-ID: <20211030083753.192-1-irgstg@gmail.com> (raw)

Adding option BR2_PACKAGE_GLIBC_MTE to configure glibc with MTE support.
When enabled, glibcs configuration process runs with `--enable-memory-tagging` [1].

MTE (Memory Tagging Extension) is an ISA extension which aims to improve security on ARMv8.5-A [2].
The linux kernel supports this feature via CONFIG_ARM64_MTE.
In order for glibc's MTE support to work properly, the running kernel has to support that.

dependencies:
 - supported on aarch64 only (BR2_aarch64)
 - requires binutils version 2.33.1 or newer (!B2_BINUTILS_VERSION_2_32_X)
 - requires at least linux 5.4 headers (BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4)

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=INSTALL;h=02dcf6b1ca3a4c43a17fdcae5e7dae8189c1c50b;hb=HEAD#l145
[2] https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/enhancing-memory-safety

Signed-off-by: irgstg@gmail.com <irgstg@gmail.com>
---
 package/glibc/Config.in | 12 ++++++++++++
 package/glibc/glibc.mk  |  1 +
 2 files changed, 13 insertions(+)

diff --git a/package/glibc/Config.in b/package/glibc/Config.in
index 5ecd058145..6d42aa6771 100644
--- a/package/glibc/Config.in
+++ b/package/glibc/Config.in
@@ -16,4 +16,16 @@ config BR2_PACKAGE_GLIBC_UTILS
 	  Enabling this option will compile and install the getconf,
 	  ldconfig, ldd and locale glibc utilities for the target.
 
+config BR2_PACKAGE_GLIBC_MTE
+	bool "Install glibc support for MTE"
+	depends on BR2_aarch64
+	depends on !BR2_BINUTILS_VERSION_2_32_X
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
+	help
+	  Enabling this option will configure, compile
+	  and install glibc support for MTE (Memory Tagging Extension).
+	  Please be aware, in order for that to work properly,
+	  kernel support for MTE (CONFIG_ARM64_MTE), and a
+	  supported CPU are needed.
+
 endif # BR2_TOOLCHAIN_BUILDROOT_GLIBC
diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk
index 3862e0624b..a44c2828f8 100644
--- a/package/glibc/glibc.mk
+++ b/package/glibc/glibc.mk
@@ -124,6 +124,7 @@ define GLIBC_CONFIGURE_CMDS
 		--disable-werror \
 		--without-gd \
 		--enable-kernel=$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)) \
+		$(if $(BR2_PACKAGE_GLIBC_MTE),--enable-memory-tagging) \
 		--with-headers=$(STAGING_DIR)/usr/include)
 	$(GLIBC_ADD_MISSING_STUB_H)
 endef
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2021-10-30  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-30  8:37 irgstg [this message]
2021-10-31 17:52 ` [Buildroot] [PATCH] package/glibc: optional MTE support in glibc Thomas Petazzoni
2023-11-26 20:28   ` R
2023-11-26 21:08     ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211030083753.192-1-irgstg@gmail.com \
    --to=irgstg@gmail.com \
    --cc=bernd.kuhls@t-online.de \
    --cc=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.