octeontx2-af: fix cn20k mailbox lifetime on repeated rvu_mbox_init()
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 6.18.57, 7.2.6
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
In the Linux kernel, the following vulnerability has been resolved: octeontx2-af: fix cn20k mailbox lifetime on repeated rvu_mbox_init() rvu_mbox_init() is called separately for AF-PF mailboxes during probe and for AF-VF mailboxes when SR-IOV is enabled. Each call used to allocate a new ng_rvu object, leaking the first allocation when the pointer was overwritten on the second call. Sharing one ng_rvu across both paths exposed several teardown bugs: the error path freed all cn20k mailbox DMA and kfree()d ng_rvu even when only the failing init type should be unwound, leaving live AF-PF mailbox memory in use after an AF-VF init failure. mutex_init() was also re-run on the AF-VF path while AF-PF mailbox handlers could still hold rvu->mbox_lock. Probe and SR-IOV failure paths did not release cn20k mailbox DMA either, since cleanup only happened in rvu_remove(). Allocate ng_rvu once with devm_kzalloc(), initialize mbox_lock in the same block, unwind only the mailbox memory for the failing init type, and free cn20k mailbox DMA from the probe and pci_enable_sriov() error paths.
Timeline
- CVE published
- Record last updated
Affected versions
- Linux Linux
From e53ee4acb220acab6832669334279367b0206af6 · fixed in c08314f91782983d67af0807ed1360e404ac4a8b; From e53ee4acb220acab6832669334279367b0206af6 · fixed in a0fcbea79f034f49bdd44915f28938922023458d; From e53ee4acb220acab6832669334279367b0206af6 · fixed in 3b11a77f69980932c3924054d66e565c9a135747
- Linux Linux
6.17
- KernelLinux
From 6.17.0 · fixed in 6.18.57; From 6.19.0 · fixed in 7.2.6