selinux: avoid sk_socket dereference in selinux_sctp_bind_connect()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d452930fd3b9031e59abfeddb2fa383f1403d61a · < d61a80b17254be7230bc5544f8e62ddf21ab38e2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
selinux: avoid sk_socket dereference in selinux_sctp_bind_connect()
selinux_sctp_bind_connect() dereferences sk->sk_socket to pass a struct socket * to selinux_socket_bind() and selinux_socket_connect_helper(). However, when the hook is invoked from the ASCONF softirq path (sctp_process_asconf), there is no file reference guaranteeing that sk->sk_socket is non-NULL. The setsockopt callers (bindx, connectx, set_primary, sendmsg connect) hold a file reference and are not affected.
Both selinux_socket_bind() and selinux_socket_connect_helper() immediately resolve sock->sk, never using the struct socket * for anything else. Refactor the inner logic into helpers that take a struct sock * directly so that selinux_sctp_bind_connect() never needs to touch sk->sk_socket at all.
From the CVE record · Linux
The Linux kernel's SELinux SCTP bind/connect hook can dereference a NULL socket pointer when invoked from the ASCONF softirq path. This can disrupt the kernel; the input does not specify whether an attacker needs authentication or user interaction. Setsockopt callers that hold a file reference are not affected.
Engineers running Linux kernels with SELinux and SCTP support should check their vendor advisories; affected versions are not specified.