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]
Message-ID: <CAJwJo6Z5+W2hDMOwPTnRWqLoGLqfwezZd_mOCmbMEnbvK-VBDg@mail.gmail.com>
Date: Thu, 18 Sep 2025 18:56:44 +0100
From: Dmitry Safonov <0x7f454c46@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Neal Cardwell <ncardwell@...gle.com>, Willem de Bruijn <willemb@...gle.com>, 
	Kuniyuki Iwashima <kuniyu@...gle.com>, netdev@...r.kernel.org, eric.dumazet@...il.com, 
	Daniel Zahka <daniel.zahka@...il.com>
Subject: Re: [PATCH net-next] tcp: prefer sk_skb_reason_drop()

On Thu, 18 Sept 2025 at 14:20, Eric Dumazet <edumazet@...gle.com> wrote:
>
> Replace two calls to kfree_skb_reason() with sk_skb_reason_drop().
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Daniel Zahka <daniel.zahka@...il.com>
> Cc: Dmitry Safonov <0x7f454c46@...il.com>

LGTM, thanks!

Reviewed-by: Dmitry Safonov <0x7f454c46@...il.com>

Side-note: I see that tcp_ao_transmit_skb() can currently fail only
due to ENOMEM, IIRC I haven't found more specific reason at that time
than just SKB_DROP_REASON_NOT_SPECIFIED, unsure if worth changing
that.

> ---
>  net/ipv4/tcp_output.c | 2 +-
>  net/psp/psp_sock.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 223d7feeb19d4671fcbc9f21caf588c661b4bbe0..bb3576ac0ad7d7330ef272e1d9dc1f19bb8f86bb 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1586,7 +1586,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
>                 err = tcp_ao_transmit_skb(sk, skb, key.ao_key, th,
>                                           opts.hash_location);
>                 if (err) {
> -                       kfree_skb_reason(skb, SKB_DROP_REASON_NOT_SPECIFIED);
> +                       sk_skb_reason_drop(sk, skb, SKB_DROP_REASON_NOT_SPECIFIED);
>                         return -ENOMEM;
>                 }
>         }
> diff --git a/net/psp/psp_sock.c b/net/psp/psp_sock.c
> index d19e37e939672c1f8fc0ebb62e50a3fb32cc8d25..5324a7603bed64d3f1f71b66dd44f622048519a6 100644
> --- a/net/psp/psp_sock.c
> +++ b/net/psp/psp_sock.c
> @@ -37,7 +37,7 @@ psp_validate_xmit(struct sock *sk, struct net_device *dev, struct sk_buff *skb)
>         good = !pas || rcu_access_pointer(dev->psp_dev) == pas->psd;
>         rcu_read_unlock();
>         if (!good) {
> -               kfree_skb_reason(skb, SKB_DROP_REASON_PSP_OUTPUT);
> +               sk_skb_reason_drop(sk, skb, SKB_DROP_REASON_PSP_OUTPUT);
>                 return NULL;
>         }
>
> --
> 2.51.0.384.g4c02a37b29-goog
>


--
             Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ