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)
commitc1d1b437816f0afa99202be3cb650c9d174667bc
tree14ee9ec0f2e759bb237b2a010aa56989874cc054
parentdb5bce32fbe19f0c7482fb5a40a33178bbe7b11b
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