mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
net, ipv6: convert inet6_dev.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
0aeea21ada
commit
1be9246077
3 changed files with 7 additions and 6 deletions
|
|
@ -426,7 +426,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
|
|||
}
|
||||
|
||||
/* One reference from device. */
|
||||
in6_dev_hold(ndev);
|
||||
refcount_set(&ndev->refcnt, 1);
|
||||
|
||||
if (dev->flags & (IFF_NOARP | IFF_LOOPBACK))
|
||||
ndev->cnf.accept_dad = -1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue