CVE-2022-50063

Source
https://cve.org/CVERecord?id=CVE-2022-50063
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50063.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50063
Downstream
Published
2025-06-18T11:02:10.473Z
Modified
2026-04-02T08:28:11.634754Z
Summary
net: dsa: felix: suppress non-changes to the tagging protocol
Details

In the Linux kernel, the following vulnerability has been resolved:

net: dsa: felix: suppress non-changes to the tagging protocol

The way in which dsatreechangetagproto() works is that when dsatreenotify() 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->changetagprotocol(), DSA will still call dsatreenotify() 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 felixchangetagprotocol(), we'll get another call where protoops == oldprotoops. If we proceed to act upon that, we may do unexpected things. For example, we will call dsatag8021qregister() twice in a row, without any dsatag8021qunregister() in between. Then we will actually call dsatag8021qunregister() via oldproto_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: vcapentryget+0x24/0x124 ocelotvcapfilterdel+0x198/0x270 felixtag8021qvlandel+0xd4/0x21c dsaswitchtag8021qvlandel+0x168/0x2cc dsaswitchevent+0x68/0x1170 dsatreenotify+0x14/0x34 dsaporttag8021qvlandel+0x84/0x110 dsatag8021qunregister+0x15c/0x1c0 felixtag8021qteardown+0x16c/0x180 felixchangetagprotocol+0x1bc/0x230 dsaswitchevent+0x14c/0x1170 dsatreechangetagproto+0x118/0x1c0

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50063.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7a29d220f4c0745a6d435dbd53c659fbde4998b6
Fixed
8e432f157c3edc5a97a7244c666589a438f5e4d4
Fixed
4c46bb49460ee14c69629e813640d8b929e88941

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50063.json"