From 47b7e8b5e680fdc200fdc75f8e281270f0a3ff5a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 19 Aug 2022 13:48:54 +0200 Subject: [PATCH] fix up net_sched-cls_route-disallow-handle-of-0.patch for 4.9 and 4.14 --- ...et_sched-cls_route-disallow-handle-of-0.patch | 16 ++++++---------- ...et_sched-cls_route-disallow-handle-of-0.patch | 16 ++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/queue-4.14/net_sched-cls_route-disallow-handle-of-0.patch b/queue-4.14/net_sched-cls_route-disallow-handle-of-0.patch index df979024298..104ba3a9991 100644 --- a/queue-4.14/net_sched-cls_route-disallow-handle-of-0.patch +++ b/queue-4.14/net_sched-cls_route-disallow-handle-of-0.patch @@ -56,31 +56,27 @@ Acked-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- - net/sched/cls_route.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) + net/sched/cls_route.c | 6 ++++++ + 1 file changed, 6 insertions(+) --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c -@@ -431,6 +431,11 @@ static int route4_set_parms(struct net * +@@ -431,6 +431,9 @@ static int route4_set_parms(struct net * return -EINVAL; } -+ if (!nhandle) { -+ NL_SET_ERR_MSG(extack, "Replacing with handle of 0 is invalid"); ++ if (!nhandle) + return -EINVAL; -+ } + h1 = to_hash(nhandle); b = rtnl_dereference(head->table[h1]); if (!b) { -@@ -483,6 +488,11 @@ static int route4_change(struct net *net +@@ -483,6 +486,9 @@ static int route4_change(struct net *net int err; bool new = true; -+ if (!handle) { -+ NL_SET_ERR_MSG(extack, "Creating with handle of 0 is invalid"); ++ if (!handle) + return -EINVAL; -+ } + if (opt == NULL) return handle ? -EINVAL : 0; diff --git a/queue-4.9/net_sched-cls_route-disallow-handle-of-0.patch b/queue-4.9/net_sched-cls_route-disallow-handle-of-0.patch index 0b2d4407915..25bec614d4e 100644 --- a/queue-4.9/net_sched-cls_route-disallow-handle-of-0.patch +++ b/queue-4.9/net_sched-cls_route-disallow-handle-of-0.patch @@ -56,31 +56,27 @@ Acked-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- - net/sched/cls_route.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) + net/sched/cls_route.c | 6 ++++++ + 1 file changed, 6 insertions(+) --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c -@@ -427,6 +427,11 @@ static int route4_set_parms(struct net * +@@ -427,6 +427,9 @@ static int route4_set_parms(struct net * goto errout; } -+ if (!nhandle) { -+ NL_SET_ERR_MSG(extack, "Replacing with handle of 0 is invalid"); ++ if (!nhandle) + return -EINVAL; -+ } + h1 = to_hash(nhandle); b = rtnl_dereference(head->table[h1]); if (!b) { -@@ -486,6 +491,11 @@ static int route4_change(struct net *net +@@ -486,6 +489,9 @@ static int route4_change(struct net *net int err; bool new = true; -+ if (!handle) { -+ NL_SET_ERR_MSG(extack, "Creating with handle of 0 is invalid"); ++ if (!handle) + return -EINVAL; -+ } + if (opt == NULL) return handle ? -EINVAL : 0; -- 2.47.3