From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754284AbcARJV0 (ORCPT ); Mon, 18 Jan 2016 04:21:26 -0500 Received: from helcar.hengli.com.au ([209.40.204.226]:56175 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753904AbcARJVW (ORCPT ); Mon, 18 Jan 2016 04:21:22 -0500 Date: Mon, 18 Jan 2016 17:20:47 +0800 From: Herbert Xu To: Richard Weinberger Cc: "David S. Miller" , Thomas Graf , Daniel Borkmann , Ken-ichirou MATSUZAWA , Nicolas Dichtel , Florian Westphal , netdev , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin , Eric Dumazet , Dmitry Vyukov , "Eric W. Biederman" Subject: Re: net: GPF in __netlink_ns_capable Message-ID: <20160118092047.GA30682@gondor.apana.org.au> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sat, Jan 16, 2016 at 01:08:33AM +0100, Richard Weinberger wrote: > On Fri, Jan 15, 2016 at 11:31 PM, Dmitry Vyukov wrote: > > Call Trace: > > [< inline >] netlink_ns_capable net/netlink/af_netlink.c:1417 > > [] netlink_capable+0x25/0x30 net/netlink/af_netlink.c:1432 > > Hmm, we're crashing because NETLINK_CB(skb).sk is NULL. > netlink_dump() creates a new skb without a netlink control block, > but infiniband's dump functions use netlink_capable() which needs a valid > NETLINK_CB(skb).sk. > > What about something like that? No you can't do it here as netlink_unicast also calls this and for that case you'd be overwriting the original sending user-space socket with the kernel socket. I'm adding Eric Bierderman as he wrote some of the code in question. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt