@@ -45,6 +45,10 @@ static struct tcase_t {
static void setup(void)
{
+ /* ioperm() is restricted under kernel lockdown. */
+ if (tst_lockdown_enabled())
+ tst_brk(TCONF, "Kernel is locked down, skip this test");
+
/*
* The value of IO_BITMAP_BITS (include/asm-i386/processor.h) changed
* from kernel 2.6.8 to permit 16-bits (65536) ioperm
@@ -52,6 +52,11 @@ static void verify_iopl(unsigned int i)
static void setup(void)
{
struct passwd *pw;
+
+ /* iopl() is restricted under kernel lockdown. */
+ if (tst_lockdown_enabled())
+ tst_brk(TCONF, "Kernel is locked down, skip this test");
+
pw = SAFE_GETPWNAM("nobody");
SAFE_SETEUID(pw->pw_uid);
}
The iopl() and ioperm() syscalls are blocked when the kernel is locked down. The order of sanity checks is not guaranteed so it's better to skip these tests even if they accidentally work. Signed-off-by: Martin Doucha <mdoucha@suse.cz> --- testcases/kernel/syscalls/ioperm/ioperm02.c | 4 ++++ testcases/kernel/syscalls/iopl/iopl02.c | 5 +++++ 2 files changed, 9 insertions(+)