All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Chapman <jchapman@katalix.com>
To: Willy Tarreau <w@1wt.eu>
Cc: stable@kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: Missing patch from stable [6/7]
Date: Sun, 08 Jun 2008 10:33:27 +0100	[thread overview]
Message-ID: <484BA767.4010008@katalix.com> (raw)
In-Reply-To: <20080608090227.GF6439@1wt.eu>

Willy Tarreau wrote:
> Hi,
> 
> this patch from mainline seems suitable for -stable, but was not proposed
> for inclusion. I think we should include it for next review unless the
> author disagrees.

OK by me.

> 
> Thanks,
> Willy
> --
> 
>>From 199f7d24ae59894243687a234a909f44a8724506 Mon Sep 17 00:00:00 2001
> From: James Chapman <jchapman@katalix.com>
> Date: Wed, 4 Jun 2008 15:07:32 -0700
> Subject: lt2p: Fix possible WARN_ON from socket code when UDP socket is closed
> 
> If an L2TP daemon closes a tunnel socket while packets are queued in
> the tunnel's reorder queue, a kernel warning is logged because the
> socket is closed while skbs are still referencing it. The fix is to
> purge the queue in the socket's release handler.
> 
> WARNING: at include/net/sock.h:351 udp_lib_unhash+0x41/0x68()
> Pid: 12998, comm: openl2tpd Not tainted 2.6.25 #8
>  [<c0423c58>] warn_on_slowpath+0x41/0x51
>  [<c05d33a7>] udp_lib_unhash+0x41/0x68
>  [<c059424d>] sk_common_release+0x23/0x90
>  [<c05d16be>] udp_lib_close+0x8/0xa
>  [<c05d8684>] inet_release+0x42/0x48
>  [<c0592599>] sock_release+0x14/0x60
>  [<c059299f>] sock_close+0x29/0x30
>  [<c046ef52>] __fput+0xad/0x15b
>  [<c046f1d9>] fput+0x17/0x19
>  [<c046c8c4>] filp_close+0x50/0x5a
>  [<c046da06>] sys_close+0x69/0x9f
>  [<c04048ce>] syscall_call+0x7/0xb
> 
> Signed-off-by: James Chapman <jchapman@katalix.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  drivers/net/pppol2tp.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
> index 8db342f..04c7e5b 100644
> --- a/drivers/net/pppol2tp.c
> +++ b/drivers/net/pppol2tp.c
> @@ -1279,6 +1279,7 @@ out:
>  static int pppol2tp_release(struct socket *sock)
>  {
>  	struct sock *sk = sock->sk;
> +	struct pppol2tp_session *session;
>  	int error;
>  
>  	if (!sk)
> @@ -1296,9 +1297,18 @@ static int pppol2tp_release(struct socket *sock)
>  	sock_orphan(sk);
>  	sock->sk = NULL;
>  
> +	session = pppol2tp_sock_to_session(sk);
> +
>  	/* Purge any queued data */
>  	skb_queue_purge(&sk->sk_receive_queue);
>  	skb_queue_purge(&sk->sk_write_queue);
> +	if (session != NULL) {
> +		struct sk_buff *skb;
> +		while ((skb = skb_dequeue(&session->reorder_q))) {
> +			kfree_skb(skb);
> +			sock_put(sk);
> +		}
> +	}
>  
>  	release_sock(sk);
>  


-- 
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development


      reply	other threads:[~2008-06-08  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08  9:02 Missing patch from stable [6/7] Willy Tarreau
2008-06-08  9:33 ` James Chapman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=484BA767.4010008@katalix.com \
    --to=jchapman@katalix.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.