netlabel: Fix NULL pointer exception caused by CALIPSO on IPv4 sockets
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ceba1832b1b2da0149c51de62a847c00bca1677a · < 3ba9cf69de50e8abed32b448616c313baa4c5712| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netlabel: Fix NULL pointer exception caused by CALIPSO on IPv4 sockets
When calling netlbl_conn_setattr(), addr->sa_family is used to determine the function behavior. If sk is an IPv4 socket, but the connect function is called with an IPv6 address, the function calipso_sock_setattr() is triggered. Inside this function, the following code is executed:
sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL;
Since sk is an IPv4 socket, pinet6 is NULL, leading to a null pointer dereference.
This patch fixes the issue by checking if inet6_sk(sk) returns a NULL pointer before accessing pinet6.
From the CVE record · Linux
The Linux kernel's netlabel CALIPSO handling can dereference a NULL pointer when an IPv4 socket's connect function is called with an IPv6 address. A caller can trigger the exception under that condition; the input does not establish whether it is remotely exploitable or requires authentication or user interaction.
Engineers running Linux kernels should check whether their builds include the netlabel CALIPSO fix; affected versions are not specified.