Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1756de26 authored by Florian Westphal's avatar Florian Westphal Committed by Patrick McHardy
Browse files

netfilter: ebtables: abort if next_offset is too small



next_offset must be > 0, otherwise this loops forever.
The offset also contains the size of the ebt_entry structure
itself, so anything smaller is invalid.

Signed-off-by: default avatarFlorian Westphal <fwestphal@astaro.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent ef00f89f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -444,6 +444,8 @@ static int ebt_verify_pointers(const struct ebt_replace *repl,
				break;
			if (left < e->next_offset)
				break;
			if (e->next_offset < sizeof(struct ebt_entry))
				return -EINVAL;
			offset += e->next_offset;
		}
	}