# CVE-2024-39296: bonding: fix oops during rmmod

- Severity: Medium 4.7 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 5% of CVEs (2026-12-01)
- Published: 2024-06-25T14:22:40.218Z
- Modified: 2026-06-17T07:41:39.843Z
- Weaknesses: CWE-362, CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

bonding: fix oops during rmmod

"rmmod bonding" causes an oops ever since commit cc317ea3d927 ("bonding:
remove redundant NULL check in debugfs function").  Here are the relevant
functions being called:

bonding_exit()
  bond_destroy_debugfs()
    debugfs_remove_recursive(bonding_debug_root);
    bonding_debug_root = NULL; <--------- SET TO NULL HERE
  bond_netlink_fini()
    rtnl_link_unregister()
      __rtnl_link_unregister()
        unregister_netdevice_many_notify()
          bond_uninit()
            bond_debug_unregister()
              (commit removed check for bonding_debug_root == NULL)
              debugfs_remove()
              simple_recursive_removal()
                down_write() -> OOPS

However, reverting the bad commit does not solve the problem completely
because the original code contains a race that could cause the same
oops, although it was much less likely to be triggered unintentionally:

CPU1
  rmmod bonding
    bonding_exit()
      bond_destroy_debugfs()
        debugfs_remove_recursive(bonding_debug_root);

CPU2
  echo -bond0 > /sys/class/net/bonding_masters
    bond_uninit()
      bond_debug_unregister()
        if (!bonding_debug_root)

CPU1
        bonding_debug_root = NULL;

So do NOT revert the bad commit (since the removed checks were racy
anyway), and instead change the order of actions taken during module
removal.  The same oops can also happen if there is an error during
module init, so apply the same fix there.

(As written by CVE List.)

## Affected

- Linux Linux: from cc317ea3d9272fab4f6fef527c865f30ca479394 before f07224c16678a8af54ddc059b3d2d51885d7f35e; from cc317ea3d9272fab4f6fef527c865f30ca479394 before cf48aee81103ca06d09d73d33fb72f1191069aa6; from cc317ea3d9272fab4f6fef527c865f30ca479394 before a45835a0bb6ef7d5ddbc0714dd760de979cb6ece; 6.6 (not affected: before 6.6; from 6.6.34 up to 6.6.*; from 6.9.5 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 6.6 before 6.6.34; from 6.7 before 6.9.5

## References

- <https://git.kernel.org/stable/c/f07224c16678a8af54ddc059b3d2d51885d7f35e> (patch)
- <https://git.kernel.org/stable/c/cf48aee81103ca06d09d73d33fb72f1191069aa6> (patch)
- <https://git.kernel.org/stable/c/a45835a0bb6ef7d5ddbc0714dd760de979cb6ece> (patch)

## Sources

- CVE List: [CVE-2024-39296](https://www.cve.org/CVERecord?id=CVE-2024-39296), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-39296](https://nvd.nist.gov/vuln/detail/CVE-2024-39296), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-39296 · Whole record: https://cve.day/CVE-2024-39296.json · Rebuilt by cve.day 2026-11-25T22:58:42.220Z
