From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752611AbcAXALW (ORCPT ); Sat, 23 Jan 2016 19:11:22 -0500 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:57348 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbcAXALT (ORCPT ); Sat, 23 Jan 2016 19:11:19 -0500 Date: Sun, 24 Jan 2016 01:11:03 +0100 From: Florian Westphal To: Daniel Borkmann Cc: Florian Westphal , Dmitry Vyukov , "David S. Miller" , Herbert Xu , 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 Subject: Re: net: GPF in netlink_getsockbyportid Message-ID: <20160124001103.GA2748@breakpoint.cc> References: <20160123192502.GB17729@breakpoint.cc> <56A3DCF7.7000404@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A3DCF7.7000404@iogearbox.net> 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 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 ].