[LTP] [PATCH] syscalls/madvise11: Ignore unpoison failure under kernel lockdown
Martin Doucha
mdoucha@suse.cz
Tue Jun 20 10:28:11 CEST 2023
On 20. 06. 23 10:24, Petr Vorel wrote:
> 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);
Good point. Though TST_RET is long int so it should be %ld. Should I
send a v2?
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list