[Concept,15/21] ext4l: Add a CONFIG_EXT4_FS_SECURITY option

Message ID 20260108185149.1995917-16-sjg@u-boot.org
State New
Headers
Series ext4l: Add Kconfig options to reduce binary size (part P) |

Commit Message

Simon Glass Jan. 8, 2026, 6:51 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add Kconfig option to make security labels support optional. The
xattr_security.c file and xattr.h already have proper #ifdef guards
with stub functions when disabled.

Security labels require extended attributes, so this option depends
on EXT4_XATTR.

They are unlikely to be useful in U-Boot but is included for
completeness.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/Kconfig  | 11 +++++++++++
 fs/ext4l/Makefile |  1 +
 2 files changed, 12 insertions(+)
  

Patch

diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig
index 1dce08d9474..b7520aaab16 100644
--- a/fs/ext4l/Kconfig
+++ b/fs/ext4l/Kconfig
@@ -153,3 +153,14 @@  config EXT4_FS_POSIX_ACL
 
 	  ACLs require extended attributes support (EXT4_XATTR).
 	  If unsure, say N.
+
+config EXT4_FS_SECURITY
+	bool "Enable ext4 security labels"
+	depends on FS_EXT4L && EXT4_XATTR
+	help
+	  Enable security labels support for ext4 filesystems. This
+	  provides an extended attribute handler for file security
+	  labels used by security modules like SELinux.
+
+	  Security labels require extended attributes support (EXT4_XATTR).
+	  If unsure, say N.
diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile
index fd86ce56d2e..0f5ee832f2e 100644
--- a/fs/ext4l/Makefile
+++ b/fs/ext4l/Makefile
@@ -20,3 +20,4 @@  obj-$(CONFIG_EXT4_XATTR)	+= xattr.o xattr_hurd.o xattr_trusted.o \
 obj-$(CONFIG_EXT4_INLINE_DATA)	+= inline.o
 obj-$(CONFIG_EXT4_INDIRECT)	+= indirect.o
 obj-$(CONFIG_EXT4_FS_POSIX_ACL)	+= acl.o
+obj-$(CONFIG_EXT4_FS_SECURITY)	+= xattr_security.o