netfilter: ebtables: fix erroneous reject of last rule
[ Upstream commitpull/10/head932909d9b2
] The last rule in the blob has next_entry offset that is same as total size. This made "ebtables32 -A OUTPUT -d de:ad:be:ef:01:02" fail on 64 bit kernel. Fixes:b718121685
("netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
parent
2299285fb1
commit
533f5f847d
|
@ -2124,8 +2124,12 @@ static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base,
|
|||
* offsets are relative to beginning of struct ebt_entry (i.e., 0).
|
||||
*/
|
||||
for (i = 0; i < 4 ; ++i) {
|
||||
if (offsets[i] >= *total)
|
||||
if (offsets[i] > *total)
|
||||
return -EINVAL;
|
||||
|
||||
if (i < 3 && offsets[i] == *total)
|
||||
return -EINVAL;
|
||||
|
||||
if (i == 0)
|
||||
continue;
|
||||
if (offsets[i-1] > offsets[i])
|
||||
|
|
Loading…
Reference in New Issue