All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] proc01: fix selinux attributes without libselinux-dev
@ 2021-07-01 12:23 Krzysztof Kozlowski
  2021-07-01 12:23 ` [LTP] [PATCH 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-01 12:23 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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
index 0fae6754f7f7..282c70e94882 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,6 +135,7 @@ 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/*",
 	""
 };
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable)
  2021-07-01 12:23 [LTP] [PATCH 1/2] proc01: fix selinux attributes without libselinux-dev Krzysztof Kozlowski
@ 2021-07-01 12:23 ` Krzysztof Kozlowski
  2021-07-01 12:29   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-01 12:23 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>
---
 testcases/kernel/fs/proc/proc01.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
index 282c70e94882..c90e509a3243 100644
--- a/testcases/kernel/fs/proc/proc01.c
+++ b/testcases/kernel/fs/proc/proc01.c
@@ -137,12 +137,7 @@ static const char lsm_should_work[][PATH_MAX] = {
 	"/proc/self/attr/*",
 	"/proc/self/attr/selinux/*",
 	"/proc/self/task/[0-9]*/attr/*",
-	""
-};
-
-/* Place holder for none of LSM is detected. */
-#else
-static const char lsm_should_work[][PATH_MAX] = {
+	"/proc/self/task/[0-9]*/attr/selinux/*",
 	""
 };
 #endif
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable)
  2021-07-01 12:23 ` [LTP] [PATCH 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
@ 2021-07-01 12:29   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-01 12:29 UTC (permalink / raw)
  To: ltp

On 01/07/2021 14:23, Krzysztof Kozlowski wrote:
> 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>
> ---
>  testcases/kernel/fs/proc/proc01.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
> index 282c70e94882..c90e509a3243 100644
> --- a/testcases/kernel/fs/proc/proc01.c
> +++ b/testcases/kernel/fs/proc/proc01.c
> @@ -137,12 +137,7 @@ static const char lsm_should_work[][PATH_MAX] = {
>  	"/proc/self/attr/*",
>  	"/proc/self/attr/selinux/*",
>  	"/proc/self/task/[0-9]*/attr/*",
> -	""
> -};
> -
> -/* Place holder for none of LSM is detected. */
> -#else
> -static const char lsm_should_work[][PATH_MAX] = {
> +	"/proc/self/task/[0-9]*/attr/selinux/*",

This should be part of previous patch, my bad with git add -p. I'll send
a v2.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-01 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 12:23 [LTP] [PATCH 1/2] proc01: fix selinux attributes without libselinux-dev Krzysztof Kozlowski
2021-07-01 12:23 ` [LTP] [PATCH 2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable) Krzysztof Kozlowski
2021-07-01 12:29   ` Krzysztof Kozlowski

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.