lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250612075700.24193-1-wangfushuai@baidu.com>
Date: Thu, 12 Jun 2025 15:57:00 +0800
From: Fushuai Wang <wangfushuai@...du.com>
To: <alexei.starovoitov@...il.com>
CC: <andrii@...nel.org>, <ast@...nel.org>, <bpf@...r.kernel.org>,
	<daniel@...earbox.net>, <eddyz87@...il.com>, <haoluo@...gle.com>,
	<jakub@...udflare.com>, <john.fastabend@...il.com>, <jolsa@...nel.org>,
	<kpsingh@...nel.org>, <linux-kernel@...r.kernel.org>,
	<linux-kselftest@...r.kernel.org>, <martin.lau@...ux.dev>, <mhal@...x.co>,
	<mykolal@...com>, <sdf@...ichev.me>, <shuah@...nel.org>, <song@...nel.org>,
	<thinker.li@...il.com>, <wangfushuai@...du.com>, <yonghong.song@...ux.dev>
Subject: Re: [PATCH] selftests/bpf: fix signedness bug in redir_partial()

>> When xsend() returns -1 (error), the check 'n < sizeof(buf)' incorrectly
>> treats it as success due to unsigned promotion. Explicitly check for -1
>> first.
>>
>> Fixes: a4b7193d8efd ("selftests/bpf: Add sockmap test for redirecting partial skb data")
>> Signed-off-by: wangfushuai <wangfushuai@...du.com>
> 
> Looks good, but please spell out your name as First Last
> in both From and Signed-off
> 
> Also use [PATCH bpf-next] in subject
> 
> pw-bot: cr

Will fix and send v2 shortly. Thanks for the review!

--
Regards,
Wang
 
>> ---
>>  tools/testing/selftests/bpf/prog_tests/sockmap_listen.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
>> index 1d98eee7a2c3..f1bdccc7e4e7 100644
>> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
>> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
>> @@ -924,6 +924,8 @@ static void redir_partial(int family, int sotype, int sock_map, int parser_map)
>>                 goto close;
>>
>>         n = xsend(c1, buf, sizeof(buf), 0);
>> +       if (n == -1)
>> +               goto close;
>>         if (n < sizeof(buf))
>>                 FAIL("incomplete write");
>>
>> --
>> 2.36.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ