ppp: fix memory leak in pad_compress_skb
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b3f9b92a6ec1a9a5e4b4b36e484f2f62cc73277c · < 631fc8ab5beb9e0ec8651fb9875b9a968e7b4ae4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ppp: fix memory leak in pad_compress_skb
If alloc_skb() fails in pad_compress_skb(), it returns NULL without releasing the old skb. The caller does:
skb = pad_compress_skb(ppp, skb); if (!skb) goto drop;
drop: kfree_skb(skb);
When pad_compress_skb() returns NULL, the reference to the old skb is lost and kfree_skb(skb) ends up doing nothing, leading to a memory leak.
Align pad_compress_skb() semantics with realloc(): only free the old skb if allocation and compression succeed. At the call site, use the new_skb variable so the original skb is not lost when pad_compress_skb() fails.
From the CVE record · Linux
The Linux kernel's PPP compression path leaks memory if allocation fails in pad_compress_skb(). On failure, the caller loses its reference to the original packet buffer and cannot free it. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running the Linux kernel should check their kernel version; affected versions are not specified in the input.