Message ID | 1381411809.4971.77.camel@edumazet-glaptop.roam.corp.google.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Thu, 10 Oct 2013 06:30:09 -0700 > From: Eric Dumazet <edumazet@google.com> > > François Cachereul made a very nice bug report and suspected > the bh_lock_sock() / bh_unlok_sock() pair used in l2tp_xmit_skb() from > process context was not good. > > This problem was added by commit > ("l2tp: Fix locking in l2tp_core.c"). I added the commit SHA ID for you, please take care of this next time. > l2tp_eth_dev_xmit() runs from BH context, so we must disable BH > from other l2tp_xmit_skb() users. ... > Reported-by: François Cachereul <f.cachereul@alphalink.fr> > Tested-by: François Cachereul <f.cachereul@alphalink.fr> > Signed-off-by: Eric Dumazet <edumazet@google.com> Applied and queued up for -stable, thanks everyone. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index f0a7ada..ffda81e 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c @@ -353,7 +353,9 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh goto error_put_sess_tun; } + local_bh_disable(); l2tp_xmit_skb(session, skb, session->hdr_len); + local_bh_enable(); sock_put(ps->tunnel_sock); sock_put(sk); @@ -422,7 +424,9 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) skb->data[0] = ppph[0]; skb->data[1] = ppph[1]; + local_bh_disable(); l2tp_xmit_skb(session, skb, session->hdr_len); + local_bh_enable(); sock_put(sk_tun); sock_put(sk);