[LTP] [PATCH] syscalls/madvise11: Ignore unpoison failure under kernel lockdown
Petr Vorel
pvorel@suse.cz
Tue Jun 20 10:24:42 CEST 2023
Hi Martin,
...
> - return SAFE_OPEN(debugfs_fp, O_WRONLY);
> + TEST(open(debugfs_fp, O_WRONLY));
> +
> + if (TST_RET == -1 && TST_ERR == EPERM && tst_lockdown_enabled()) {
> + tst_res(TINFO,
> + "Cannot restore soft-offlined memory due to lockdown");
> + return TST_RET;
> + }
> +
> + if (TST_RET == -1)
> + tst_brk(TBROK | TTERRNO, "open(%s) failed", debugfs_fp);
> + else if (TST_RET < 0)
> + tst_brk(TBROK | TTERRNO, "Invalid open() return value");
nit: I'd print the return value as we do in safe_open():
tst_brk(TBROK | TTERRNO, "Invalid open() return value %d", TST_RET);
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks for fixing this!
Kind regards,
Petr
> +
> + return TST_RET;
> }
More information about the ltp
mailing list