CVE-2024-56674

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-56674
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-56674.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-56674
Related
Published
2024-12-27T15:15:27Z
Modified
2025-01-08T09:56:10.760533Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

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

virtionet: correct netdevtxresetqueue() invocation point

When virtnetclose is followed by virtnetopen, some TX completions can possibly remain unconsumed, until they are finally processed during the first NAPI poll after the netdevtxresetqueue(), resulting in a crash [1]. Commit b96ed2c97c79 ("virtionet: move netdevtxreset_queue() call before RX napi enable") was not sufficient to eliminate all BQL crash cases for virtio-net.

This issue can be reproduced with the latest net-next master by running: while :; do ip l set DEV down; ip l set DEV up; done under heavy network TX load from inside the machine.

netdevtxresetqueue() can actually be dropped from virtnetopen path; the device is not stopped in any case. For BQL core part, it's just like traffic nearly ceases to exist for some period. For stall detector added to BQL, even if virtnetclose could somehow lead to some TX completions delayed for long, followed by virtnetopen, we can just take it as stall as mentioned in commit 6025b9135f7a ("net: dqs: add NIC stall detector based on BQL"). Note also that users can still reset stall_max via sysfs.

So, drop netdevtxresetqueue() from virtnetenablequeuepair(). This eliminates the BQL crashes. As a result, netdevtxresetqueue() is now explicitly required in freeze/restore path. This patch adds it to immediately after freeunusedbufs(), following the rule of thumb: netdevtxresetqueue() should follow any SKB freeing not followed by netdevtxcompletedqueue(). This seems the most consistent and streamlined approach, and now netdevtxresetqueue() runs whenever freeunusedbufs() is done.

kernel BUG at lib/dynamicqueuelimits.c:99! Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 7 UID: 0 PID: 1598 Comm: ip Tainted: G N 6.12.0net-nextmain+ #2 Tainted: [N]=TEST Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), \ BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 RIP: 0010:dqlcompleted+0x26b/0x290 Code: b7 c2 49 89 e9 44 89 da 89 c6 4c 89 d7 e8 ed 17 47 00 58 65 ff 0d 4d 27 90 7e 0f 85 fd fe ff ff e8 ea 53 8d ff e9 f3 fe ff ff <0f> 0b 01 d2 44 89 d1 29 d1 ba 00 00 00 00 0f 48 ca e9 28 ff ff ff RSP: 0018:ffffc900002b0d08 EFLAGS: 00010297 RAX: 0000000000000000 RBX: ffff888102398c80 RCX: 0000000080190009 RDX: 0000000000000000 RSI: 000000000000006a RDI: 0000000000000000 RBP: ffff888102398c00 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000ca R11: 0000000000015681 R12: 0000000000000001 R13: ffffc900002b0d68 R14: ffff88811115e000 R15: ffff8881107aca40 FS: 00007f41ded69500(0000) GS:ffff888667dc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556ccc2dc1a0 CR3: 0000000104fd8003 CR4: 0000000000772ef0 PKRU: 55555554 Call Trace: <IRQ> ? die+0x32/0x80 ? dotrap+0xd9/0x100 ? dqlcompleted+0x26b/0x290 ? dqlcompleted+0x26b/0x290 ? doerrortrap+0x6d/0xb0 ? dqlcompleted+0x26b/0x290 ? excinvalidop+0x4c/0x60 ? dqlcompleted+0x26b/0x290 ? asmexcinvalidop+0x16/0x20 ? dqlcompleted+0x26b/0x290 _freeoldxmit+0xff/0x170 [virtionet] freeoldxmit+0x54/0xc0 [virtionet] virtnetpoll+0xf4/0xe30 [virtionet] ? _updateloadavgcfsrq+0x264/0x2d0 ? updatecurr+0x35/0x260 ? reweightentity+0x1be/0x260 _napipoll.constprop.0+0x28/0x1c0 netrxaction+0x329/0x420 ? enqueuehrtimer+0x35/0x90 ? tracehardirqson+0x1d/0x80 ? kvmschedclockread+0xd/0x20 ? schedclock+0xc/0x30 ? kvmschedclockread+0xd/0x20 ? schedclock+0xc/0x30 ? schedclockcpu+0xd/0x1a0 handlesoftirqs+0x138/0x3e0 dosoftirq.part.0+0x89/0xc0 </IRQ> <TASK> _localbhenableip+0xa7/0xb0 virtnetopen+0xc8/0x310 [virtionet] _devopen+0xfa/0x1b0 _devchangeflags+0x1de/0x250 devchangeflags+0x22/0x60 dosetlink.isra.0+0x2df/0x10b0 ? rtnetlinkrcvmsg+0x34f/0x3f0 ? netlinkrcvskb+0x54/0x100 ? netlink_unicas ---truncated---

References

Affected packages

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.12.6-1

Affected versions

6.*

6.1.27-1
6.1.37-1
6.1.38-1
6.1.38-2~bpo11+1
6.1.38-2
6.1.38-3
6.1.38-4~bpo11+1
6.1.38-4
6.1.52-1
6.1.55-1~bpo11+1
6.1.55-1
6.1.64-1
6.1.66-1
6.1.67-1
6.1.69-1~bpo11+1
6.1.69-1
6.1.76-1~bpo11+1
6.1.76-1
6.1.82-1
6.1.85-1
6.1.90-1~bpo11+1
6.1.90-1
6.1.94-1~bpo11+1
6.1.94-1
6.1.98-1
6.1.99-1
6.1.106-1
6.1.106-2
6.1.106-3
6.1.112-1
6.1.115-1
6.1.119-1
6.1.123-1
6.3.1-1~exp1
6.3.2-1~exp1
6.3.4-1~exp1
6.3.5-1~exp1
6.3.7-1~bpo12+1
6.3.7-1
6.3.11-1
6.4~rc6-1~exp1
6.4~rc7-1~exp1
6.4.1-1~exp1
6.4.4-1~bpo12+1
6.4.4-1
6.4.4-2
6.4.4-3~bpo12+1
6.4.4-3
6.4.11-1
6.4.13-1
6.5~rc4-1~exp1
6.5~rc6-1~exp1
6.5~rc7-1~exp1
6.5.1-1~exp1
6.5.3-1~bpo12+1
6.5.3-1
6.5.6-1
6.5.8-1
6.5.10-1~bpo12+1
6.5.10-1
6.5.13-1
6.6.3-1~exp1
6.6.4-1~exp1
6.6.7-1~exp1
6.6.8-1
6.6.9-1
6.6.11-1
6.6.13-1~bpo12+1
6.6.13-1
6.6.15-1
6.6.15-2
6.7-1~exp1
6.7.1-1~exp1
6.7.4-1~exp1
6.7.7-1
6.7.9-1
6.7.9-2
6.7.12-1~bpo12+1
6.7.12-1
6.8.9-1
6.8.11-1
6.8.12-1~bpo12+1
6.8.12-1
6.9.2-1~exp1
6.9.7-1~bpo12+1
6.9.7-1
6.9.8-1
6.9.9-1
6.9.10-1~bpo12+1
6.9.10-1
6.9.11-1
6.9.12-1
6.10-1~exp1
6.10.1-1~exp1
6.10.3-1
6.10.4-1
6.10.6-1~bpo12+1
6.10.6-1
6.10.7-1
6.10.9-1
6.10.11-1~bpo12+1
6.10.11-1
6.10.12-1
6.11~rc4-1~exp1
6.11~rc5-1~exp1
6.11-1~exp1
6.11.2-1
6.11.4-1
6.11.5-1~bpo12+1
6.11.5-1
6.11.6-1
6.11.7-1
6.11.9-1
6.11.10-1~bpo12+1
6.11.10-1
6.12~rc6-1~exp1
6.12.3-1
6.12.5-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}