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:	Tue, 3 Feb 2015 15:11:00 +0100
From:	Ignacy Gawedzki <ignacy.gawedzki@...en-communications.fr>
To:	netdev@...r.kernel.org
Subject: RFC: Fix "tc filter show" for basic filters

Hi everyone,

I have a problem with tc filter and very simple "basic" filters with no
associated action.

The thing is I have an HTB qdisc with handle 1: with a single class 1:1
attached to it.  When I add a basic filter that does nothing,

  tc filter add dev eth0 prio 1 handle 1 parent 1: basic classid 1:1

it doesn't completely appear when I type

  tc filter show dev eth0

When debugging basic_dump() in net/sched/cls_basic.c, I noticed that
tcf_exts_dump_stats() returns -1, which triggers a jump to nla_put_failure
which ends up removing all the added attributes so far.  When looking at
tcf_action_copy_stats() in net/sched/act_api.c, which is ultimately called by
tcf_exts_dump_stats(), I see that the returned error is triggered by a->priv
being NULL.

Although I confess I didn't make the effort of understanding all the workings
of a->priv in this context, it seems to me that if that is NULL, this is
probably not a good reason to return an error.  I made the change below and so
far it works for me.

Can anyone take a critical look at this?

Thanks.

Ignacy

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 3d43e49..6dd46be 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -602,7 +602,7 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct
tc_action *a,
        struct tcf_common *p = a->priv;
 
        if (p == NULL)
-               goto errout;
+               return 0;
 
        /* compat_mode being true specifies a call that is supposed
         * to add additional backward compatibility statistic TLVs.

-- 
Ignacy Gawędzki
R&D Engineer
Green Communications
--
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