From: Richard Palethorpe <rpalethorpe@suse.de>
To: Teo Couprie Diaz <teo.coupriediaz@arm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] cve-2015-3290: Fix tst_syscall() return value
Date: Thu, 16 Feb 2023 10:12:05 +0000 [thread overview]
Message-ID: <87lekxrjh6.fsf@suse.de> (raw)
In-Reply-To: <abf5eb48-d63d-1b5f-4047-1a8c210a48a1@arm.com>
Teo Couprie Diaz <teo.coupriediaz@arm.com> writes:
> Hi all,
>
> On 15/02/2023 15:20, Petr Vorel wrote:
>> Hi all,
>>
>>> The modify_ldt() syscall returns 32-bit signed integer value. Recent changes
>>> in tst_syscall() caused the value to be interpreted as unsigned on older
>>> kernels/glibc, which breaks the cve-2015-3290 test. Add explicit type cast
>>> to fix it.
>> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>>
>> This is caused by e5d2a05a9 ("regen.sh: Use intptr_t for tst_syscall return")
>> which changed returning tst_ret from int to intptr_t (which is also int for 32
>> bit archs, but long for 64 bit archs). This commit is also needed, thus I don't
>> suggest to revert it, but I wonder how many other tests it broke.
I think modify_ldt is special. You could search for other syscalls which
only return 32bit to make sure.
>
> I sent the tst_syscall return patch. I did some testing with what systems I
> had available when working on it and, at the time, didn't see any
> regressions,
> including for cve-2015-3290.
>
> However this was with fairly recent kernels and libcs, and according
> to Martin
> the test failed for them on an older combination.
>
> I shared the test suite[0] I tested the patch with, containing all the
> uses I found.
> It might be worthwhile to run it on a system where we now know one of
> the tests
> was affected ? Hopefully, none more, but having a result would be
> better.
I think the testing you did was more than adequate.
>
> Best regards,
> Téo
>
> [0]: https://lists.linux.it/pipermail/ltp/2022-November/031640.html
>
>>
>> Kind regards,
>> Petr
>>
>>> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
>>> ---
>>> testcases/cve/cve-2015-3290.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>> diff --git a/testcases/cve/cve-2015-3290.c b/testcases/cve/cve-2015-3290.c
>>> index f61d2809b..a2a8fcedd 100644
>>> --- a/testcases/cve/cve-2015-3290.c
>>> +++ b/testcases/cve/cve-2015-3290.c
>>> @@ -195,7 +195,8 @@ static void set_ldt(void)
>>> .useable = 0
>>> };
>>> - TEST(tst_syscall(__NR_modify_ldt, 1, &data_desc, sizeof(data_desc)));
>>> + TEST((int)tst_syscall(__NR_modify_ldt, 1, &data_desc,
>>> + sizeof(data_desc)));
>>> if (TST_RET == -EINVAL) {
>>> tst_brk(TCONF | TRERRNO,
>>> "modify_ldt: 16-bit data segments are probably disabled");
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-02-16 10:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 14:42 [LTP] [PATCH] cve-2015-3290: Fix tst_syscall() return value Martin Doucha
2023-02-15 15:20 ` Petr Vorel
2023-02-15 15:34 ` Teo Couprie Diaz
2023-02-15 15:51 ` Martin Doucha
2023-02-15 15:57 ` Petr Vorel
2023-02-16 10:12 ` Richard Palethorpe [this message]
2023-02-16 9:24 ` Richard Palethorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lekxrjh6.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=ltp@lists.linux.it \
--cc=teo.coupriediaz@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox