mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
net: convert sk_buff.users from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations. Signed-off-by: Elena Reshetova <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
53869cebce
commit
633547973f
21 changed files with 67 additions and 67 deletions
|
|
@ -155,7 +155,7 @@ mISDN_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
|||
copied = skb->len + MISDN_HEADER_LEN;
|
||||
if (len < copied) {
|
||||
if (flags & MSG_PEEK)
|
||||
atomic_dec(&skb->users);
|
||||
refcount_dec(&skb->users);
|
||||
else
|
||||
skb_queue_head(&sk->sk_receive_queue, skb);
|
||||
return -ENOSPC;
|
||||
|
|
|
|||
Loading…
Reference in a new issue