CVE-2024-53044: net/sched: sch_api: fix xa_insert() error path in tcf_block_get_ext()
In the Linux kernel, the following vulnerability has been resolved:
net/sched: schapi: fix xainsert() error path in tcfblockgetext()
This command:
$ tc qdisc replace dev eth0 ingressblock 1 egressblock 1 clsact Error: block dev insert failed: -EBUSY.
fails because user space requests the same block index to be set for both ingress and egress.
[ side note, I don't think it even failed prior to commit 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra"), because this is a command from an old set of notes of mine which used to work, but alas, I did not scientifically bisect this ]
The problem is not that it fails, but rather, that the second time around, it fails differently (and irrecoverably):
$ tc qdisc replace dev eth0 ingressblock 1 egressblock 1 clsact Error: dsacore: Flow block cb is busy.
[ another note: the extack is added by me for illustration purposes. the context of the problem is that clsactinit() obtains the same &q->ingressblock pointer as &q->egressblock, and since we call tcfblockgetext() on both of them, "dev" will be added to the block->ports xarray twice, thus failing the operation: once through the ingress block pointer, and once again through the egress block pointer. the problem itself is that when xainsert() fails, we have emitted a FLOWBLOCKBIND command through ndosetuptc(), but the offload never sees a corresponding FLOWBLOCKUNBIND. ]
Even correcting the bad user input, we still cannot recover:
$ tc qdisc replace dev swp3 ingressblock 1 egressblock 2 clsact Error: dsacore: Flow block cb is busy.
Basically the only way to recover is to reboot the system, or unbind and rebind the net device driver.
To fix the bug, we need to fill the correct error teardown path which was missed during code movement, and call tcfblockoffloadunbind() when xainsert() fails.
[ last note, fundamentally I blame the label naming convention in tcfblockgetext() for the bug. The labels should be named after what they do, not after the error path that jumps to them. This way, it is obviously wrong that two labels pointing to the same code mean something is wrong, and checking the code correctness at the goto site is also easier ]
Other sources
In the Linux kernel, the following vulnerability has been resolved:
net/sched: schapi: fix xainsert() error path in tcfblockgetext()
This command:
$ tc qdisc replace dev eth0 ingressblock 1 egressblock 1 clsact Error: block dev insert failed: -EBUSY.
fails because user space requests the same block index to be set for both ingress and egress.
[ side note, I don't think it even failed prior to commit 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra"), because this is a command from an old set of notes of mine which used to work, but alas, I did not scientifically bisect this ]
The problem is not that it fails, but rather, that the second time around, it fails differently (and irrecoverably):
$ tc qdisc replace dev eth0 ingressblock 1 egressblock 1 clsact Error: dsacore: Flow block cb is busy.
[ another note: the extack is added by me for illustration purposes. the context of the problem is that clsactinit() obtains the same &q->ingressblock pointer as &q->egressblock, and since we call tcfblockgetext() on both of them, "dev" will be added to the block->ports xarray twice, thus failing the operation: once through the ingress block pointer, and once again through the egress block pointer. the problem itself is that when xainsert() fails, we have emitted a FLOWBLOCKBIND command through ndosetuptc(), but the offload never sees a corresponding FLOWBLOCKUNBIND. ]
Even correcting the bad user input, we still cannot recover:
$ tc qdisc replace dev swp3 ingressblock 1 egressblock 2 clsact Error: dsacore: Flow block cb is busy.
Basically the only way to recover is to reboot the system, or unbind and rebind the net device driver.
To fix the bug, we need to fill the correct error teardown path which was missed during code movement, and call tcfblockoffloadunbind() when xainsert() fails.
[ last note, fundamentally I blame the label naming convention in tcfblockgetext() for the bug. The labels should be named after what they do, not after the error path that jumps to them. This way, it is obviously wrong that two labels pointing to the same code mean something is wrong, and checking the code correctness at the goto site is also easier ]
— NVD
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-53044?
CVE-2024-53044 is a vulnerability in the Linux kernel with a severity rating that can impact network scheduling operations.
How do I fix CVE-2024-53044?
To resolve CVE-2024-53044, update your Linux kernel to the latest version past 6.11.7 or any of the 6.12 release candidates.
What versions of the Linux kernel are affected by CVE-2024-53044?
CVE-2024-53044 affects Linux kernel versions from 6.8 to 6.11.7 and the release candidates 6.12-rc1 through 6.12-rc5.
What does CVE-2024-53044 vulnerabilities do?
CVE-2024-53044 relates to an error handling issue in the packet scheduler that can prevent proper insertion of network blocks.
Is CVE-2024-53044 reversible or permanent?
The effects of CVE-2024-53044 are reversible by applying the necessary kernel updates, mitigating the issue immediately.