Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D51081F8EEC for ; Mon, 21 Oct 2024 19:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729539609; cv=none; b=WjZ+Pxh/sANBCxw/9AC1mozT1HWcrIVL325of6HURF++4tCnoYEp5t13f7W7rW/o4NfKQq6hSE8Tgx+4ak9rf7hl7XEagudeQZXfhJWB/kZdrlKqCO5cZBWrn15gldXugRUJpIknTOZ2Zz/UKMO1FqMsffIKAG4KpNVHIS27vTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729539609; c=relaxed/simple; bh=blZmY04W6A8JC9jm8+ad8zbpk2YsmoOibGw1QevZxUo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=t3k9YChR1Ve6bZJBGIqvKUEW2ijtiOXc4sCDK+e2NAU2EWeDAOVCsxtFpzlYCoC1go6XXRXf3xdOLiL61PXWbTSIOW6AzZP/XjBqQ25TJGs6aOgvPt+ekiHIW3IfSLNENANAjzR2fh7VnscOPmDPuYEWSilmhNAE1C6V96G4CaA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YPpZU50I; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YPpZU50I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0803EC4CEC3; Mon, 21 Oct 2024 19:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729539609; bh=blZmY04W6A8JC9jm8+ad8zbpk2YsmoOibGw1QevZxUo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=YPpZU50ILCt0KpDvx+qRb+hmMLorTHohBhCh974gn08FX740ZN5gc0i2GDbFKBkdk 8lXaEg7rSQEW0MaS4t1NDpJt+hs8SHThq/M2+71UaX+Vvb1qA2e/v5Dnv/qlBh2hdk 7ye8XHSb9TezqpPN98qKGNZYRCHJWOFgsS7UDme0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50033: slip: make slhc_remember() more robust against malicious packets Date: Mon, 21 Oct 2024 21:39:39 +0200 Message-ID: <2024102131-CVE-2024-50033-ce5e@gregkh> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=5230; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=blZmY04W6A8JC9jm8+ad8zbpk2YsmoOibGw1QevZxUo=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliaz/rZsyat6Hm/2TZK5u9ZGuXd/7fK/t5BsOWVhkv6 2zjBWdfdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEuPUY5qd9PiGmY8GfXHfI 7I1Ca/sN5Q7eBQwLOlMSBO8fWDGl5H/dzcwbrWv+aKUXAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: slip: make slhc_remember() more robust against malicious packets syzbot found that slhc_remember() was missing checks against malicious packets [1]. slhc_remember() only checked the size of the packet was at least 20, which is not good enough. We need to make sure the packet includes the IPv4 and TCP header that are supposed to be carried. Add iph and th pointers to make the code more readable. [1] BUG: KMSAN: uninit-value in slhc_remember+0x2e8/0x7b0 drivers/net/slip/slhc.c:666 slhc_remember+0x2e8/0x7b0 drivers/net/slip/slhc.c:666 ppp_receive_nonmp_frame+0xe45/0x35e0 drivers/net/ppp/ppp_generic.c:2455 ppp_receive_frame drivers/net/ppp/ppp_generic.c:2372 [inline] ppp_do_recv+0x65f/0x40d0 drivers/net/ppp/ppp_generic.c:2212 ppp_input+0x7dc/0xe60 drivers/net/ppp/ppp_generic.c:2327 pppoe_rcv_core+0x1d3/0x720 drivers/net/ppp/pppoe.c:379 sk_backlog_rcv+0x13b/0x420 include/net/sock.h:1113 __release_sock+0x1da/0x330 net/core/sock.c:3072 release_sock+0x6b/0x250 net/core/sock.c:3626 pppoe_sendmsg+0x2b8/0xb90 drivers/net/ppp/pppoe.c:903 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg+0x30f/0x380 net/socket.c:744 ____sys_sendmsg+0x903/0xb60 net/socket.c:2602 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2656 __sys_sendmmsg+0x3c1/0x960 net/socket.c:2742 __do_sys_sendmmsg net/socket.c:2771 [inline] __se_sys_sendmmsg net/socket.c:2768 [inline] __x64_sys_sendmmsg+0xbc/0x120 net/socket.c:2768 x64_sys_call+0xb6e/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:308 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Uninit was created at: slab_post_alloc_hook mm/slub.c:4091 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x6bf/0xb80 mm/slub.c:4186 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:587 __alloc_skb+0x363/0x7b0 net/core/skbuff.c:678 alloc_skb include/linux/skbuff.h:1322 [inline] sock_wmalloc+0xfe/0x1a0 net/core/sock.c:2732 pppoe_sendmsg+0x3a7/0xb90 drivers/net/ppp/pppoe.c:867 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg+0x30f/0x380 net/socket.c:744 ____sys_sendmsg+0x903/0xb60 net/socket.c:2602 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2656 __sys_sendmmsg+0x3c1/0x960 net/socket.c:2742 __do_sys_sendmmsg net/socket.c:2771 [inline] __se_sys_sendmmsg net/socket.c:2768 [inline] __x64_sys_sendmmsg+0xbc/0x120 net/socket.c:2768 x64_sys_call+0xb6e/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:308 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f CPU: 0 UID: 0 PID: 5460 Comm: syz.2.33 Not tainted 6.12.0-rc2-syzkaller-00006-g87d6aab2389e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 The Linux kernel CVE team has assigned CVE-2024-50033 to this issue. Affected and fixed versions =========================== Issue introduced in 3.2 with commit b5451d783ade and fixed in 5.10.227 with commit 36b054324d18 Issue introduced in 3.2 with commit b5451d783ade and fixed in 5.15.168 with commit 5e336384cc9b Issue introduced in 3.2 with commit b5451d783ade and fixed in 6.1.113 with commit ff5e0f895315 Issue introduced in 3.2 with commit b5451d783ade and fixed in 6.6.57 with commit 8bb79eb1db85 Issue introduced in 3.2 with commit b5451d783ade and fixed in 6.11.4 with commit 29e8d96d44f5 Issue introduced in 3.2 with commit b5451d783ade and fixed in 6.12-rc3 with commit 7d3fce8cbe3a Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-50033 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/slip/slhc.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/36b054324d18e51cf466134e13b6fbe3c91f52af https://git.kernel.org/stable/c/5e336384cc9b608e0551f99c3d87316ca3b0e51a https://git.kernel.org/stable/c/ff5e0f895315706e4ca5a19df15be6866cee4f5d https://git.kernel.org/stable/c/8bb79eb1db85a10865f0d4dd15b013def3f2d246 https://git.kernel.org/stable/c/29e8d96d44f51cf89a62dd042be35d052833b95c https://git.kernel.org/stable/c/7d3fce8cbe3a70a1c7c06c9b53696be5d5d8dd5c