mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
net, ipx: convert ipx_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 <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
d25189ca86
commit
16f73c9649
2 changed files with 4 additions and 4 deletions
|
|
@ -59,7 +59,7 @@ int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
|
|||
if (!rt)
|
||||
goto out;
|
||||
|
||||
atomic_set(&rt->refcnt, 1);
|
||||
refcount_set(&rt->refcnt, 1);
|
||||
ipxrtr_hold(rt);
|
||||
write_lock_bh(&ipx_routes_lock);
|
||||
list_add(&rt->node, &ipx_routes);
|
||||
|
|
|
|||
Loading…
Reference in a new issue