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 8318F1DD88D for ; Tue, 5 Nov 2024 17:13: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=1730826789; cv=none; b=gDHRMP6siUpN8niCO2T7QnxtF96I+5mcsJ6BziI+ZcbLjPDg3dwd5ih3nF8XTfWLgLtWxYMYEMPZDtnvyF1CfgpTiLus7UUTm5ak0jgbR1I6KyazxC15guZLiqpqBHV+B1eYUSPJCBtqWNY9q5SrkxhbHnEqfsJQfBBdztw8tmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730826789; c=relaxed/simple; bh=G5KyG/eHjUI06TPjZMT5Mwgf+zM2EBrIimdZLXvBiUk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DqwXaDu5zH5LuTW7h9fXUOuy53YybmWyrdFS1GJSaU2AQam05fpen+JJhhYqRVm3QXmuTkqjeqogTb3+GKJxTqZVg7HP7oNpk+FZnr/HLGktXsWfg7Ig32TH7rinR8PEvJnLikArMZk+ZqJbSyVwdl1s/JBzB+9L9nY/jyhPN7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VOE68FKQ; 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="VOE68FKQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 091C3C4CECF; Tue, 5 Nov 2024 17:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730826789; bh=G5KyG/eHjUI06TPjZMT5Mwgf+zM2EBrIimdZLXvBiUk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VOE68FKQqapH8OmpWWgt+mi6ptaC66gycfcWGh8LG7udU4NbVbfiT+UZi2KIExk2d ApNvmad2bX9pTtgOhRmjRriwU4n/yBD8aN73x7OV80+otyZcdkzkyPCtoqhTt4TOgr V7AhVnk8KJ0SWcLFfciGyuhTyCvcTDBddst268VE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50128: net: wwan: fix global oob in wwan_rtnl_policy Date: Tue, 5 Nov 2024 18:11:17 +0100 Message-ID: <2024110557-CVE-2024-50128-0fd8@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=5767; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=G5KyG/eHjUI06TPjZMT5Mwgf+zM2EBrIimdZLXvBiUk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlagQsnH62/GbL84QcNTSWmmux1zJveqzjuc7WcFrQ1O eNqxf55HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCREGGG+eFHXn77v+qzw8+p Ny2MtrHG1U2e9ZFhvpPHQk6JjfEvLcU2bZJYVhLBsfx6GgA= 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: net: wwan: fix global oob in wwan_rtnl_policy The variable wwan_rtnl_link_ops assign a *bigger* maxtype which leads to a global out-of-bounds read when parsing the netlink attributes. Exactly same bug cause as the oob fixed in commit b33fb5b801c6 ("net: qualcomm: rmnet: fix global oob in rmnet_policy"). ================================================================== BUG: KASAN: global-out-of-bounds in validate_nla lib/nlattr.c:388 [inline] BUG: KASAN: global-out-of-bounds in __nla_validate_parse+0x19d7/0x29a0 lib/nlattr.c:603 Read of size 1 at addr ffffffff8b09cb60 by task syz.1.66276/323862 CPU: 0 PID: 323862 Comm: syz.1.66276 Not tainted 6.1.70 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x177/0x231 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x14f/0x750 mm/kasan/report.c:395 kasan_report+0x139/0x170 mm/kasan/report.c:495 validate_nla lib/nlattr.c:388 [inline] __nla_validate_parse+0x19d7/0x29a0 lib/nlattr.c:603 __nla_parse+0x3c/0x50 lib/nlattr.c:700 nla_parse_nested_deprecated include/net/netlink.h:1269 [inline] __rtnl_newlink net/core/rtnetlink.c:3514 [inline] rtnl_newlink+0x7bc/0x1fd0 net/core/rtnetlink.c:3623 rtnetlink_rcv_msg+0x794/0xef0 net/core/rtnetlink.c:6122 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2508 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline] netlink_unicast+0x74b/0x8c0 net/netlink/af_netlink.c:1352 netlink_sendmsg+0x882/0xb90 net/netlink/af_netlink.c:1874 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] ____sys_sendmsg+0x5cc/0x8f0 net/socket.c:2499 ___sys_sendmsg+0x21c/0x290 net/socket.c:2553 __sys_sendmsg net/socket.c:2582 [inline] __do_sys_sendmsg net/socket.c:2591 [inline] __se_sys_sendmsg+0x19e/0x270 net/socket.c:2589 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x90 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f67b19a24ad RSP: 002b:00007f67b17febb8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f67b1b45f80 RCX: 00007f67b19a24ad RDX: 0000000000000000 RSI: 0000000020005e40 RDI: 0000000000000004 RBP: 00007f67b1a1e01d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd2513764f R14: 00007ffd251376e0 R15: 00007f67b17fed40 The buggy address belongs to the variable: wwan_rtnl_policy+0x20/0x40 The buggy address belongs to the physical page: page:ffffea00002c2700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xb09c flags: 0xfff00000001000(reserved|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000001000 ffffea00002c2708 ffffea00002c2708 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner info is not present (never set?) Memory state around the buggy address: ffffffff8b09ca00: 05 f9 f9 f9 05 f9 f9 f9 00 01 f9 f9 00 01 f9 f9 ffffffff8b09ca80: 00 00 00 05 f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9 >ffffffff8b09cb00: 00 00 00 00 05 f9 f9 f9 00 00 00 00 f9 f9 f9 f9 ^ ffffffff8b09cb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== According to the comment of `nla_parse_nested_deprecated`, use correct size `IFLA_WWAN_MAX` here to fix this issue. The Linux kernel CVE team has assigned CVE-2024-50128 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 88b710532e53 and fixed in 5.15.170 with commit c9a0aed51977 Issue introduced in 5.14 with commit 88b710532e53 and fixed in 6.1.115 with commit 9683804e3666 Issue introduced in 5.14 with commit 88b710532e53 and fixed in 6.6.59 with commit 69076f8435c1 Issue introduced in 5.14 with commit 88b710532e53 and fixed in 6.11.6 with commit a3ffce63dcc0 Issue introduced in 5.14 with commit 88b710532e53 and fixed in 6.12-rc5 with commit 47dd5447cab8 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-50128 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/wwan/wwan_core.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/c9a0aed51977198df005d0a623090e38e2d77d7b https://git.kernel.org/stable/c/9683804e36668f6093fb06e202eed2f188ba437e https://git.kernel.org/stable/c/69076f8435c1c5dae5f814eaf4c361d1f00b22a3 https://git.kernel.org/stable/c/a3ffce63dcc0c208edd4d196e17baed22ebcb643 https://git.kernel.org/stable/c/47dd5447cab8ce30a847a0337d5341ae4c7476a7