In the Linux kernel, the following vulnerability has been resolved: atm: Revert atmaccounttx() if copyfromiterfull() fails. In vccsendmsg(), we account skb->truesize to sk->skwmemalloc by atmaccounttx(). It is expected to be reverted by atmpopraw() later called by vcc->dev->ops->send(vcc, skb). However, vccsendmsg() misses the same revert when copyfromiterfull() fails, and then we will leak a socket. Let's factorise the revert part as atmreturntx() and call it in the failure path. Note that the corresponding skwmemalloc operation can be found in alloctx() as of the blamed commit. $ git blame -L:alloctx net/atm/common.c c55fa3cccbc2c~