Thread (4 messages) 4 messages, 2 authors, 2018-10-10

Re: [PATCH net] net/sched: cls_api: add missing validation of netlink attributes

flat view

From: David Ahern <hidden>
Date: 2018-10-10 01:03:44

On 10/9/18 10:12 AM, Davide Caratti wrote:
quoted
quoted
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -37,6 +37,11 @@ static LIST_HEAD(tcf_proto_base);
 /* Protects list of registered TC modules. It is pure SMP lock. */
 static DEFINE_RWLOCK(cls_mod_lock);
 
+const struct nla_policy cls_tca_policy[TCA_MAX + 1] = {
+	[TCA_KIND]	= { .type = NLA_STRING },
+	[TCA_CHAIN]	= { .type = NLA_U32 },
+};
+
quoted
it be nice to have a tc_common module so this stuff does not have to be
defined multiple times.
it makes sense to avoid duplicating the declaration of that array. But I
don't think we can put it in a module, because CONFIG_NET_SCHED is 'bool'
and

obj-$(CONFIG_NET_SCHED)         += sch_api.o

I can try a v2 where 'rtm_tca_policy' symbol in sch_api is exported and
used by cls_api.c code. WDYT?
since NET_SCHED is a bool, that should work.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help