Patch "ipv6: Fix potential uninit-value access in __ip6_make_skb()" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ipv6: Fix potential uninit-value access in __ip6_make_skb()

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipv6-fix-potential-uninit-value-access-in-__ip6_make.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 724e2794867f68ad3e2a96c94fc9b05fb1393a0d
Author: Shigeru Yoshida <syoshida@xxxxxxxxxx>
Date:   Mon May 6 23:11:29 2024 +0900

    ipv6: Fix potential uninit-value access in __ip6_make_skb()
    
    [ Upstream commit 4e13d3a9c25b7080f8a619f961e943fe08c2672c ]
    
    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@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 31b86fe661aa6..568065a015c41 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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux