From: Cong Wang Date: Tue, 23 Jul 2019 04:43:00 +0000 (-0700) Subject: ife: error out when nla attributes are empty X-Git-Tag: v5.4-rc1~378^2~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8ec4632c6ac9cda0e8c3d51aa41eeab66585bd5;p=platform%2Fkernel%2Flinux-rpi.git ife: error out when nla attributes are empty act_ife at least requires TCA_IFE_PARMS, so we have to bail out when there is no attribute passed in. Reported-by: syzbot+fbb5b288c9cb6a2eeac4@syzkaller.appspotmail.com Fixes: ef6980b6becb ("introduce IFE action") Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller --- diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index 41d5398..3578196 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c @@ -481,6 +481,11 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, int ret = 0; int err; + if (!nla) { + NL_SET_ERR_MSG_MOD(extack, "IFE requires attributes to be passed"); + return -EINVAL; + } + err = nla_parse_nested_deprecated(tb, TCA_IFE_MAX, nla, ife_policy, NULL); if (err < 0)