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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Mar 2022 09:35:56 -0700
From:   David Ahern <dsahern@...il.com>
To:     Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc:     netdev@...r.kernel.org, edumazet@...gle.com
Subject: Re: [PATCH net-next] skb: make drop reason booleanable

On 3/7/22 5:44 PM, Jakub Kicinski wrote:
> We have a number of cases where function returns drop/no drop
> decision as a boolean. Now that we want to report the reason
> code as well we have to pass extra output arguments.
> 
> We can make the reason code evaluate correctly as bool.
> 
> I believe we're good to reorder the reasons as they are
> reported to user space as strings.
> 
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> v2: use Eric's suggestion for the name, indeed better than mine
> ---
>  include/linux/skbuff.h |  1 +
>  include/net/tcp.h      | 21 +++++++++++----------
>  net/ipv4/tcp.c         | 21 +++++++++------------
>  net/ipv4/tcp_ipv4.c    | 12 +++++++-----
>  net/ipv6/tcp_ipv6.c    | 11 +++++++----
>  5 files changed, 35 insertions(+), 31 deletions(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 34f572271c0c..26538ceb4b01 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -314,6 +314,7 @@ struct sk_buff;
>   * used to translate the reason to string.
>   */
>  enum skb_drop_reason {
> +	SKB_NOT_DROPPED_YET = 0,
>  	SKB_DROP_REASON_NOT_SPECIFIED,	/* drop reason is not specified */
>  	SKB_DROP_REASON_NO_SOCKET,	/* socket not found */
>  	SKB_DROP_REASON_PKT_TOO_SMALL,	/* packet size is too small */

This change looks ok to me, so:
Reviewed-by: David Ahern <dsahern@...nel.org>

I am a little nervous that some of the earlier code with jumps does not
properly do 'if (reason != SKB_DROP_REASON_NOT_SPECIFIED) reason = ...'
but rather 'if (!reason) reason = ...'

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ