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 AAD9928983A for ; Wed, 18 Jun 2025 11:07:56 +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=1750244876; cv=none; b=eX9IsotG0C7MnYX+bEuiETAjQOstS3RKplMgi1cs34CaejsvIwQ3xXgAEYpQSMBZ/aox1u6LaAsOEslmePmXPmTbJ6b0CKfbzG8xe6epQNT8JRgMlxc32u4uKmvchOvnzjRZJbgo0EgOlouYUcuFHjPT3Zu3YHeHQrxZSJ5fFBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244876; c=relaxed/simple; bh=X4Zo6wH9U1OLXX1IG21TzRo7tBb2XW9dM2o/6x17Rek=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QJPbMUsKeNXzVOUvYPvsx/si5RHR1rGY3bd9AtZArdWSW5EKG/Wqbk3EtGwa3FlLbPjr20plyFUMq/x8YG2vTnynwjBPWNefikAOwEyVq4M5cyTjZnGonwRJt1Z8XJYSnJtLfaioz0iFSPCCj4YI7SAVGGGtaXuQejUETmxCtO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cnQlMort; 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="cnQlMort" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20EC1C4CEE7; Wed, 18 Jun 2025 11:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244876; bh=X4Zo6wH9U1OLXX1IG21TzRo7tBb2XW9dM2o/6x17Rek=; h=From:To:Cc:Subject:Date:Reply-to:From; b=cnQlMortpskQaJyvU60Fld6uXiygaVsKpFwIwZscVUQ0abZCUV9FO9JLS9AuC4MdK dU/ZQ7JZQdeKdrCWLhx3EuKgWDzYtp/P5NAJaYmIamLK6xfB5AtoVwthjJZ6dmwiPC WebQQgW/Mc+B1g0Lu95kBkyxg57jzRA+RyTGINwI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50063: net: dsa: felix: suppress non-changes to the tagging protocol Date: Wed, 18 Jun 2025 13:02:08 +0200 Message-ID: <2025061850-CVE-2022-50063-a233@gregkh> X-Mailer: git-send-email 2.49.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=3548; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Pli063BYLEglyffXzmgpYr5IKUskGmtrzBgsfrxXRno=; b=kA0DAAIRMUfUDdst+ykByyZiAGhSnGKjM92RhqjJKmygvB0Hbos0zAbuYJWO5vXFzzGKHSvuo YhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmhSnGIACgkQMUfUDdst+yl39wCffHIp 7oxmyrMw+vrhLXpOo/iKmecAn3nCvd5YLPBpGfBLagLbrg4NsIiD X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net: dsa: felix: suppress non-changes to the tagging protocol The way in which dsa_tree_change_tag_proto() works is that when dsa_tree_notify() fails, it doesn't know whether the operation failed mid way in a multi-switch tree, or it failed for a single-switch tree. So even though drivers need to fail cleanly in ds->ops->change_tag_protocol(), DSA will still call dsa_tree_notify() again, to restore the old tag protocol for potential switches in the tree where the change did succeeed (before failing for others). This means for the felix driver that if we report an error in felix_change_tag_protocol(), we'll get another call where proto_ops == old_proto_ops. If we proceed to act upon that, we may do unexpected things. For example, we will call dsa_tag_8021q_register() twice in a row, without any dsa_tag_8021q_unregister() in between. Then we will actually call dsa_tag_8021q_unregister() via old_proto_ops->teardown, which (if it manages to run at all, after walking through corrupted data structures) will leave the ports inoperational anyway. The bug can be readily reproduced if we force an error while in tag_8021q mode; this crashes the kernel. echo ocelot-8021q > /sys/class/net/eno2/dsa/tagging echo edsa > /sys/class/net/eno2/dsa/tagging # -EPROTONOSUPPORT Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014 Call trace: vcap_entry_get+0x24/0x124 ocelot_vcap_filter_del+0x198/0x270 felix_tag_8021q_vlan_del+0xd4/0x21c dsa_switch_tag_8021q_vlan_del+0x168/0x2cc dsa_switch_event+0x68/0x1170 dsa_tree_notify+0x14/0x34 dsa_port_tag_8021q_vlan_del+0x84/0x110 dsa_tag_8021q_unregister+0x15c/0x1c0 felix_tag_8021q_teardown+0x16c/0x180 felix_change_tag_protocol+0x1bc/0x230 dsa_switch_event+0x14c/0x1170 dsa_tree_change_tag_proto+0x118/0x1c0 The Linux kernel CVE team has assigned CVE-2022-50063 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit 7a29d220f4c0745a6d435dbd53c659fbde4998b6 and fixed in 5.19.4 with commit 8e432f157c3edc5a97a7244c666589a438f5e4d4 Issue introduced in 5.19 with commit 7a29d220f4c0745a6d435dbd53c659fbde4998b6 and fixed in 6.0 with commit 4c46bb49460ee14c69629e813640d8b929e88941 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-2022-50063 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/dsa/ocelot/felix.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/8e432f157c3edc5a97a7244c666589a438f5e4d4 https://git.kernel.org/stable/c/4c46bb49460ee14c69629e813640d8b929e88941