* [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev
@ 2021-07-01 13:14 Krzysztof Kozlowski
2021-07-01 13:14 ` [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
2021-07-12 8:58 ` [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev Petr Vorel
0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-01 13:14 UTC (permalink / raw)
To: ltp
SELinux can be enabled on the system which does not have development
selinux libraries. Such case was already done for Smack and Apparmor
where we unconditionally accept their attribute failures. Do the same
for SELinux to fix failures like:
proc01 1 TFAIL : proc01.c:404: read failed: /proc/self/task/29986/attr/selinux/current: errno=EINVAL(22): Invalid argument
proc01 2 TFAIL : proc01.c:404: read failed: /proc/self/task/29986/attr/selinux/prev: errno=EINVAL(22): Invalid argument
proc01 3 TFAIL : proc01.c:404: read failed: /proc/self/task/29986/attr/selinux/exec: errno=EINVAL(22): Invalid argument
proc01 4 TFAIL : proc01.c:404: read failed: /proc/self/task/29986/attr/selinux/fscreate: errno=EINVAL(22): Invalid argument
proc01 5 TFAIL : proc01.c:404: read failed: /proc/self/task/29986/attr/selinux/keycreate: errno=EINVAL(22): Invalid argument
proc01 6 TFAIL : proc01.c:404: read failed: /proc/self/task/29986/attr/selinux/sockcreate: errno=EINVAL(22): Invalid argument
...
proc01 7 TFAIL : proc01.c:404: read failed: /proc/self/attr/selinux/current: errno=EINVAL(22): Invalid argument
proc01 8 TFAIL : proc01.c:404: read failed: /proc/self/attr/selinux/prev: errno=EINVAL(22): Invalid argument
proc01 9 TFAIL : proc01.c:404: read failed: /proc/self/attr/selinux/exec: errno=EINVAL(22): Invalid argument
proc01 10 TFAIL : proc01.c:404: read failed: /proc/self/attr/selinux/fscreate: errno=EINVAL(22): Invalid argument
proc01 11 TFAIL : proc01.c:404: read failed: /proc/self/attr/selinux/keycreate: errno=EINVAL(22): Invalid argument
proc01 12 TFAIL : proc01.c:404: read failed: /proc/self/attr/selinux/sockcreate: errno=EINVAL(22): Invalid argument
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
testcases/kernel/fs/proc/proc01.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
index 0fae6754f7f7..6ddb6682f38b 100644
--- a/testcases/kernel/fs/proc/proc01.c
+++ b/testcases/kernel/fs/proc/proc01.c
@@ -97,10 +97,12 @@ static const struct mapping known_issues[] = {
{"read", "/proc/self/mem", EIO},
{"read", "/proc/self/task/[0-9]*/mem", EIO},
{"read", "/proc/self/attr/*", EINVAL},
+ {"read", "/proc/self/attr/selinux/*", EINVAL},
{"read", "/proc/self/attr/smack/*", EINVAL},
{"read", "/proc/self/attr/apparmor/*", EINVAL},
{"read", "/proc/self/task/[0-9]*/attr/*", EINVAL},
{"read", "/proc/self/task/[0-9]*/attr/smack/*", EINVAL},
+ {"read", "/proc/self/task/[0-9]*/attr/selinux/*", EINVAL},
{"read", "/proc/self/task/[0-9]*/attr/apparmor/*", EINVAL},
{"read", "/proc/self/ns/*", EINVAL},
{"read", "/proc/self/task/[0-9]*/ns/*", EINVAL},
@@ -133,7 +135,9 @@ static const struct mapping known_issues[] = {
#ifdef HAVE_LIBSELINUX_DEVEL
static const char lsm_should_work[][PATH_MAX] = {
"/proc/self/attr/*",
+ "/proc/self/attr/selinux/*",
"/proc/self/task/[0-9]*/attr/*",
+ "/proc/self/task/[0-9]*/attr/selinux/*",
""
};
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable)
2021-07-01 13:14 [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev Krzysztof Kozlowski
@ 2021-07-01 13:14 ` Krzysztof Kozlowski
2021-07-12 8:59 ` Petr Vorel
2021-07-12 12:27 ` Petr Vorel
2021-07-12 8:58 ` [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev Petr Vorel
1 sibling, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-01 13:14 UTC (permalink / raw)
To: ltp
Recent refactoring made the "lsm_should_work" unused without
libselinux-dev:
proc01.c:142:19: warning: ?lsm_should_work? defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
Changes since v1:
1. Fixup part of #1 patch.
---
testcases/kernel/fs/proc/proc01.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
index 6ddb6682f38b..c90e509a3243 100644
--- a/testcases/kernel/fs/proc/proc01.c
+++ b/testcases/kernel/fs/proc/proc01.c
@@ -140,12 +140,6 @@ static const char lsm_should_work[][PATH_MAX] = {
"/proc/self/task/[0-9]*/attr/selinux/*",
""
};
-
-/* Place holder for none of LSM is detected. */
-#else
-static const char lsm_should_work[][PATH_MAX] = {
- ""
-};
#endif
/* Known files that does not honor O_NONBLOCK, so they will hang
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev
2021-07-01 13:14 [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev Krzysztof Kozlowski
2021-07-01 13:14 ` [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
@ 2021-07-12 8:58 ` Petr Vorel
1 sibling, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2021-07-12 8:58 UTC (permalink / raw)
To: ltp
> SELinux can be enabled on the system which does not have development
> selinux libraries. Such case was already done for Smack and Apparmor
> where we unconditionally accept their attribute failures. Do the same
> for SELinux to fix failures like:
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable)
2021-07-01 13:14 ` [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
@ 2021-07-12 8:59 ` Petr Vorel
2021-07-12 12:27 ` Petr Vorel
1 sibling, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2021-07-12 8:59 UTC (permalink / raw)
To: ltp
Hi Krzysztof,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable)
2021-07-01 13:14 ` [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
2021-07-12 8:59 ` Petr Vorel
@ 2021-07-12 12:27 ` Petr Vorel
1 sibling, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2021-07-12 12:27 UTC (permalink / raw)
To: ltp
Hi Krzysztof,
whole patchset merged.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-12 12:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-01 13:14 [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev Krzysztof Kozlowski
2021-07-01 13:14 ` [LTP] [PATCH v2 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
2021-07-12 8:59 ` Petr Vorel
2021-07-12 12:27 ` Petr Vorel
2021-07-12 8:58 ` [LTP] [PATCH v2 1/2] proc01: fix selinux attributes without libselinux-dev Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox