Florian Westphal 5173bc679d netfilter: nat: fix crash when conntrack entry is re-used
Stas Nichiporovich reports oops in nf_nat_bysource_cmp(), trying to
access nf_conn struct at address 0xffffffffffffff50.

This is the result of fetching a null rhash list (struct embedded at
offset 176; 0 - 176 gets us ...fff50).

The problem is that conntrack entries are allocated from a
SLAB_DESTROY_BY_RCU cache, i.e. entries can be free'd and reused
on another cpu while nf nat bysource hash access the same conntrack entry.

Freeing is fine (we hold rcu read lock); zeroing rhlist_head isn't.

-> Move the rhlist struct outside of the memset()-inited area.

Fixes: 7c9664351980aaa6a ("netfilter: move nat hlist_head to nf_conn")
Reported-by: Stas Nichiporovich <stasn77@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-11-24 14:43:35 +01:00
..
2014-09-18 10:54:36 +02:00
2015-03-04 00:23:23 -05:00
2015-06-28 16:55:44 -07:00
2016-09-27 21:15:21 -04:00
2015-11-18 16:17:38 -05:00
2016-06-27 15:06:17 -04:00
2016-07-08 12:20:57 +02:00
2016-04-25 16:44:27 -04:00
2016-04-25 16:44:27 -04:00
2016-06-09 23:41:03 -07:00
2015-03-06 21:50:02 -05:00
2016-08-26 11:55:18 -07:00
2015-09-17 17:18:37 -07:00
2016-09-23 08:38:50 -04:00
2016-02-16 20:21:48 -05:00
2013-11-07 19:28:58 -05:00
2016-06-08 11:36:02 -07:00
2016-05-20 18:03:16 -04:00
2016-04-27 22:48:25 -04:00
2016-10-14 10:59:15 -04:00
2016-05-20 18:03:17 -04:00
2016-08-17 19:36:23 -04:00
2014-01-03 20:56:48 -05:00
2016-08-30 22:27:18 -07:00
2016-10-26 08:01:07 +02:00
2015-10-23 06:26:42 -07:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2016-06-15 20:41:23 -07:00
2016-05-16 13:46:23 -04:00
2016-07-08 12:20:57 +02:00
2016-03-23 22:09:58 -04:00
2016-04-07 16:53:30 -04:00
2016-09-10 23:12:53 -07:00
2014-06-02 11:00:41 -07:00
2016-11-03 16:16:50 -04:00
2015-03-12 22:58:12 -04:00
2016-05-03 16:08:14 -04:00
2015-10-26 22:24:22 -07:00
2016-10-29 20:56:31 -04:00