summaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-07-23 16:49:59 +0100
committerMark Brown <broonie@kernel.org>2018-07-23 16:49:59 +0100
commita9c613d774e602d7c008acb374cb2185b5be2ee4 (patch)
treee4c81d684d9cb0518179aac4df64ed5eb497755f /net/bridge
parent5b49d48e6165b258428c871a8fc6a09cf75fdb0a (diff)
parent1c6a1d5ae62dbaec8922761f56332e6e830b32a4 (diff)
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/netfilter/ebtables.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 665fd87cc105..8b8a43fda6ca 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -404,6 +404,12 @@ ebt_check_watcher(struct ebt_entry_watcher *w, struct xt_tgchk_param *par,
watcher = xt_request_find_target(NFPROTO_BRIDGE, w->u.name, 0);
if (IS_ERR(watcher))
return PTR_ERR(watcher);
+
+ if (watcher->family != NFPROTO_BRIDGE) {
+ module_put(watcher->me);
+ return -ENOENT;
+ }
+
w->u.watcher = watcher;
par->target = watcher;
@@ -724,6 +730,13 @@ ebt_check_entry(struct ebt_entry *e, struct net *net,
goto cleanup_watchers;
}
+ /* Reject UNSPEC, xtables verdicts/return values are incompatible */
+ if (target->family != NFPROTO_BRIDGE) {
+ module_put(target->me);
+ ret = -ENOENT;
+ goto cleanup_watchers;
+ }
+
t->u.target = target;
if (t->u.target == &ebt_standard_target) {
if (gap < sizeof(struct ebt_standard_target)) {