summaryrefslogtreecommitdiff
blob: 8c7a5331e7f450332165ef4c1b45cca90106977e (plain)
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
32
33
34
35
From: Anthony G. Basile <blueness@gentoo.org>

For users that emerge without XATTR_PAX support enabled, we still want user.pax.flags
namespace supported on tmpfs so that the PaX markings survive emerge.

diff -Naur a/mm/shmem.c b/mm/shmem.c
--- a/mm/shmem.c	2013-06-11 21:00:18.000000000 -0400
+++ b/mm/shmem.c	2013-06-11 21:08:18.000000000 -0400
@@ -1809,11 +1809,7 @@
 static int shmem_xattr_validate(const char *name)
 {
 	struct { const char *prefix; size_t len; } arr[] = {
-
-#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
 		{ XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN},
-#endif
-
 		{ XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN },
 		{ XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN }
 	};
@@ -1867,14 +1863,12 @@
 	if (err)
 		return err;
 
-#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
 	if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
 		if (strcmp(name, XATTR_NAME_PAX_FLAGS))
 			return -EOPNOTSUPP;
 		if (size > 8)
 			return -EINVAL;
 	}
-#endif
 
 	if (size == 0)
 		value = "";  /* empty EA, do not remove */