netfilter: nf_conntrack: defer invalid log until after unlock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d9a6f0d0df1899ff9086a57abc600e414f4b8cdd · < 2d19b95c9723001f214f7a47d67b09f46238f200| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_conntrack: defer invalid log until after unlock
TCP and SCTP conntrack paths can emit invalid-packet logs while ct->lock is still held.
When invalid logging is routed to nfnetlink_log and conntrack export is enabled, the log path can re-enter conntrack netlink glue and dump the same conntrack again. Protocol attribute dumping may take ct->lock, so logging while holding that lock can deadlock.
Defer the TCP invalid logs by storing only the minimal log context while ct->lock is held and emitting the log after unlocking. Also make the TCP timeout-lowering invalid path return whether a log is needed, then emit that log after unlocking.
Do the same for the SCTP invalid state-transition log that can be reached while ct->lock is held.
Add a lockdep assertion to nf_ct_l4proto_log_invalid() so future callers that log invalid conntracks while holding ct->lock are caught outside TCP and SCTP as well.
From the CVE record · Linux
Linux kernel TCP and SCTP conntrack paths can log invalid packets while holding a conntrack lock. If invalid logging uses nfnetlink_log and conntrack export is enabled, the log path can re-enter conntrack and deadlock. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with netfilter conntrack should check their deployments; affected versions are not specified.