lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 24 Oct 2014 10:49:46 -0700
From:	John Fastabend <john.fastabend@...il.com>
To:	wang.bo116@....com.cn
CC:	davem@...emloft.net, kaber@...sh.net, netdev@...r.kernel.org,
	cui.yunfeng@....com.cn
Subject: Re: [PATCH net] net/sched: Fix use of wild pointer in mq_destroy()
 when qdisc_alloc fail

On 10/24/2014 01:34 AM, wang.bo116@....com.cn wrote:
>

[...]

>
> --------------------------------------------------------------------------------
>
> This patch  fix this problem, base on linux 3.18-rc-1:
>
> Signed-off-by: Wang Bo <wang.bo116@....com.cn>
> Tested-by: Ma Chenggong <ma.chenggong@....com.cn>
> diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c
> index 42f72f1..a0c90e7 100755
> --- a/net/sched/sch_mq.c
> +++ b/net/sched/sch_mq.c
> @@ -33,6 +33,7 @@ static void mq_destroy(struct Qdisc *sch)
>   	for (ntx = 0; ntx < dev->num_tx_queues && priv->qdiscs[ntx]; ntx++)
>   		qdisc_destroy(priv->qdiscs[ntx]);
>   	kfree(priv->qdiscs);
> +	priv->qdiscs = NULL;
>   }
>
>   static int mq_init(struct Qdisc *sch, struct nlattr *opt)
>

Acked-by: John Fastabend <john.r.fastabend@...el.com>

Patch looks fine, another way to fix this would be drop the
mq_destroy() call in the error path. I'm not convinced one
is any better than the other but maybe some other folks have
opinions, it seems a bit wrong to call mq_destroy twice so in
that sense it may be a bit nicer to drop the mq_destroy().

Also same bug in mqprio do you want to submit a patch for
that qdisc as well? Otherwise I can.

Thanks!


-- 
John Fastabend         Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ