lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180717135931.dexnlxtnv3daunit@breakpoint.cc>
Date:   Tue, 17 Jul 2018 15:59:31 +0200
From:   Florian Westphal <fw@...len.de>
To:     Dmitry Vyukov <dvyukov@...gle.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        Florian Westphal <fw@...len.de>,
        Eric Dumazet <edumazet@...gle.com>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
        netfilter-devel@...r.kernel.org, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] netfilter: nf_conntrack: prevent uninit-value in
 gc_worker

Dmitry Vyukov <dvyukov@...gle.com> wrote:
> What should have been initialized it?

nf_ct_refresh_acct()

> I assume it should have been happened in between init_conntrack and
> nf_conntrack_confirm, because nf_conntrack_confirm already adds to an
> uninit timeout value.

Yes.

> Since we got only 3 such reports and no reproducer, I would suspect
> that there is some race involved. Is it possible that timeout
> initialization (presumably a call to nf_ct_refresh_acct) happens after
> and non-atomically with the corresponding connection state update, so
> that the call to nf_conntrack_confirm sneaks before it?

Unconfirmed conntrack isn't in the hash table, so all events should
occur in order on same cpu:
1. allocation (init_conntrack)
2. timeout initialisation (via l4 tracker, can be generic one too)
3. nf_conntrack_confirm (insertion in hash table)

What could be possible is that another core is registering/unregistering
the conntrack hooks in parallel, I guess in that case we could have:

1. allocation (init_conntrack)
(other cpu: remove conntrack hooks)
(other cpu: add conntrack hooks)
3. nf_conntrack_confirm (insertion in hash table)

Just a theory of course.
In any case patch looks good to me.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ