Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753768Ab2EWGnm (ORCPT ); Wed, 23 May 2012 02:43:42 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:48170 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892Ab2EWGnl (ORCPT ); Wed, 23 May 2012 02:43:41 -0400 Subject: Re: [PATCH] ipv4: fix the rcu race between free_fib_info and ip_route_output_slow From: Eric Dumazet To: Yanmin Zhang Cc: David Miller , kunx.jiang@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1337755038.3361.1878.camel@edumazet-glaptop> References: <4FBB6105.2060808@intel.com> <20120522.151554.106838106733194160.davem@davemloft.net> <1337742123.14538.175.camel@ymzhang.sh.intel.com> <20120522.232310.911242148705021745.davem@davemloft.net> <1337747829.3361.1599.camel@edumazet-glaptop> <1337748897.14538.184.camel@ymzhang.sh.intel.com> <1337749339.3361.1655.camel@edumazet-glaptop> <1337755038.3361.1878.camel@edumazet-glaptop> Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 May 2012 08:43:33 +0200 Message-ID: <1337755413.3361.1896.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 884 Lines: 28 On Wed, 2012-05-23 at 08:37 +0200, Eric Dumazet wrote: > From: Eric Dumazet > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index ffcb3b0..b56b91e 100644 > --- a/net/ipv4/route.c > +++ b/net/ipv4/route.c > @@ -2127,7 +2127,7 @@ static int __mkroute_input(struct sk_buff *skb, > u32 itag; > > /* get a working reference to the output device */ > - out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res)); > + out_dev = __in_dev_get_rcu(rcu_dereference(FIB_RES_DEV(*res))); This part might need additional fix (if FIB_RES_DEV(*res) is NULL), because __in_dev_get_rcu() could crash dereferencing NULL pointer. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/