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-next>] [day] [month] [year] [list]
Date:   Thu, 18 Jan 2018 14:17:28 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        "David S. Miller" <davem@...emloft.net>
Cc:     Arnd Bergmann <arnd@...db.de>,
        David Ahern <dsa@...ulusnetworks.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] [net-next] net: sched: avoid uninitialized variable use

gcc has identified a code path in which we pass uninitialized
data into tc_dump_tfilter():

net/sched/cls_api.c: In function 'tc_dump_tfilter':
net/sched/cls_api.c:1268:8: error: 'parent' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This initializes the variable to the value it had before the previous
change.

Fixes: 7960d1daf278 ("net: sched: use block index as a handle instead of qdisc when block is shared")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
----
I don't know if my patch is the best way to address the issue, but
if not, then at least it helps show what the warning is about
and lets someone else come up with a better solution.
---
 net/sched/cls_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index e500d11da9cd..a95bfc8fc442 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1317,6 +1317,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
 		block = tcf_block_lookup(net, tcm->tcm_block_index);
 		if (!block)
 			goto out;
+		parent = tcm->tcm_parent;
 	} else {
 		const struct Qdisc_class_ops *cops;
 		struct net_device *dev;
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ