summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDaiane Angolini <daiane.angolini@foundries.io>2022-11-07 10:43:19 -0300
committerDaiane Angolini <daiane.angolini@foundries.io>2022-11-07 10:43:19 -0300
commit5624aaa8587a3676fa871e5b5843b4112a1b2055 (patch)
treec3073499028c71f7e16c11b81a911fece2fa1b97 /net
parent1db947108c27f7769c873f02c7af67e212d880a2 (diff)
parenta0a7e0b2b8b22901945ea2aef1b65871d718accf (diff)
Merge tag 'v5.15.62' into 5.15-2.1.x-imx
This is the 5.15.62 stable release
Diffstat (limited to 'net')
-rw-r--r--net/sched/cls_route.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 3f935cbbaff6..48712bc51bda 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -424,6 +424,11 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp,
return -EINVAL;
}
+ if (!nhandle) {
+ NL_SET_ERR_MSG(extack, "Replacing with handle of 0 is invalid");
+ return -EINVAL;
+ }
+
h1 = to_hash(nhandle);
b = rtnl_dereference(head->table[h1]);
if (!b) {
@@ -477,6 +482,11 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
int err;
bool new = true;
+ if (!handle) {
+ NL_SET_ERR_MSG(extack, "Creating with handle of 0 is invalid");
+ return -EINVAL;
+ }
+
if (opt == NULL)
return handle ? -EINVAL : 0;