net/tcp: Fix a NULL pointer dereference when using TCP-AO with TCP_REPAIR
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.12.496.16.96.17In the Linux kernel, the following vulnerability has been resolved:
net/tcp: Fix a NULL pointer dereference when using TCP-AO with TCP_REPAIR
A NULL pointer dereference can occur in tcp_ao_finish_connect() during a connect() system call on a socket with a TCP-AO key added and TCP_REPAIR enabled.
The function is called with skb being NULL and attempts to dereference it on tcp_hdr(skb)->seq without a prior skb validation.
Fix this by checking if skb is NULL before dereferencing it.
The commentary is taken from bpf_skops_established(), which is also called in the same flow. Unlike the function being patched, bpf_skops_established() validates the skb before dereferencing it.
int main(void){ struct sockaddr_in sockaddr; struct tcp_ao_add tcp_ao; int sk; int one = 1;
memset(&sockaddr,'\0',sizeof(sockaddr)); memset(&tcp_ao,'\0',sizeof(tcp_ao));
From the CVE record · Linux
The Linux kernel can dereference a NULL pointer in tcp_ao_finish_connect() during connect() on a socket with a TCP-AO key and TCP_REPAIR enabled. A local process that sets up such a socket can trigger a kernel oops; the input does not specify an authentication requirement.
Engineers running Linux kernels that support TCP-AO and TCP_REPAIR should check whether their kernel includes the fix; affected versions are not specified.