]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: ebtables: CONFIG_COMPAT: reject trailing data after last rule
authorFlorian Westphal <fw@strlen.de>
Sun, 5 May 2019 16:47:33 +0000 (18:47 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:12:03 +0000 (21:12 +0100)
commitc140ca37d8f979b0ddb721b3fc7d6e16ae1305a8
treebcc27a23b12c46161e4672753d7b88f1a5cbc5ef
parente9895779b816d9d2fcd46fc6e572df2033fd06c7
netfilter: ebtables: CONFIG_COMPAT: reject trailing data after last rule

commit 680f6af5337c98d116e4f127cea7845339dba8da upstream.

If userspace provides a rule blob with trailing data after last target,
we trigger a splat, then convert ruleset to 64bit format (with trailing
data), then pass that to do_replace_finish() which then returns -EINVAL.

Erroring out right away avoids the splat plus unneeded translation and
error unwind.

Fixes: 81e675c227ec ("netfilter: ebtables: add CONFIG_COMPAT support")
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/bridge/netfilter/ebtables.c