|
@@ -396,6 +396,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;
|
|
@@ -715,6 +721,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)) {
|