[LTP] [PATCH] Disable io_uring fd in ioctl_pidfd01 for selinux
Cyril Hrubis
chrubis@suse.cz
Tue Jul 29 18:17:43 CEST 2025
Hi!
> > > We also have same failure for memfd_secret case in this test:
>
> > > ioctl_pidfd01.c:37: TINFO: memfd secret -> ...
> > > ioctl_pidfd01.c:28: TFAIL: ioctl(memfd secret, PIDFD_GET_INFO, info) expected EINVAL, EBADF, ENOTTY: EACCES (13)
>
> > > If we are opting for skipping the tests when selinux is enforcing mode,
> > > this also needs to be skipped.
>
> > In this case we will probably need to disable the test for SELinux
> > enforcing.
>
> Well, all tests (ioctl_pidfd01.c, this ioctl_pidfd01.c, mount08.c) are testing
> with TST_EXP_FAIL_ARR(), i.e. negative tests. Wouldn't be better to just expect
> a different errno? At least this is what I suggested to mount08.c [1].
I'm not that sure about how to fix this. Disabling tests preventively
just because selinux is enforcing does not sound convincing to me. I
would expect that it all depends on the particular configuration of the
rules on the system.
Maybe it would make sense to inject additional errno EACESS to the
TST_EXP_FAIL() automatically if we detect that selinux is enforcing.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list