mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 04:15:21 +02:00
ipv6: Fix potential uninit-value access in __ip6_make_skb()
[ Upstream commit4e13d3a9c2
] As it was done in commitfc1092f515
("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:ea30388bae
("ipv6: Fix an uninit variable access bug in __ip6_make_skb()") Signed-off-by: Shigeru Yoshida <syoshida@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1ce60741d7
commit
68c8ba16ab
|
@ -2003,7 +2003,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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user