sctp: sysctl: auth_enable: avoid using current->nsproxy
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b14878ccb7fac0242db82720b784ab62c467c0dc · < c184bc621e3cef03ac9ba81a50dda2dae6a21d36| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
sctp: sysctl: auth_enable: avoid using current->nsproxy
As mentioned in a previous commit of this series, using the 'net' structure via 'current' is not recommended for different reasons:
- Inconsistency: getting info from the reader's/writer's netns vs only from the opener's netns.
- current->nsproxy can be NULL in some cases, resulting in an 'Oops' (null-ptr-deref), e.g. when the current task is exiting, as spotted by syzbot [1] using acct(2).
The 'net' structure can be obtained from the table->data using container_of().
Note that table->data could also be used directly, but that would increase the size of this fix, while 'sctp.ctl_sock' still needs to be retrieved from 'net' structure.
From the CVE record · Linux
The Linux kernel’s SCTP auth_enable sysctl can dereference a null pointer when it accesses current->nsproxy while the current task is exiting. This can cause a kernel Oops; the input does not establish whether an attacker can trigger it or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the SCTP auth_enable sysctl should check their kernel vendor’s advisory for affected versions.