[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210309022854.17904-1-baijiaju1990@gmail.com>
Date: Mon, 8 Mar 2021 18:28:54 -0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: pablo@...filter.org, kadlec@...filter.org, fw@...len.de,
roopa@...dia.com, nikolay@...dia.com, davem@...emloft.net,
kuba@...nel.org
Cc: netfilter-devel@...r.kernel.org, coreteam@...filter.org,
bridge@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] net: bridge: fix error return code of do_update_counters()
When find_table_lock() returns NULL to t, no error return code of
do_update_counters() is assigned.
To fix this bug, ret is assigned with -ENOENT in this case.
Fixes: 49facff9f925 ("netfilter: ebtables: split update_counters into two functions")
Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
net/bridge/netfilter/ebtables.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index ebe33b60efd6..66c9e4077985 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1256,8 +1256,10 @@ static int do_update_counters(struct net *net, const char *name,
return -ENOMEM;
t = find_table_lock(net, name, &ret, &ebt_mutex);
- if (!t)
+ if (!t) {
+ ret = -ENOENT;
goto free_tmp;
+ }
if (num_counters != t->private->nentries) {
ret = -EINVAL;
--
2.17.1
Powered by blists - more mailing lists