* [PATCH net] ipv6: Fix potential uninit-value access in __ip6_make_skb()
@ 2024-05-06 14:11 Shigeru Yoshida
2024-05-08 11:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Shigeru Yoshida @ 2024-05-06 14:11 UTC (permalink / raw)
To: davem, dsahern, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, Shigeru Yoshida
As it was done in commit fc1092f51567 ("ipv4: Fix uninit-value access in
__ip_make_skb()") for IPv4, check FLOWI_FLAG_KNOWN_NH on fl6->flowi6_flags
instead of testing HDRINCL on the socket to avoid a race condition which
causes uninit-value access.
Fixes: ea30388baebc ("ipv6: Fix an uninit variable access bug in __ip6_make_skb()")
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
---
net/ipv6/ip6_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index b9dd3a66e423..fa2937732665 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1933,7 +1933,7 @@ struct sk_buff *__ip6_make_skb(struct sock *sk,
u8 icmp6_type;
if (sk->sk_socket->type == SOCK_RAW &&
- !inet_test_bit(HDRINCL, sk))
+ !(fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH))
icmp6_type = fl6->fl6_icmp_type;
else
icmp6_type = icmp6_hdr(skb)->icmp6_type;
--
2.44.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH net] ipv6: Fix potential uninit-value access in __ip6_make_skb()
2024-05-06 14:11 [PATCH net] ipv6: Fix potential uninit-value access in __ip6_make_skb() Shigeru Yoshida
@ 2024-05-08 11:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-08 11:30 UTC (permalink / raw)
To: Shigeru Yoshida
Cc: davem, dsahern, edumazet, kuba, pabeni, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Mon, 6 May 2024 23:11:29 +0900 you wrote:
> As it was done in commit fc1092f51567 ("ipv4: Fix uninit-value access in
> __ip_make_skb()") for IPv4, check FLOWI_FLAG_KNOWN_NH on fl6->flowi6_flags
> instead of testing HDRINCL on the socket to avoid a race condition which
> causes uninit-value access.
>
> Fixes: ea30388baebc ("ipv6: Fix an uninit variable access bug in __ip6_make_skb()")
> Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
>
> [...]
Here is the summary with links:
- [net] ipv6: Fix potential uninit-value access in __ip6_make_skb()
https://git.kernel.org/netdev/net/c/4e13d3a9c25b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-08 11:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-06 14:11 [PATCH net] ipv6: Fix potential uninit-value access in __ip6_make_skb() Shigeru Yoshida
2024-05-08 11:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®