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: <20250115141940.399ecd28@kernel.org>
Date: Wed, 15 Jan 2025 14:19:40 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Liu Ye <liuye@...inos.cn>
Cc: horms@...nel.org, davem@...emloft.net, edumazet@...gle.com,
 herbert@...dor.apana.org.au, linux-kernel@...r.kernel.org,
 linux-kselftest@...r.kernel.org, netdev@...r.kernel.org, pabeni@...hat.com,
 shuah@...nel.org, steffen.klassert@...unet.com
Subject: Re: [PATCH net V2] selftests/net/ipsec: Fix Null pointer
 dereference in rtattr_pack()

On Wed, 15 Jan 2025 11:13:22 +0800 Liu Ye wrote:
> From: liuye <liuye@...inos.cn>
> 
> From: Liu Ye <liuye@...inos.cn>

too many From lines.

> Address Null pointer dereference in rtattr_pack.

I think size is 0 in the bad case, so it's more of an undefinied
behavior.

> Flagged by cppcheck as:
>     tools/testing/selftests/net/ipsec.c:230:25: warning: Possible null pointer
>     dereference: payload [nullPointer]
>     memcpy(RTA_DATA(attr), payload, size);
>                            ^
>     tools/testing/selftests/net/ipsec.c:1618:54: note: Calling function 'rtattr_pack',
>     4th argument 'NULL' value is 0
>     if (rtattr_pack(&req.nh, sizeof(req), XFRMA_IF_ID, NULL, 0)) {
>                                                        ^
>     tools/testing/selftests/net/ipsec.c:230:25: note: Null pointer dereference
>     memcpy(RTA_DATA(attr), payload, size);
>                            ^
> Fixes: 70bfdf62e93a ("selftests/net/ipsec: Add test for xfrm_spdattr_type_t")

Your Sign-off needs to be right after fixes.

> ---
> V2: Modify description.
>     Add code checking tools.
>     Separating family and given name in Signed-off-by line.
>     Modify code format.
>     Add fixes.
> ---

Please post v3 as a new thread (not in reply to).
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ