netfilter: ctnetlink: ensure safe access to master conntrack
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c1d10adb4a521de5760112853f42aaeefcec96eb · < bffcaad9afdfe45d7fc777397d3b83c1e3ebffe5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: ctnetlink: ensure safe access to master conntrack
Holding reference on the expectation is not sufficient, the master conntrack object can just go away, making exp->master invalid.
To access exp->master safely:
- Grab the nf_conntrack_expect_lock, this gets serialized with clean_from_lists() which also holds this lock when the master conntrack goes away.
- Hold reference on master conntrack via nf_conntrack_find_get(). Not so easy since the master tuple to look up for the master conntrack is not available in the existing problematic paths.
This patch goes for extending the nf_conntrack_expect_lock section to address this issue for simplicity, in the cases that are described below this is just slightly extending the lock section.
The add expectation command already holds a reference to the master conntrack from ctnetlink_create_expect().
From the CVE record · Linux
A race in Linux kernel netfilter ctnetlink can leave an expectation pointing to a master conntrack object that has gone away. Accessing that pointer can be unsafe; the input does not specify an attacker outcome, access requirements, or whether user interaction is needed.
Engineers running the Linux kernel should check their installations; affected versions are not specified.