calipso: Fix null-ptr-deref in calipso_req_{set,del}attr().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e1adea927080821ebfa7505bff752a4015955660 · < 988edde4d52d5c02ea4dd95d7619372a5e2fb7b7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
calipso: Fix null-ptr-deref in calipso_req_{set,del}attr().
syzkaller reported a null-ptr-deref in sock_omalloc() while allocating a CALIPSO option. [0]
The NULL is of struct sock, which was fetched by sk_to_full_sk() in calipso_req_setattr().
Since commit a1a5344ddbe8 ("tcp: avoid two atomic ops for syncookies"), reqsk->rsk_listener could be NULL when SYN Cookie is returned to its client, as hinted by the leading SYN Cookie log.
Here are 3 options to fix the bug:
1) Return 0 in calipso_req_setattr() 2) Return an error in calipso_req_setattr() 3) Alaways set rsk_listener
1) is no go as it bypasses LSM, but 2) effectively disables SYN Cookie for CALIPSO. 3) is also no go as there have been many efforts to reduce atomic ops and make TCP robust against DDoS. See also commit 3b24d854cb35 ("tcp/dccp: do not touch listener sk_refcnt under synflood").
From the CVE record · Linux
A null-pointer dereference in the Linux kernel’s CALIPSO request-attribute handling can crash the kernel. It occurs when a TCP connection request uses a SYN cookie and the request’s listener pointer is NULL. The report describes a network connection trigger; it does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with CALIPSO should check their exposure; the issue was reproduced on kernel 6.14.0, but no affected version range is specified.