diff mbox

size overflow in function qdisc_tree_decrease_qlen net/sched/sch_api.c

Message ID 1448979337.25582.22.camel@edumazet-glaptop2.roam.corp.google.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Dec. 1, 2015, 2:15 p.m. UTC
On Tue, 2015-12-01 at 06:06 -0800, Eric Dumazet wrote:
> On Tue, 2015-12-01 at 12:19 +0100, Daniele Fucini wrote:
> > Thanks for the reply. Here's the output of `tc qdisc show`:
> > https://gist.github.com/1847102c8fe08f63e9e7
> > 
> > Daniele
> > 
> > 
> > On Mon, Nov 30, 2015 at 08:50:29PM -0800, Cong Wang wrote:
> > > On Mon, Nov 30, 2015 at 5:00 PM, Daniele Fucini <dfucini@gmail.com> wrote:
> > > > Hello,
> > > >
> > > > I'm using a Grsecurity patched kernel (version 4.2.6-201511282239) and
> > > > I'm getting system freezes due to PaX detecting a size overflow in
> > > > function qdisc_tree_decrease_qlen net/sched/sch_api.c:769 whenever I use
> > > > Transmission BitTorrent client.
> > > >
> > > > On the Grsecurity forum I was told it's probably an unintended integer
> > > > underflow that I should report upstream.
> > > >
> > > > Here's the relevant log:
> > > > https://gist.github.com/cf54ccbb12ea65e146d4
> > > >
> > > 
> > > Looks like we miss some sch->q.qlen accounting somewhere...
> > > 
> > > What is your qdisc setup? Is your fq_codel the default one or you installed it
> > > or some other qdisc somewhere (`tc qdisc show` could tell)?
> > > 
> > > I will take a deeper look tomorrow, or maybe Jamal could find something
> > > before I wake up. ;)
> 
> Hmm... I do not think we ever took care of MQ in
> qdisc_tree_decrease_qlen()

Please try following fix :




--
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

Comments

Daniele Fucini Dec. 1, 2015, 7:13 p.m. UTC | #1
I can't be 100% sure but after running transmission for over an hour
without any problems I'd say this fix worked. I'll keep it running for a
while so if it suddently freezes again I'll report it, but I hope it
won't be the case.

Daniele

On Tue, Dec 01, 2015 at 06:15:37AM -0800, Eric Dumazet wrote:
> 
> Please try following fix :
> 
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index f43c8f33f09e..72f2c1dfdcde 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -759,6 +759,8 @@ void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)
>  			WARN_ON(parentid != TC_H_ROOT);
>  			return;
>  		}
> +		if (sch->flags & TCQ_F_MQROOT)
> +			return;
>  		cops = sch->ops->cl_ops;
>  		if (cops->qlen_notify) {
>  			cl = cops->get(sch, parentid);
> 
> 
>
diff mbox

Patch

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index f43c8f33f09e..72f2c1dfdcde 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -759,6 +759,8 @@  void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)
 			WARN_ON(parentid != TC_H_ROOT);
 			return;
 		}
+		if (sch->flags & TCQ_F_MQROOT)
+			return;
 		cops = sch->ops->cl_ops;
 		if (cops->qlen_notify) {
 			cl = cops->get(sch, parentid);