mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
netfilter: ebtables: module names must be null-terminated
We need to explicitly check the length, else we may pass non-null
terminated string to request_module().
Cc: stable@vger.kernel.org
Fixes: bcf4934288 ("netfilter: ebtables: Fix extension lookup with identical name")
Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
parent
cbfe53599e
commit
084d23f818
|
|
@ -403,6 +403,9 @@ ebt_check_match(struct ebt_entry_match *m, struct xt_mtchk_param *par,
|
|||
left - sizeof(struct ebt_entry_match) < m->match_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (strnlen(m->u.name, XT_EXTENSION_MAXNAMELEN) == XT_EXTENSION_MAXNAMELEN)
|
||||
return -EINVAL;
|
||||
|
||||
match = xt_find_match(NFPROTO_BRIDGE, m->u.name, m->u.revision);
|
||||
if (IS_ERR(match) || match->family != NFPROTO_BRIDGE) {
|
||||
if (!IS_ERR(match))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user