atm: Revert atm_account_tx() if copy_from_iter_full() fails.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 3d828519bd69bfcaabdd942a872679617ef06739| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
atm: Revert atm_account_tx() if copy_from_iter_full() fails.
In vcc_sendmsg(), we account skb->truesize to sk->sk_wmem_alloc by atm_account_tx().
It is expected to be reverted by atm_pop_raw() later called by vcc->dev->ops->send(vcc, skb).
However, vcc_sendmsg() misses the same revert when copy_from_iter_full() fails, and then we will leak a socket.
Let's factorise the revert part as atm_return_tx() and call it in the failure path.
Note that the corresponding sk_wmem_alloc operation can be found in alloc_tx() as of the blamed commit.
$ git blame -L:alloc_tx net/atm/common.c c55fa3cccbc2c~
From the CVE record · Linux
The Linux kernel's ATM send path fails to reverse transmit-memory accounting when copy_from_iter_full() fails in vcc_sendmsg(), leaking a socket. The input does not establish whether an attacker can trigger the failure, or specify access or authentication requirements.
Engineers running Linux kernels with the affected ATM code should check their versions; affected versions are not specified.