Skip to content

Commit aded9f3

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: x_tables: remove obsolete check
Since 'netfilter: x_tables: validate targets of jumps' change we validate that the target aligns exactly with beginning of a rule, so offset test is now redundant. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 9560915 commit aded9f3

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

net/ipv4/netfilter/arp_tables.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,6 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
461461
if (strcmp(t->target.u.user.name,
462462
XT_STANDARD_TARGET) == 0 &&
463463
newpos >= 0) {
464-
if (newpos > newinfo->size -
465-
sizeof(struct arpt_entry)) {
466-
duprintf("mark_source_chains: "
467-
"bad verdict (%i)\n",
468-
newpos);
469-
return 0;
470-
}
471-
472464
/* This a jump; chase it. */
473465
duprintf("Jump rule %u -> %u\n",
474466
pos, newpos);

net/ipv4/netfilter/ip_tables.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,6 @@ mark_source_chains(const struct xt_table_info *newinfo,
542542
if (strcmp(t->target.u.user.name,
543543
XT_STANDARD_TARGET) == 0 &&
544544
newpos >= 0) {
545-
if (newpos > newinfo->size -
546-
sizeof(struct ipt_entry)) {
547-
duprintf("mark_source_chains: "
548-
"bad verdict (%i)\n",
549-
newpos);
550-
return 0;
551-
}
552545
/* This a jump; chase it. */
553546
duprintf("Jump rule %u -> %u\n",
554547
pos, newpos);

net/ipv6/netfilter/ip6_tables.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,6 @@ mark_source_chains(const struct xt_table_info *newinfo,
554554
if (strcmp(t->target.u.user.name,
555555
XT_STANDARD_TARGET) == 0 &&
556556
newpos >= 0) {
557-
if (newpos > newinfo->size -
558-
sizeof(struct ip6t_entry)) {
559-
duprintf("mark_source_chains: "
560-
"bad verdict (%i)\n",
561-
newpos);
562-
return 0;
563-
}
564557
/* This a jump; chase it. */
565558
duprintf("Jump rule %u -> %u\n",
566559
pos, newpos);

0 commit comments

Comments
 (0)