blob: 50d3e3daed1722d9f75bc9e0bef00ddc415167fc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
diff -Naur xattr-a/include/uapi/linux/xattr.h xattr-b/include/uapi/linux/xattr.h
--- xattr-a/include/uapi/linux/xattr.h 2023-12-19 20:22:20.000000000 +1100
+++ xattr-b/include/uapi/linux/xattr.h 2023-12-24 13:31:57.653254146 +1100
@@ -81,5 +81,9 @@
#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
+/* User namespace */
+#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax."
+#define XATTR_PAX_FLAGS_SUFFIX "flags"
+#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX
#endif /* _UAPI_LINUX_XATTR_H */
diff -Naur xattr-a/mm/shmem.c xattr-b/mm/shmem.c
--- xattr-a/mm/shmem.c 2023-12-19 20:22:20.000000000 +1100
+++ xattr-b/mm/shmem.c 2023-12-24 13:31:57.803254146 +1100
@@ -3649,6 +3649,14 @@
{
struct shmem_inode_info *info = SHMEM_I(inode);
+
+ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
+ if (strcmp(name, XATTR_NAME_PAX_FLAGS))
+ return -EOPNOTSUPP;
+ if (size > 8)
+ return -EINVAL;
+ }
+
name = xattr_full_name(handler, name);
return simple_xattr_get(&info->xattrs, name, buffer, size);
}
|