]> git.baikalelectronics.ru Git - kernel.git/commit
net: convert (struct ubuf_info)->refcnt to refcount_t
authorEric Dumazet <edumazet@google.com>
Thu, 31 Aug 2017 23:48:22 +0000 (16:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Sep 2017 03:22:03 +0000 (20:22 -0700)
commitbba3c0ca5cbbe5952d1193b7636c0e5d3bdef0a2
tree14ee9ec0f2e759bb237b2a010aa56989874cc054
parentdf39e4d3fd3083baaf5c239a5e2f512c7ea78e6e
net: convert (struct ubuf_info)->refcnt 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.

v2: added the change in drivers/vhost/net.c as spotted
by Willem.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/net.c
include/linux/skbuff.h
net/core/skbuff.c