From 5f9ccf6f38a1cfbaf6920b843c09d4e847a89e98 Mon Sep 17 00:00:00 2001 From: "Reshetova, Elena" Date: Tue, 4 Jul 2017 15:53:19 +0300 Subject: net, x25: convert x25_route.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 Signed-off-by: Hans Liljestrand Signed-off-by: Kees Cook Signed-off-by: David Windsor Signed-off-by: David S. Miller --- net/x25/x25_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/x25/x25_route.c') diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c index 277c8d2448d6..b85b889596e5 100644 --- a/net/x25/x25_route.c +++ b/net/x25/x25_route.c @@ -55,7 +55,7 @@ static int x25_add_route(struct x25_address *address, unsigned int sigdigits, rt->sigdigits = sigdigits; rt->dev = dev; - atomic_set(&rt->refcnt, 1); + refcount_set(&rt->refcnt, 1); list_add(&rt->node, &x25_route_list); rc = 0; -- cgit v1.2.3-70-g09d2