]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ebtables: Fix extension lookup with identical name
authorPhil Sutter <phil@nwl.cc>
Mon, 11 Apr 2016 23:31:14 +0000 (01:31 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 12 Apr 2016 23:16:57 +0000 (01:16 +0200)
commitb3fadb96f88cc7db84d92384315a9d5c894ee1b9
treebc56faa21bf6d61dd7b94f302c828ef0a50185c9
parent13bf116609caf9b76ac3f830704771715230f0d4
netfilter: ebtables: Fix extension lookup with identical name

If a requested extension exists as module and is not loaded,
ebt_check_match() might accidentally use an NFPROTO_UNSPEC one with same
name and fail.

Reproduced with limit match: Given xt_limit and ebt_limit both built as
module, the following would fail:

  modprobe xt_limit
  ebtables -I INPUT --limit 1/s -j ACCEPT

The fix is to make ebt_check_match() distrust a found NFPROTO_UNSPEC
extension and retry after requesting an appropriate module.

Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/bridge/netfilter/ebtables.c