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 7EED12C197 for ; Wed, 28 Feb 2024 08:17:02 +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=1709108222; cv=none; b=W2EY4F1pvbpO1qyMSUO1qcN5iHQW5lRiOInke+RCMfLOWLJ3H8iAULa6Lht2YTAq6XUeshWoPozQNomg7uILuMWXWEZwD5SIyZCjOzeNREAHnNh8D2LGwi9b3x+VkMBtRXHKBGWW/+v+IP5PYV2pnx4SF3u/qMPqCy27lE9ZUqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108222; c=relaxed/simple; bh=+e5arWxj/K74kfeDvvCvHM2bmzH+lCaD8WLnD/3bq/E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=r51ftqc1/UjibP3DiBEpWffwAFU3HzCz02U6D3yw9sjBofPL+yeixREHMqB/QhuoWqNmIMQudL9aIA8DbA38JXgOOnB7bdBBK0QkZ18QCWYaQDFhmJamXXADpjrry2Nx//B0j7LLky4KEvuzQtm1KtqLASSseP74S0g95H3eM/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oId2DHWv; 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="oId2DHWv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E201C433C7; Wed, 28 Feb 2024 08:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108222; bh=+e5arWxj/K74kfeDvvCvHM2bmzH+lCaD8WLnD/3bq/E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=oId2DHWvnZDmUzVvg9oPNpqrm+KCo2CmPK9s6ZJdaMBSAcnicA7vUfGZ8591eqvCd VsQrakJWVrcIhWNKEs+S7XvP/jKp0MpaUK7VTM1fNRG1C0IVnZ9GXv7z6QKR7roObM by4Z6av9H+wctzdbHf76hq/7w9X6pYTzWOpkYPC0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47023: net: marvell: prestera: fix port event handling on init Date: Wed, 28 Feb 2024 09:15:11 +0100 Message-ID: <2024022833-CVE-2021-47023-118c@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=5093; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=C59rTucVtbTb2g1GD/rqZTOVtGM7HjvHqggd30juhzw=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3XmeaxF4wyV14VOhJpMqFBTyzXhl1PrzT1vH/lJPa9 /DYXvcZHTEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRZQYMCybbvGH+fbSt+V1I 1cYtTyOfLN7eHcgw46reEoXpSTPXcIr9k643iPj8cME0AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: gregkh@kernel.org Description =========== In the Linux kernel, the following vulnerability has been resolved: net: marvell: prestera: fix port event handling on init For some reason there might be a crash during ports creation if port events are handling at the same time because fw may send initial port event with down state. The crash points to cancel_delayed_work() which is called when port went is down. Currently I did not find out the real cause of the issue, so fixed it by cancel port stats work only if previous port's state was up & runnig. The following is the crash which can be triggered: [ 28.311104] Unable to handle kernel paging request at virtual address 000071775f776600 [ 28.319097] Mem abort info: [ 28.321914] ESR = 0x96000004 [ 28.324996] EC = 0x25: DABT (current EL), IL = 32 bits [ 28.330350] SET = 0, FnV = 0 [ 28.333430] EA = 0, S1PTW = 0 [ 28.336597] Data abort info: [ 28.339499] ISV = 0, ISS = 0x00000004 [ 28.343362] CM = 0, WnR = 0 [ 28.346354] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000100bf7000 [ 28.352842] [000071775f776600] pgd=0000000000000000, p4d=0000000000000000 [ 28.359695] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 28.365310] Modules linked in: prestera_pci(+) prestera uio_pdrv_genirq [ 28.372005] CPU: 0 PID: 1291 Comm: kworker/0:1H Not tainted 5.11.0-rc4 #1 [ 28.378846] Hardware name: DNI AmazonGo1 A7040 board (DT) [ 28.384283] Workqueue: prestera_fw_wq prestera_fw_evt_work_fn [prestera_pci] [ 28.391413] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--) [ 28.397468] pc : get_work_pool+0x48/0x60 [ 28.401442] lr : try_to_grab_pending+0x6c/0x1b0 [ 28.406018] sp : ffff80001391bc60 [ 28.409358] x29: ffff80001391bc60 x28: 0000000000000000 [ 28.414725] x27: ffff000104fc8b40 x26: ffff80001127de88 [ 28.420089] x25: 0000000000000000 x24: ffff000106119760 [ 28.425452] x23: ffff00010775dd60 x22: ffff00010567e000 [ 28.430814] x21: 0000000000000000 x20: ffff80001391bcb0 [ 28.436175] x19: ffff00010775deb8 x18: 00000000000000c0 [ 28.441537] x17: 0000000000000000 x16: 000000008d9b0e88 [ 28.446898] x15: 0000000000000001 x14: 00000000000002ba [ 28.452261] x13: 80a3002c00000002 x12: 00000000000005f4 [ 28.457622] x11: 0000000000000030 x10: 000000000000000c [ 28.462985] x9 : 000000000000000c x8 : 0000000000000030 [ 28.468346] x7 : ffff800014400000 x6 : ffff000106119758 [ 28.473708] x5 : 0000000000000003 x4 : ffff00010775dc60 [ 28.479068] x3 : 0000000000000000 x2 : 0000000000000060 [ 28.484429] x1 : 000071775f776600 x0 : ffff00010775deb8 [ 28.489791] Call trace: [ 28.492259] get_work_pool+0x48/0x60 [ 28.495874] cancel_delayed_work+0x38/0xb0 [ 28.500011] prestera_port_handle_event+0x90/0xa0 [prestera] [ 28.505743] prestera_evt_recv+0x98/0xe0 [prestera] [ 28.510683] prestera_fw_evt_work_fn+0x180/0x228 [prestera_pci] [ 28.516660] process_one_work+0x1e8/0x360 [ 28.520710] worker_thread+0x44/0x480 [ 28.524412] kthread+0x154/0x160 [ 28.527670] ret_from_fork+0x10/0x38 [ 28.531290] Code: a8c17bfd d50323bf d65f03c0 9278dc21 (f9400020) [ 28.537429] ---[ end trace 5eced933df3a080b ]--- The Linux kernel CVE team has assigned CVE-2021-47023 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 501ef3066c89 and fixed in 5.10.37 with commit 0ce6052802be Issue introduced in 5.10 with commit 501ef3066c89 and fixed in 5.11.21 with commit b5bba6ede426 Issue introduced in 5.10 with commit 501ef3066c89 and fixed in 5.12.4 with commit 9d1ba11fabdd Issue introduced in 5.10 with commit 501ef3066c89 and fixed in 5.13 with commit 333980481b99 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-47023 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/0ce6052802be2cb61a57b753e41301339c88c839 https://git.kernel.org/stable/c/b5bba6ede42693f50ce1c9944315cefed7491061 https://git.kernel.org/stable/c/9d1ba11fabdd8f25abb24272ef1621417981320b https://git.kernel.org/stable/c/333980481b99edb24ebd5d1a53af70a15d9146de