Linux: net: au1000: move free_irq out of the close-time spinlocked section
What fixes it
- 26fd652915123a690f19d62b253b545a53f3cd51LinuxCVE List
- 4536667fba8ddbaff2f2a135080ae6aabf737b5eLinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
net: au1000: move free_irq out of the close-time spinlocked section
au1000_close() calls free_irq() while aup->lock is still held with spin_lock_irqsave(). free_irq() can sleep because it takes the IRQ descriptor request mutex, so it does not belong inside the close-time spinlocked section.
This was found by our static analysis tool and then confirmed by manual review of the in-tree au1000_close() .ndo_stop path. The reviewed path keeps aup->lock held across the MAC reset, queue stop and free_irq(dev->irq, dev).
A directed runtime validation kept that ndo_stop carrier and the same free_irq(dev->irq, dev) operation under the driver lock. Lockdep reported "BUG: sleeping function called from invalid context" and "Invalid wait context" while free_irq() was taking desc->request_mutex, with au1000_close() and free_irq() on the stack.
Drop aup->lock before freeing the IRQ. The protected close-time work still stops the device and queue before IRQ teardown, but the sleepable IRQ core path now runs outside the spinlocked section.
Text from CVE List
Affected versions 16
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before f86bca5b7857b85bfa8afdb4fa895d7c0a3f7ebcCVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 26fd652915123a690f19d62b253b545a53f3cd51CVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before d514b08ed61fdffe23604fd3e9e53c07cbe5ac3eCVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before e1b5a13249975fec3cf654efa84f57118db2da2cCVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 4536667fba8ddbaff2f2a135080ae6aabf737b5eCVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before fc2233f1ab2a1ca562869bca6987d7477671388cCVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before f48763beab4eea41fc480c9702ec6eebe8d75e4fCVE List
- Linuxaffected: 2.6.12CVE List
- Linuxunaffected: all versions before 2.6.12CVE List
- Linuxunaffected: 5.10.271 through 5.10.*CVE List
- Linuxunaffected: 5.15.222 through 5.15.*CVE List
- Linuxunaffected: 6.1.189 through 6.1.*CVE List
- Linuxunaffected: 6.6.158 through 6.6.*CVE List
- Linuxunaffected: 6.12.111 through 6.12.*CVE List
- Linuxunaffected: 6.18.53 through 6.18.*CVE List
- Linuxunaffected: 7.2CVE List
References 7
- git.kernel.org/stable/c/f86bca5b7857b85bfa8afdb4fa895d7c0a3f7ebcReferencevia CVE List
- git.kernel.org/stable/c/26fd652915123a690f19d62b253b545a53f3cd51Referencevia CVE List
- git.kernel.org/stable/c/d514b08ed61fdffe23604fd3e9e53c07cbe5ac3eReferencevia CVE List
- git.kernel.org/stable/c/e1b5a13249975fec3cf654efa84f57118db2da2cReferencevia CVE List
- git.kernel.org/stable/c/4536667fba8ddbaff2f2a135080ae6aabf737b5eReferencevia CVE List
- git.kernel.org/stable/c/fc2233f1ab2a1ca562869bca6987d7477671388cReferencevia CVE List
- git.kernel.org/stable/c/f48763beab4eea41fc480c9702ec6eebe8d75e4fReferencevia CVE List