lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2969b15c-b825-3b0e-2ad7-00633ee6815b@kernel.org>
Date:   Mon, 21 Feb 2022 20:17:01 -0700
From:   David Ahern <dsahern@...nel.org>
To:     menglong8.dong@...il.com, kuba@...nel.org
Cc:     rostedt@...dmis.org, mingo@...hat.com, davem@...emloft.net,
        yoshfuji@...ux-ipv6.org, imagedong@...cent.com,
        edumazet@...gle.com, alobakin@...me, cong.wang@...edance.com,
        paulb@...dia.com, talalahmad@...gle.com, keescook@...omium.org,
        ilias.apalodimas@...aro.org, memxor@...il.com,
        flyingpeng@...cent.com, mengensun@...cent.com,
        daniel@...earbox.net, yajun.deng@...ux.dev, roopa@...dia.com,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/3] net: neigh: use kfree_skb_reason() for
 __neigh_event_send()

On 2/20/22 8:57 AM, menglong8.dong@...il.com wrote:
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index c310a4a8fc86..206b66f5ce6b 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -393,6 +393,15 @@ enum skb_drop_reason {
>  					 * see the doc for disable_ipv6
>  					 * in ip-sysctl.rst for detail
>  					 */
> +	SKB_DROP_REASON_NEIGH_FAILED,	/* dropped as the state of
> +					 * neighbour is NUD_FAILED
> +					 */

/* neigh entry in failed state */

> +	SKB_DROP_REASON_NEIGH_QUEUEFULL,	/* the skbs that waiting
> +						 * for sending on the queue
> +						 * of neigh->arp_queue is
> +						 * full, and the skbs on the
> +						 * tail will be dropped
> +						 */

/* arp_queue for neigh entry is full */


> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index ec0bf737b076..c353834e8fa9 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1171,7 +1171,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb,
>  			neigh->updated = jiffies;
>  			write_unlock_bh(&neigh->lock);
>  
> -			kfree_skb(skb);
> +			kfree_skb_reason(skb, SKB_DROP_REASON_NEIGH_FAILED);
>  			return 1;
>  		}
>  	} else if (neigh->nud_state & NUD_STALE) {
> @@ -1193,7 +1193,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb,
>  				if (!buff)
>  					break;
>  				neigh->arp_queue_len_bytes -= buff->truesize;
> -				kfree_skb(buff);
> +				kfree_skb_reason(buff, SKB_DROP_REASON_NEIGH_QUEUEFULL);
>  				NEIGH_CACHE_STAT_INC(neigh->tbl, unres_discards);
>  			}
>  			skb_dst_force(skb);

what about out_dead: path? the tracepoint there shows that path is of
interest.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ