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 BA94762146 for ; Mon, 4 Mar 2024 18:12:53 +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=1709575973; cv=none; b=NC+GjDz97J3f7PF4tQzdmNkQryrC3Xt/a9cdqAzXkDPzlWn7l4W+Wg7800BMbG+ZgKJT2CxLfmC1bS5VN2f9SDAWdMolSWIdn9dBS+O+V8bq9MvgEMR+rMbj702fZ25AIqIQNOVjOjqfopmanthFGa8bYyt1aaVDjWdioNKesH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709575973; c=relaxed/simple; bh=qTh2/lB7jC+aCD2tDUNwsW0wqkktFXnks7cQIBMA+O0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qK4r6gqSMVLGgpmkVEb1EkxwAi/RSBk0ReACOQM+1GBOdFqoM+324AvIjpdJ8RXT3vOpyqXqV3OzjRPve4uy9UYS0RP0uZlQbQDL0bPvoibhMXkVWTf8Jp4vqv+l4oDRGJnXInppW1JEsyuOqm9GmoidDApLSmQ6ixq11owCYs8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PjdZA/2H; 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="PjdZA/2H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48EF7C433C7; Mon, 4 Mar 2024 18:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709575973; bh=qTh2/lB7jC+aCD2tDUNwsW0wqkktFXnks7cQIBMA+O0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=PjdZA/2HgSty3Pr3SaUx9iDQKbUcubkUiNgeJJknsQona46deLuZUQiS+eMW/V3Vw V9Ap8ZElDa3nievLoG2TytMnBvwXIEBWzkuQHy2XiuRf/rDIHjA2QgOToHPxBsb+6g 3dyO30Z/vSPIquUZqbRN0o46eKnyukLwl5MibXEE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47102: net: marvell: prestera: fix incorrect structure access Date: Mon, 4 Mar 2024 19:11:29 +0100 Message-ID: <2024030416-CVE-2021-47102-1335@gregkh> X-Mailer: git-send-email 2.44.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=3017; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qTh2/lB7jC+aCD2tDUNwsW0wqkktFXnks7cQIBMA+O0=; b=owGbwMvMwCRo6H6F97bub03G02pJDKnP+I70MMs+ced5qfdrWsKDpgxDK3/xO4uza8+I7dOa9 CBBIHB5RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkfgzDgkU/LS7tt9RxvRdk /uLziYrAxFdvvzHMD1mvEGWQUZW8UfJpesWxT5oXxE8bAQA= 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: marvell: prestera: fix incorrect structure access In line: upper = info->upper_dev; We access upper_dev field, which is related only for particular events (e.g. event == NETDEV_CHANGEUPPER). So, this line cause invalid memory access for another events, when ptr is not netdev_notifier_changeupper_info. The KASAN logs are as follows: [ 30.123165] BUG: KASAN: stack-out-of-bounds in prestera_netdev_port_event.constprop.0+0x68/0x538 [prestera] [ 30.133336] Read of size 8 at addr ffff80000cf772b0 by task udevd/778 [ 30.139866] [ 30.141398] CPU: 0 PID: 778 Comm: udevd Not tainted 5.16.0-rc3 #6 [ 30.147588] Hardware name: DNI AmazonGo1 A7040 board (DT) [ 30.153056] Call trace: [ 30.155547] dump_backtrace+0x0/0x2c0 [ 30.159320] show_stack+0x18/0x30 [ 30.162729] dump_stack_lvl+0x68/0x84 [ 30.166491] print_address_description.constprop.0+0x74/0x2b8 [ 30.172346] kasan_report+0x1e8/0x250 [ 30.176102] __asan_load8+0x98/0xe0 [ 30.179682] prestera_netdev_port_event.constprop.0+0x68/0x538 [prestera] [ 30.186847] prestera_netdev_event_handler+0x1b4/0x1c0 [prestera] [ 30.193313] raw_notifier_call_chain+0x74/0xa0 [ 30.197860] call_netdevice_notifiers_info+0x68/0xc0 [ 30.202924] register_netdevice+0x3cc/0x760 [ 30.207190] register_netdev+0x24/0x50 [ 30.211015] prestera_device_register+0x8a0/0xba0 [prestera] The Linux kernel CVE team has assigned CVE-2021-47102 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 3d5048cc54bd and fixed in 5.15.12 with commit 5c553a0cd126 Issue introduced in 5.14 with commit 3d5048cc54bd and fixed in 5.16 with commit 2efc2256febf Please see https://www.kernel.org or 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-2021-47102 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/ethernet/marvell/prestera/prestera_main.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/5c553a0cd1263e4da5f220d80fa713fc3959c1d0 https://git.kernel.org/stable/c/2efc2256febf214e7b2bdaa21fe6c3c3146acdcb