On Wed, Aug 16, 2017 at 4:19 PM, Eric Dumazet <eric.duma...@gmail.com> wrote:
> From: Eric Dumazet <eduma...@google.com>
>
> 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 <eduma...@google.com>
> ---
> v2: fix a missing change in net/ipv4/fib_semantics.c
>
>  include/net/dst.h        |    2 +-
>  net/core/dst.c           |    6 +++---
>  net/ipv4/fib_semantics.c |    4 ++--
>  net/ipv4/route.c         |    4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/include/net/dst.h b/include/net/dst.h
> index 
> f73611ec401754d4f52b5310a24da53566dafce6..dd38177c3a61f5c4e48be9d57d4d10d6b7d14672
>  100644
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -107,7 +107,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;


#include linux/refcount.h explicitly?

Reply via email to