From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0BB5C04AAF for ; Thu, 16 May 2019 19:25:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F365206A3 for ; Thu, 16 May 2019 19:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbfEPTZu (ORCPT ); Thu, 16 May 2019 15:25:50 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:60300 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbfEPTZu (ORCPT ); Thu, 16 May 2019 15:25:50 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d8]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 8D88A133E97B3; Thu, 16 May 2019 12:25:49 -0700 (PDT) Date: Thu, 16 May 2019 12:25:49 -0700 (PDT) Message-Id: <20190516.122549.1356146859638469688.davem@davemloft.net> To: edumazet@google.com Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com, syzkaller@googlegroups.com, weiwan@google.com, dsahern@gmail.com, kafai@fb.com Subject: Re: [PATCH net] ipv6: prevent possible fib6 leaks From: David Miller In-Reply-To: <20190516023952.28943-1-edumazet@google.com> References: <20190516023952.28943-1-edumazet@google.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 16 May 2019 12:25:50 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet Date: Wed, 15 May 2019 19:39:52 -0700 > At ipv6 route dismantle, fib6_drop_pcpu_from() is responsible > for finding all percpu routes and set their ->from pointer > to NULL, so that fib6_ref can reach its expected value (1). > > The problem right now is that other cpus can still catch the > route being deleted, since there is no rcu grace period > between the route deletion and call to fib6_drop_pcpu_from() > > This can leak the fib6 and associated resources, since no > notifier will take care of removing the last reference(s). > > I decided to add another boolean (fib6_destroying) instead > of reusing/renaming exception_bucket_flushed to ease stable backports, > and properly document the memory barriers used to implement this fix. > > This patch has been co-developped with Wei Wang. > > Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") > Signed-off-by: Eric Dumazet > Reported-by: syzbot Applied and queued up for -stable.