Patch "llc: Drop support for ETH_P_TR_802_2." has been added to the 5.4-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

    llc: Drop support for ETH_P_TR_802_2.

to the 5.4-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:
     llc-drop-support-for-eth_p_tr_802_2.patch
and it can be found in the queue-5.4 subdirectory.

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



commit f7c2a1f40acc30c85e1bb76a3a47c31cc12f8386
Author: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Date:   Thu Jan 18 17:55:15 2024 -0800

    llc: Drop support for ETH_P_TR_802_2.
    
    [ Upstream commit e3f9bed9bee261e3347131764e42aeedf1ffea61 ]
    
    syzbot reported an uninit-value bug below. [0]
    
    llc supports ETH_P_802_2 (0x0004) and used to support ETH_P_TR_802_2
    (0x0011), and syzbot abused the latter to trigger the bug.
    
      write$tun(r0, &(0x7f0000000040)={@val={0x0, 0x11}, @val, @mpls={[], @llc={@snap={0xaa, 0x1, ')', "90e5dd"}}}}, 0x16)
    
    llc_conn_handler() initialises local variables {saddr,daddr}.mac
    based on skb in llc_pdu_decode_sa()/llc_pdu_decode_da() and passes
    them to __llc_lookup().
    
    However, the initialisation is done only when skb->protocol is
    htons(ETH_P_802_2), otherwise, __llc_lookup_established() and
    __llc_lookup_listener() will read garbage.
    
    The missing initialisation existed prior to commit 211ed865108e
    ("net: delete all instances of special processing for token ring").
    
    It removed the part to kick out the token ring stuff but forgot to
    close the door allowing ETH_P_TR_802_2 packets to sneak into llc_rcv().
    
    Let's remove llc_tr_packet_type and complete the deprecation.
    
    [0]:
    BUG: KMSAN: uninit-value in __llc_lookup_established+0xe9d/0xf90
     __llc_lookup_established+0xe9d/0xf90
     __llc_lookup net/llc/llc_conn.c:611 [inline]
     llc_conn_handler+0x4bd/0x1360 net/llc/llc_conn.c:791
     llc_rcv+0xfbb/0x14a0 net/llc/llc_input.c:206
     __netif_receive_skb_one_core net/core/dev.c:5527 [inline]
     __netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5641
     netif_receive_skb_internal net/core/dev.c:5727 [inline]
     netif_receive_skb+0x58/0x660 net/core/dev.c:5786
     tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1555
     tun_get_user+0x53af/0x66d0 drivers/net/tun.c:2002
     tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048
     call_write_iter include/linux/fs.h:2020 [inline]
     new_sync_write fs/read_write.c:491 [inline]
     vfs_write+0x8ef/0x1490 fs/read_write.c:584
     ksys_write+0x20f/0x4c0 fs/read_write.c:637
     __do_sys_write fs/read_write.c:649 [inline]
     __se_sys_write fs/read_write.c:646 [inline]
     __x64_sys_write+0x93/0xd0 fs/read_write.c:646
     do_syscall_x64 arch/x86/entry/common.c:51 [inline]
     do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
     entry_SYSCALL_64_after_hwframe+0x63/0x6b
    
    Local variable daddr created at:
     llc_conn_handler+0x53/0x1360 net/llc/llc_conn.c:783
     llc_rcv+0xfbb/0x14a0 net/llc/llc_input.c:206
    
    CPU: 1 PID: 5004 Comm: syz-executor994 Not tainted 6.6.0-syzkaller-14500-g1c41041124bd #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
    
    Fixes: 211ed865108e ("net: delete all instances of special processing for token ring")
    Reported-by: syzbot+b5ad66046b913bc04c6f@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=b5ad66046b913bc04c6f
    Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240119015515.61898-1-kuniyu@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h
index 49aa79c7b278..581cd37aa98b 100644
--- a/include/net/llc_pdu.h
+++ b/include/net/llc_pdu.h
@@ -262,8 +262,7 @@ static inline void llc_pdu_header_init(struct sk_buff *skb, u8 type,
  */
 static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
 {
-	if (skb->protocol == htons(ETH_P_802_2))
-		memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN);
+	memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN);
 }
 
 /**
@@ -275,8 +274,7 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
  */
 static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da)
 {
-	if (skb->protocol == htons(ETH_P_802_2))
-		memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN);
+	memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN);
 }
 
 /**
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c
index 64d4bef04e73..4900a27b5176 100644
--- a/net/llc/llc_core.c
+++ b/net/llc/llc_core.c
@@ -135,22 +135,15 @@ static struct packet_type llc_packet_type __read_mostly = {
 	.func = llc_rcv,
 };
 
-static struct packet_type llc_tr_packet_type __read_mostly = {
-	.type = cpu_to_be16(ETH_P_TR_802_2),
-	.func = llc_rcv,
-};
-
 static int __init llc_init(void)
 {
 	dev_add_pack(&llc_packet_type);
-	dev_add_pack(&llc_tr_packet_type);
 	return 0;
 }
 
 static void __exit llc_exit(void)
 {
 	dev_remove_pack(&llc_packet_type);
-	dev_remove_pack(&llc_tr_packet_type);
 }
 
 module_init(llc_init);




[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