From: Eric Dumazet <eric.dumazet@gmail.com>
To: Misha Labjuk <spiked.yar@gmail.com>, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: PROBLEM: pppol2tp over pppoe NULL pointer dereference
Date: Thu, 03 Nov 2011 09:47:44 +0100 [thread overview]
Message-ID: <1320310064.2344.3.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <CAKpUy7Y794CJkAEtbsbTecbPq+KkniSTx4ftCncohzGsuJfk-w@mail.gmail.com>
Le jeudi 03 novembre 2011 à 02:35 +0400, Misha Labjuk a écrit :
> Thanks!! Panic disappeared.
>
Here is the official patch submission again (not mangled this time),
thanks !
[PATCH] l2tp: fix race in l2tp_recv_dequeue()
Misha Labjuk reported panics occurring in l2tp_recv_dequeue()
If we release reorder_q.lock, we must not keep a dangling pointer (tmp),
since another thread could manipulate reorder_q.
Instead we must restart the scan at beginning of list.
Reported-by: Misha Labjuk <spiked.yar@gmail.com>
Tested-by: Misha Labjuk <spiked.yar@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/l2tp/l2tp_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 34b2dde..bf8d50c 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -397,6 +397,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session)
* expect to send up next, dequeue it and any other
* in-sequence packets behind it.
*/
+start:
spin_lock_bh(&session->reorder_q.lock);
skb_queue_walk_safe(&session->reorder_q, skb, tmp) {
if (time_after(jiffies, L2TP_SKB_CB(skb)->expires)) {
@@ -433,7 +434,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session)
*/
spin_unlock_bh(&session->reorder_q.lock);
l2tp_recv_dequeue_skb(session, skb);
- spin_lock_bh(&session->reorder_q.lock);
+ goto start;
}
out:
next prev parent reply other threads:[~2011-11-03 8:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-01 22:00 PROBLEM: pppol2tp over pppoe NULL pointer dereference Misha Labjuk
2011-11-01 22:35 ` Eric Dumazet
2011-11-02 5:04 ` Misha Labjuk
2011-11-02 7:07 ` Eric Dumazet
2011-11-02 15:54 ` Jorge Boncompte [DTI2]
2011-11-02 22:35 ` Misha Labjuk
2011-11-02 22:53 ` [PATCH] l2tp: fix l2tp_recv_dequeue() Eric Dumazet
2011-11-03 6:50 ` Eric Dumazet
2011-11-03 8:47 ` Eric Dumazet [this message]
2011-11-03 22:02 ` PROBLEM: pppol2tp over pppoe NULL pointer dereference David Miller
2011-11-01 22:56 ` [PATCH] udp: fix a race in encap_rcv handling Eric Dumazet
2011-11-02 4:51 ` David Miller
2011-11-01 23:58 ` PROBLEM: pppol2tp over pppoe NULL pointer dereference Eric Dumazet
2011-11-05 2:28 ` David Miller
2011-11-05 7:40 ` Eric Dumazet
2011-11-08 19:00 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2011-11-18 15:35 Окунев Дмитрий Юрьевич
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=1320310064.2344.3.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=spiked.yar@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox