mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
From c4c8899376c2eb363c70b0b200434cc9abd3d34e Mon Sep 17 00:00:00 2001
|
|
From: Cong Wang <xiyou.wangcong@gmail.com>
|
|
Date: Mon, 22 Jul 2019 21:43:00 -0700
|
|
Subject: [PATCH 781/826] ife: error out when nla attributes are empty
|
|
|
|
[ Upstream commit c8ec4632c6ac9cda0e8c3d51aa41eeab66585bd5 ]
|
|
|
|
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 <jhs@mojatatu.com>
|
|
Cc: Jiri Pirko <jiri@resnulli.us>
|
|
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
---
|
|
net/sched/act_ife.c | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
|
|
index 06a3d4801878..915b6e94da63 100644
|
|
--- a/net/sched/act_ife.c
|
|
+++ b/net/sched/act_ife.c
|
|
@@ -484,6 +484,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(tb, TCA_IFE_MAX, nla, ife_policy, NULL);
|
|
if (err < 0)
|
|
return err;
|
|
--
|
|
2.22.0
|
|
|