From: Jarek Poplawski <jarkao2@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: jchapman@katalix.com, netdev@vger.kernel.org
Subject: Re: [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver
Date: Wed, 13 Feb 2008 07:29:08 +0000 [thread overview]
Message-ID: <20080213072908.GA2542@ff.dom.local> (raw)
In-Reply-To: <20080212.220003.108906105.davem@davemloft.net>
On Tue, Feb 12, 2008 at 10:00:03PM -0800, David Miller wrote:
> From: James Chapman <jchapman@katalix.com>
> Date: Tue, 12 Feb 2008 10:58:21 +0000
>
> > Here is a trace from when we had _bh locks.
>
> The problem is that the pppol2tp code calls sk_dst_get() in software
> interrupt context and that is not allowed.
Actually, this lockdep report probably warns of something else:
sk_dst_lock which is seen in process context with softirqs enabled
implicitly endangers some other (ppp_generic) locks, which depend
on ppp_generic pch->upl read_lock, which is taken in softirq context.
I can't see on this report any hardirqs dependancies, so it seems even
blocking hard interrupts, just like in this patch, shouldn't solve
this problem: if BHs were really disabled in exactly the same places,
then it seems this warning should trigger in both variants.
I studied long ago some similar problem with pppoe, and it looked like
ppp_generic needed some fix, but now I've to recall or re-learn almost
all and it needs more time... Anyway, there is a possibility, this
warning isn't so dangerous.
> sk_dst_get() grabs sk->sk_dst_lock without any BH enabling or
> disabling.
>
> It can do that because the usage is to make all the lock
> taking calls in user context, and in the packet processing
> paths use __sk_dst_get().
BTW, does it mean that ip4_datagram_connect() can be used only in user
context?
> Probably what the pppol2tp code should do is use __sk_dst_check()
> instead of sk_dst_get(). You then have to be able to handle
> NULL returns, just like UDP sendmsg() does, which means you'll
> need to cook up a routing lookup if __sk_dst_check() gives you
> NULL because the route became obsolete.
I think that without changing ppp_generic or changing ip_queue_xmit()
to something else in pppol2tp this would be really hard to avoid such
a warning (and maybe not very necessary).
Regards,
Jarek P.
next prev parent reply other threads:[~2008-02-13 7:21 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-11 9:22 [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver James Chapman
2008-02-11 18:57 ` Jarek Poplawski
2008-02-11 22:19 ` James Chapman
2008-02-11 22:49 ` Jarek Poplawski
2008-02-11 22:55 ` Jarek Poplawski
2008-02-11 23:42 ` James Chapman
2008-02-12 10:42 ` Jarek Poplawski
2008-02-11 23:41 ` James Chapman
2008-02-12 5:30 ` David Miller
2008-02-12 10:58 ` James Chapman
2008-02-12 13:24 ` Jarek Poplawski
2008-02-13 6:00 ` David Miller
2008-02-13 7:29 ` Jarek Poplawski [this message]
2008-02-14 13:00 ` Jarek Poplawski
2008-02-18 22:09 ` James Chapman
2008-02-18 23:01 ` Jarek Poplawski
2008-02-19 9:09 ` James Chapman
2008-02-19 4:29 ` David Miller
2008-02-19 9:03 ` James Chapman
2008-02-19 10:30 ` Jarek Poplawski
2008-02-19 10:36 ` Jarek Poplawski
2008-02-19 14:37 ` James Chapman
2008-02-19 23:06 ` Jarek Poplawski
2008-02-19 23:28 ` Jarek Poplawski
2008-02-20 16:02 ` James Chapman
2008-02-20 18:38 ` Jarek Poplawski
2008-02-20 22:37 ` James Chapman
2008-02-21 8:59 ` Jarek Poplawski
2008-02-21 9:53 ` James Chapman
2008-02-21 12:08 ` Jarek Poplawski
2008-02-21 17:09 ` Jarek Poplawski
2008-02-25 12:19 ` James Chapman
2008-02-25 13:05 ` Jarek Poplawski
2008-02-25 13:39 ` Jarek Poplawski
2008-02-25 14:02 ` Jarek Poplawski
2008-02-25 21:58 ` Jarek Poplawski
2008-02-26 12:14 ` James Chapman
2008-02-26 13:03 ` Jarek Poplawski
2008-02-26 13:18 ` Jarek Poplawski
2008-02-26 20:00 ` Jarek Poplawski
2008-03-02 20:29 ` James Chapman
2008-03-03 8:22 ` Jarek Poplawski
2008-03-03 9:35 ` Jarek Poplawski
2008-02-27 10:54 ` [PATCH][PPPOL2TP] add missing sock_put() in pppol2tp_recv_dequeue() Jarek Poplawski
2008-03-02 20:31 ` James Chapman
2008-03-04 4:49 ` David Miller
2008-02-27 11:48 ` [PATCH][PPPOL2TP] add missing sock_put() in pppol2tp_tunnel_closeall() Jarek Poplawski
2008-03-02 20:32 ` James Chapman
2008-03-04 4:49 ` David Miller
2008-02-22 14:16 ` [PATCH][NET] sock.c: sk_dst_lock lockdep keys and names per af_family Jarek Poplawski
2008-02-12 7:19 ` [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver Jarek Poplawski
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=20080213072908.GA2542@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).