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] [day] [month] [year] [list]
Date:	Wed, 20 May 2015 13:39:09 +0200
From:	Pablo Neira Ayuso <pablo@...filter.org>
To:	Francesco Ruggeri <fruggeri@...stanetworks.com>
Cc:	netdev@...r.kernel.org, gaofeng@...fujitsu.com,
	dvlasenk@...hat.com, netfilter-devel@...r.kernel.org,
	davem@...emloft.net, fruggeri@...sta.com
Subject: Re: [PATCH 1/1] netfilter: Fix kernel panic in nfulnl_rcv_nl_event

On Sun, May 17, 2015 at 02:30:31PM -0700, Francesco Ruggeri wrote:
> nfnetlink_log_init registers netlink callback nfulnl_rcv_nl_event before
> registering the pernet_subsys, but the callback relies on data structures
> allocated by pernet init functions.
> When nfnetlink_log is loaded, if a netlink message is received after
> the netlink callback is registered but before the pernet_subsys is
> registered, the kernel will panic in the sequence
> 
> nfulnl_rcv_nl_event
>   nfnl_log_pernet
>     net_generic
>       BUG_ON(id == 0)  where id is nfnl_log_net_id.
> 
> The panic can be easily reproduced in 4.0.3 by:
> 
> while true ;do modprobe nfnetlink_log ; rmmod nfnetlink_log ; done &
> while true ;do ip netns add dummy ; ip netns del dummy ; done &
> 
> This patch moves register_pernet_subsys to earlier in nfnetlink_log_init.
> 
> Notice that the BUG_ON hit in 4.0.3 was recently removed in 2591ffd308
> ["netns: remove BUG_ONs from net_generic()"].

I'm going to send a v2 of this patch with two changes:

* We have the same problem in nfnetlink_queue.
* Remove status = -ENOMEM as it is scratched soon thereafter.

Please, have a look at the patch I'll send after this and confirm this
looks good to you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ