ipv4: convert dst_metrics.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: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
633cefe390
commit
9620fef27e
@ -14,6 +14,7 @@
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/refcount.h>
|
||||
#include <net/neighbour.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
@ -107,7 +108,7 @@ struct dst_entry {
|
||||
|
||||
struct dst_metrics {
|
||||
u32 metrics[RTAX_MAX];
|
||||
atomic_t refcnt;
|
||||
refcount_t refcnt;
|
||||
};
|
||||
extern const struct dst_metrics dst_default_metrics;
|
||||
|
||||
|
Reference in New Issue
Block a user