Re: [PATCH net] ppp: fix xmit recursion detection on ppp channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 08, 2017 at 09:16:33PM +0800, Gao Feng wrote:
> At 2017-08-08 17:43:24, "Guillaume Nault" <g.nault@xxxxxxxxxxxx> wrote:
> >--- a/drivers/net/ppp/ppp_generic.c
> >+++ b/drivers/net/ppp/ppp_generic.c
> >@@ -1915,21 +1915,23 @@ static void __ppp_channel_push(struct channel *pch)
> > 	spin_unlock(&pch->downl);
> > 	/* see if there is anything from the attached unit to be sent */
> > 	if (skb_queue_empty(&pch->file.xq)) {
> >-		read_lock(&pch->upl);
> > 		ppp = pch->ppp;
> > 		if (ppp)
> >-			ppp_xmit_process(ppp);
> >-		read_unlock(&pch->upl);
> >+			__ppp_xmit_process(ppp);
> > 	}
> > }
> > 
> > static void ppp_channel_push(struct channel *pch)
> > {
> >-	local_bh_disable();
> >-
> >-	__ppp_channel_push(pch);
> >-
> >-	local_bh_enable();
> >+	read_lock_bh(&pch->upl);
> >+	if (pch->ppp) {
> >+		(*this_cpu_ptr(pch->ppp->xmit_recursion))++;
> >+		__ppp_channel_push(pch);
> >+		(*this_cpu_ptr(pch->ppp->xmit_recursion))--;
> >+	} else {
> >+		__ppp_channel_push(pch);
> >+	}
> >+	read_unlock_bh(&pch->upl);
> 
> If invoked read_lock_bh in ppp_channel_push, it would be unnecessary to invoke read_lock(&pch->upl)
> in the __ppp_channel_push.
> 
But this patch does remove read_lock(&pch->upl) from
__ppp_channel_push(). Or have I misunderstood your point?
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Audio Users]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux