summaryrefslogtreecommitdiff
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorReshetova, Elena <elena.reshetova@intel.com>2017-07-04 15:53:07 +0300
committerDavid S. Miller <davem@davemloft.net>2017-07-04 22:35:16 +0100
commit7b9364050246bd4c24b36b71c8990b2922dcc027 (patch)
treea63212cfd2110187b7f3a58ac14c486d0c502f4e /include/net/sch_generic.h
parentedcd9270be1ba9c80cd0789ffbae7a7d204b7b05 (diff)
downloadlwn-7b9364050246bd4c24b36b71c8990b2922dcc027.tar.gz
lwn-7b9364050246bd4c24b36b71c8990b2922dcc027.zip
net, sched: convert Qdisc.refcnt 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 <elena.reshetova@intel.com> Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David Windsor <dwindsor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 368850194c94..1c123e2b2415 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -9,6 +9,7 @@
#include <linux/percpu.h>
#include <linux/dynamic_queue_limits.h>
#include <linux/list.h>
+#include <linux/refcount.h>
#include <net/gen_stats.h>
#include <net/rtnetlink.h>
@@ -95,7 +96,7 @@ struct Qdisc {
struct sk_buff *skb_bad_txq;
struct rcu_head rcu_head;
int padded;
- atomic_t refcnt;
+ refcount_t refcnt;
spinlock_t busylock ____cacheline_aligned_in_smp;
};