Skip to content

Commit 4e13d3a

Browse files
Shigeru Yoshidadavem330
authored andcommitted
ipv6: Fix potential uninit-value access in __ip6_make_skb()
As it was done in commit fc1092f ("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: ea30388 ("ipv6: Fix an uninit variable access bug in __ip6_make_skb()") Signed-off-by: Shigeru Yoshida <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ab0cde3 commit 4e13d3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/ip6_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ struct sk_buff *__ip6_make_skb(struct sock *sk,
19331933
u8 icmp6_type;
19341934

19351935
if (sk->sk_socket->type == SOCK_RAW &&
1936-
!inet_test_bit(HDRINCL, sk))
1936+
!(fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH))
19371937
icmp6_type = fl6->fl6_icmp_type;
19381938
else
19391939
icmp6_type = icmp6_hdr(skb)->icmp6_type;

0 commit comments

Comments
 (0)