From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Zhaoyang Li <lizy04@hust.edu.cn>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.1.y] ipv4: Fix uninit-value access in __ip_make_skb()
Date: Fri, 16 May 2025 11:13:03 -0400 [thread overview]
Message-ID: <20250515081242-84ff67101aca95da@stable.kernel.org> (raw)
In-Reply-To: <20250515060244.413133-1-lizy04@hust.edu.cn>
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected.
No action required from the submitter.
The upstream commit SHA1 provided is correct: fc1092f51567277509563800a3c56732070b6aa4
WARNING: Author mismatch between patch and upstream commit:
Backport author: Zhaoyang Li<lizy04@hust.edu.cn>
Commit author: Shigeru Yoshida<syoshida@redhat.com>
Status in newer kernel trees:
6.14.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: 5db08343ddb1)
Note: The patch differs from the upstream commit:
---
1: fc1092f515672 ! 1: d14a3911b2aab ipv4: Fix uninit-value access in __ip_make_skb()
@@ Metadata
## Commit message ##
ipv4: Fix uninit-value access in __ip_make_skb()
+ [ Upstream commit fc1092f51567277509563800a3c56732070b6aa4 ]
+
KMSAN reported uninit-value access in __ip_make_skb() [1]. __ip_make_skb()
tests HDRINCL to know if the skb has icmphdr. However, HDRINCL can cause a
race condition. If calling setsockopt(2) with IP_HDRINCL changes HDRINCL
@@ Commit message
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Link: https://lore.kernel.org/r/20240430123945.2057348-1-syoshida@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+ Signed-off-by: Zhaoyang Li <lizy04@hust.edu.cn>
## net/ipv4/ip_output.c ##
@@ net/ipv4/ip_output.c: struct sk_buff *__ip_make_skb(struct sock *sk,
+ * so icmphdr does not in skb linear region and can not get icmp_type
* by icmp_hdr(skb)->type.
*/
- if (sk->sk_type == SOCK_RAW &&
-- !inet_test_bit(HDRINCL, sk))
+- if (sk->sk_type == SOCK_RAW && !inet_sk(sk)->hdrincl)
++ if (sk->sk_type == SOCK_RAW &&
+ !(fl4->flowi4_flags & FLOWI_FLAG_KNOWN_NH))
icmp_type = fl4->fl4_icmp_type;
else
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y | Success | Success |
prev parent reply other threads:[~2025-05-16 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 6:02 [PATCH 6.1.y] ipv4: Fix uninit-value access in __ip_make_skb() Zhaoyang Li
2025-05-16 15:13 ` Sasha Levin [this message]
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=20250515081242-84ff67101aca95da@stable.kernel.org \
--to=sashal@kernel.org \
--cc=lizy04@hust.edu.cn \
--cc=stable@vger.kernel.org \
/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