From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] ipv6: use fib6_info_hold_safe() when necessary Date: Mon, 23 Jul 2018 11:19:55 -0700 (PDT) Message-ID: <20180723.111955.865372914094677781.davem@davemloft.net> References: <20180722035632.136090-1-tracywwnj@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, edumazet@google.com, dsahern@gmail.com, kafai@fb.com To: weiwan@google.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:46190 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387994AbeGWTWX (ORCPT ); Mon, 23 Jul 2018 15:22:23 -0400 In-Reply-To: <20180722035632.136090-1-tracywwnj@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Wei Wang Date: Sat, 21 Jul 2018 20:56:32 -0700 > From: Wei Wang > > In the code path where only rcu read lock is held, e.g. in the route > lookup code path, it is not safe to directly call fib6_info_hold() > because the fib6_info may already have been deleted but still exists > in the rcu grace period. Holding reference to it could cause double > free and crash the kernel. > > This patch adds a new function fib6_info_hold_safe() and replace > fib6_info_hold() in all necessary places. > > Syzbot reported 3 crash traces because of this. One of them is: ... > Fixes: 93531c674315 (net/ipv6: separate handling of FIB entries from dst based routes) > Reported-by: syzbot+902e2a1bcd4f7808cef5@syzkaller.appspotmail.com > Reported-by: syzbot+8ae62d67f647abeeceb9@syzkaller.appspotmail.com > Reported-by: syzbot+3f08feb14086930677d0@syzkaller.appspotmail.com > Signed-off-by: Wei Wang > Acked-by: Eric Dumazet Applied, thank you.