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: <Zrk9+7a0doax82Kd@pop-os.localdomain>
Date: Sun, 11 Aug 2024 15:40:59 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: James Chapman <jchapman@...alix.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, dsahern@...nel.org,
	tparkin@...alix.com
Subject: Re: [PATCH net-next 03/15] l2tp: have l2tp_ip_destroy_sock use
 ip_flush_pending_frames

On Mon, Jul 29, 2024 at 04:38:02PM +0100, James Chapman wrote:
> Use the recently exported ip_flush_pending_frames instead of a
> free-coded version and lock the socket while we call it.

Hmm? Isn't skb_queue_purge() closer to the original code?

This is clearly not a trivial cleanup, so what are you trying to fix?

> 
> Signed-off-by: James Chapman <jchapman@...alix.com>
> Signed-off-by: Tom Parkin <tparkin@...alix.com>
> ---
>  net/l2tp/l2tp_ip.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
> index 78243f993cda..f21dcbf3efd5 100644
> --- a/net/l2tp/l2tp_ip.c
> +++ b/net/l2tp/l2tp_ip.c
> @@ -236,10 +236,10 @@ static void l2tp_ip_close(struct sock *sk, long timeout)
>  static void l2tp_ip_destroy_sock(struct sock *sk)
>  {
>  	struct l2tp_tunnel *tunnel;
> -	struct sk_buff *skb;
>  
> -	while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL)
> -		kfree_skb(skb);
> +	lock_sock(sk);


Are you sure you really want this sock lock?

> +	ip_flush_pending_frames(sk);

So who sets inet_sk(sk)->cork.base for l2tp socket?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ