From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753625AbdBJTQz (ORCPT ); Fri, 10 Feb 2017 14:16:55 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:40655 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdBJTQx (ORCPT ); Fri, 10 Feb 2017 14:16:53 -0500 Date: Fri, 10 Feb 2017 11:16:24 -0800 From: Sowmini Varadhan To: Cong Wang Cc: Eric Dumazet , Dmitry Vyukov , David Miller , Willem de Bruijn , Eric Dumazet , Daniel Borkmann , jarno@ovn.org, Philip Pettersson , weongyo.linux@gmail.com, netdev , LKML , syzkaller Subject: Re: net/packet: use-after-free in packet_rcv_fanout Message-ID: <20170210191624.GA11187@oracle.com> References: <1486696765.7793.119.camel@edumazet-glaptop3.roam.corp.google.com> <20170210033306.GA770@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/10/17 10:00), Cong Wang wrote: > My understanding about the race here is packet_release() doesn't > wait for flying packets correctly, which leads to a flying packet still > refers to the struct sock which is being released. > > This could happen because struct packet_fanout is refcn'ted, it is : > At least I believe this explains the crash Dmitry reported. hmm, the proof of the pudding is in the eating- would be good to be able to reliably reproduce this somewhere (thus proving that root-cause analysis is rock-solid), maybe by introducing artificial delays to slow down paths.. I'm travelling at the moment but may be able to give this (try to reproduce it reliably) next week. --Sowmini