tun: free page on build_skb failure in tun_xdp_one()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 043d222f93ab8c76b56a3b315cd8692e35affb6c · < aa308e9dbb9acb17cacdbbce9e4504f69bac8385| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tun: free page on build_skb failure in tun_xdp_one()
When build_skb() fails in tun_xdp_one(), the function sets ret to -ENOMEM and jumps to the out label, which returns without freeing the page that vhost_net_build_xdp() allocated for the frame. As with the short-frame rejection path, tun_sendmsg() discards the per-buffer error and still returns total_len, so vhost_tx_batch() takes the success path and never frees the page. Each build_skb() failure in a batch leaks one page-frag chunk.
Free the page before taking the error path, matching the put_page() the other error exits of tun_xdp_one() already perform.
From the CVE record · Linux
The Linux kernel's tun_xdp_one() fails to free an allocated page when build_skb() fails. Each such failure in a batch leaks one page-frag chunk; the input does not specify how an attacker could trigger the failure or whether authentication, local access, or user interaction is required.
Teams running Linux kernels with the affected tun XDP code should check their kernel versions; affected versions are not specified.