From 50d61ff789d728a9b6624582ce28441dc0bf5b42 Mon Sep 17 00:00:00 2001 From: "Reshetova, Elena" Date: Tue, 4 Jul 2017 15:53:15 +0300 Subject: net, rds: convert rds_ib_device.refcount 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 Signed-off-by: Hans Liljestrand Signed-off-by: Kees Cook Signed-off-by: David Windsor Signed-off-by: David S. Miller --- net/rds/ib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/rds/ib.h') diff --git a/net/rds/ib.h b/net/rds/ib.h index ec550626e221..bf4822407567 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -230,7 +230,7 @@ struct rds_ib_device { unsigned int max_initiator_depth; unsigned int max_responder_resources; spinlock_t spinlock; /* protect the above */ - atomic_t refcount; + refcount_t refcount; struct work_struct free_work; int *vector_load; }; -- cgit v1.2.3