All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: ip6tables *broken* - last base chain position %u doesn't match underflow %u (hook %u
@ 2018-03-20 15:17 valdis.kletnieks
  2018-03-20 15:48 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: valdis.kletnieks @ 2018-03-20 15:17 UTC (permalink / raw)
  To: Florian Westphal, Pablo Neira Ayuso; +Cc: netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

(Resending because I haven't heard anything)

Am hitting an issue with this commit:

commit 0d7df906a0e78079a02108b06d32c3ef2238ad25
Author: Florian Westphal <fw@strlen.de>
Date:   Tue Feb 27 19:42:37 2018 +0100

    netfilter: x_tables: ensure last rule in base chain matches underflow/policy

This trips on my system:

[   64.402790] ip6_tables: last base chain position 1136 doesn't match underflow 1344 (hook 1)

More annoyingly, the return value means that ip6tables aren't initialized
so there's no firewall protection.  (In other words, this:

    If a (syzkaller generated) ruleset doesn't have the underflow/policy
    stored as the last rule in the base chain, then iptables will abort()
    because it doesn't find the chain policy.

ends up meaning iptables aborts anyhow.

My iptables isn't syzkaller generated - it's mostly crufty vi-generated. ;)

Messages generated as I tried to build smaller tables to narrow down the problem:
(not sure where it gets the numbers from, as I reduced it from 50 lines down to 3
and no real correlation to the tables I was trying to load - in particular the numbers
went up once and remained unchanged once, even though between each try I was
whacking out another 5-10 lines...)

[   64.402790] ip6_tables: last base chain position 1136 doesn't match underflow 1344 (hook 1)
[ 1897.914828] ip6_tables: last base chain position 928 doesn't match underflow 1136 (hook 1)
[ 1954.032735] ip6_tables: last base chain position 720 doesn't match underflow 928 (hook 1)
[ 2021.813719] ip6_tables: last base chain position 920 doesn't match underflow 1128 (hook 1)
[ 2035.044103] ip6_tables: last base chain position 920 doesn't match underflow 1128 (hook 1)
[ 2060.594412] ip6_tables: last base chain position 616 doesn't match underflow 824 (hook 1)

I finally got /etc/sysconfig/ip6tables down to this:

# Generated by ip6tables-save v1.6.2 on Thu Mar  8 08:20:04 2018
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [208207395:46346275671]
[120166037:34218429901] -A INPUT -i lo+ -j ACCEPT
[129329499:129691207309] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A INPUT -j DROP
COMMIT
# Completed on Thu Mar  8 08:20:04 2018

About as minimal as it can get. :)

Any ideas?

[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: ip6tables *broken* - last base chain position %u doesn't match underflow %u (hook %u
  2018-03-20 15:17 linux-next: ip6tables *broken* - last base chain position %u doesn't match underflow %u (hook %u valdis.kletnieks
@ 2018-03-20 15:48 ` Florian Westphal
  2018-03-20 15:57   ` valdis.kletnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2018-03-20 15:48 UTC (permalink / raw)
  To: valdis.kletnieks
  Cc: Florian Westphal, Pablo Neira Ayuso, netdev, linux-kernel

valdis.kletnieks@vt.edu <valdis.kletnieks@vt.edu> wrote:
> (Resending because I haven't heard anything)
[ ip6tables broken ]

Sorry, did not see this email before.

I'll investigate asap, thanks for the detailed report.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: ip6tables *broken* - last base chain position %u doesn't match underflow %u (hook %u
  2018-03-20 15:48 ` Florian Westphal
@ 2018-03-20 15:57   ` valdis.kletnieks
  0 siblings, 0 replies; 3+ messages in thread
From: valdis.kletnieks @ 2018-03-20 15:57 UTC (permalink / raw)
  To: Florian Westphal; +Cc: Pablo Neira Ayuso, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

On Tue, 20 Mar 2018 16:48:42 +0100, Florian Westphal said:
> valdis.kletnieks@vt.edu <valdis.kletnieks@vt.edu> wrote:
> > (Resending because I haven't heard anything)
> [ ip6tables broken ]
>
> Sorry, did not see this email before.
>
> I'll investigate asap, thanks for the detailed report.

No problem, it reverts cleanly and looks like it's 4.17 material,
and finding stuff like this is why I build linux-next kernels :)

Just remember to stick a Reported-By: on the fix :)


[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-20 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 15:17 linux-next: ip6tables *broken* - last base chain position %u doesn't match underflow %u (hook %u valdis.kletnieks
2018-03-20 15:48 ` Florian Westphal
2018-03-20 15:57   ` valdis.kletnieks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.