From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756672AbcAYKFM (ORCPT ); Mon, 25 Jan 2016 05:05:12 -0500 Received: from helcar.hengli.com.au ([209.40.204.226]:40346 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756140AbcAYKFH (ORCPT ); Mon, 25 Jan 2016 05:05:07 -0500 Date: Mon, 25 Jan 2016 18:03:41 +0800 From: Herbert Xu To: Florian Westphal Cc: Daniel Borkmann , Dmitry Vyukov , "David S. Miller" , Thomas Graf , Ken-ichirou MATSUZAWA , Eric Dumazet , David Herrmann , Nicolas Dichtel , netdev , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin , netfilter-devel@vger.kernel.org, Pablo Neira Ayuso Subject: Re: net: GPF in netlink_getsockbyportid Message-ID: <20160125100341.GA6735@gondor.apana.org.au> References: <20160123192502.GB17729@breakpoint.cc> <56A3DCF7.7000404@iogearbox.net> <20160124001103.GA2748@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160124001103.GA2748@breakpoint.cc> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 24, 2016 at 01:11:03AM +0100, Florian Westphal wrote: > Daniel Borkmann wrote: > > On 01/23/2016 08:25 PM, Florian Westphal wrote: > > >Dmitry Vyukov wrote: > > > > > >[ CC nf-devel, not sure if its nfnetlink fault or NETLINK_MMAP ] > > > > > >>The following program causes GPF in netlink_getsockbyportid: > [..] > > > >CONFIG_NETLINK_MMAP and nfnetlink batching strike in unison :-/ > > > > > >root cause is in nfnetlink_rcv_batch(): > > > > > >296 replay: > > >297 status = 0; > > >298 > > >299 skb = netlink_skb_clone(oskb, GFP_KERNEL); > > > > > >The clone op doesn't copy oskb->sk, so we oops in > > >__netlink_alloc_skb -> netlink_getsockbyportid() when nfnetlink_rcv_batch > > >tries to send netlink ack. > > > > If indeed oskb is the mmap'ed netlink skb, then it's not even allowed > > to call into skb_clone() > > Right, but in this case there is no mmap'd netlink sk involved -- we > crash when we try to look up dst netlink socket to see if there is an > mmap'd ring attached. > > [ and that code isn't there with CONFIG_NETLINK_MMAP=n ]. Let's CC Pablo since he wrote the code in question. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt