net: preserve skb_end_offset() in skb_unclone_keeptruesize()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
7118945cdf0d4b5a76eb4f5f330ac6f48d372025| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: preserve skb_end_offset() in skb_unclone_keeptruesize()
syzbot found another way to trigger the infamous WARN_ON_ONCE(delta < len) in skb_try_coalesce() [1]
I was able to root cause the issue to kfence.
When kfence is in action, the following assertion is no longer true:
int size = xxxx; void *ptr1 = kmalloc(size, gfp); void *ptr2 = kmalloc(size, gfp);
if (ptr1 && ptr2) ASSERT(ksize(ptr1) == ksize(ptr2));
We attempted to fix these issues in the blamed commits, but forgot that TCP was possibly shifting data after skb_unclone_keeptruesize() has been used, notably from tcp_retrans_try_collapse().
From the CVE record · Linux
A Linux kernel networking issue can trigger a warning in skb_try_coalesce() when KFENCE is active and TCP processes a buffer after skb_unclone_keeptruesize(). The supplied report shows a syzbot-triggered warning but does not establish whether a remote attacker can trigger it or whether authentication or user interaction is required.
Engineers running Linux kernels should check their builds; affected and fixed versions are not specified.