Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp294813pxv; Thu, 8 Jul 2021 02:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXq1Al/Gv1VqmJP3/q3V8azCM3WIUrZ4081d3AlfluTJNVrDrI7P1uMvIcClhJGe2Derfr X-Received: by 2002:a17:907:97c5:: with SMTP id js5mr29636481ejc.321.1625737504157; Thu, 08 Jul 2021 02:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625737504; cv=none; d=google.com; s=arc-20160816; b=C1bQihGwmRRp5550ecH53hPYVtRvxpPKKegpVYrOk6vD4x4WsBVPlm+rMxotYN30wr QuPC317R4L8xN3MOPPT5LnlV/LneYGsSg/xtFkBb/gu30t8li4hRlVwFcFWmgg4cta4m 79X6A0n1OwZLIYhIQxRV6JO/4VGdWUOj0UIojbJLZlx33A1H2hOIA3xxPkAFtsGQmjrk LtKV/xwYkoG6V4nioGA+wzgpFwNvgCGCsLaaBgtDS9r7h7UXQZFlwRI2wTohoC5yzNgj 7/Upvak/f0i0nvsU91OyZ6X75ASyVBS25AAAwwk7co9pxVFBvnqphH7XpADM8+mAIgHI P9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=XHXCY6ZWXWOPegX8TQxkuSJ6srl8fMLRk8je2hHJc6I=; b=kBzC379zvKUjZA8n/U5VfS3WBLYTxXKelOGOiDlztDb6vgLQfHdpBgfK0Tiu9J0a8o ql2WPd4HJuVV2eT7xqzoBqByj3vgx1I4ApQ3LPte6wgFpiZg56bHLM5l3abpQDh7cx1W TEFFFxxzyujGR3PdXCL9H/GKz3nwkachBCXZSUHbb5DZfJvIkPGAHf2ODb1pkC67PjvY wTOAHJJK+RrrTZv0U6VScvtlfdykxu09SWZK6Nppscd/jdq4p4aj2nKoa+PZwSWbVS46 XKRret/vYd/r26MHTdS2xqz5/zR5eqvtrzXaoPvtntgepof011ShGMJiAJYz42Ojb1wQ oSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="jird/N4h"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k8si2387068eds.398.2021.07.08.02.44.41; Thu, 08 Jul 2021 02:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="jird/N4h"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231336AbhGHJqV (ORCPT + 99 others); Thu, 8 Jul 2021 05:46:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbhGHJqU (ORCPT ); Thu, 8 Jul 2021 05:46:20 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB05C061574; Thu, 8 Jul 2021 02:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=XHXCY6ZWXWOPegX8TQxkuSJ6srl8fMLRk8je2hHJc6I=; t=1625737419; x=1626947019; b=jird/N4hMXE7n2PoKmS0IoDaYEz7PHwKklqJ3nRnht2wxjQ tr4eh8e/F6wjCFMdpc3CHgmJ2+wmzBazDpPJWUK+KSHCemyeSZj83vzWfZ0xdOyJDCj3s6vrKXjZy W0Nx9ee+zSGk+RB7MliEzAloMZ4mONIb84u7KKz732OZ9Y0UieRGKw6qa1bPE6r/xVnE/iW9xG8Vc EhcXL8AwbIAt4Qy6q0VSChGD+V8SAm9CQtfzeblbVC9zrE5iygS0aS69KmT1cUikbmjbd3asLnt+m kZdy4cXUV1m/bN2KXdOGw+XhPFu8F0D/G5sUfTTYte1JxSoFHPB+nDBznp9K2O3g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1m1QZ2-00H1iq-B3; Thu, 08 Jul 2021 11:43:24 +0200 Message-ID: <3c160d187382677abe40606a6a88ddac0809c328.camel@sipsolutions.net> Subject: Re: [PATCH v2] net: rtnetlink: Fix rtnl_dereference may be return NULL From: Johannes Berg To: Yajun Deng , davem@davemloft.net, kuba@kernel.org, ryazanov.s.a@gmail.com, avagin@gmail.com, vladimir.oltean@nxp.com, cong.wang@bytedance.com, roopa@cumulusnetworks.com, zhudi21@huawei.com, edumazet@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 08 Jul 2021 11:43:20 +0200 In-Reply-To: <20210708092936.20044-1-yajun.deng@linux.dev> References: <20210708092936.20044-1-yajun.deng@linux.dev> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-07-08 at 17:29 +0800, Yajun Deng wrote: > The value 'link' may be NULL in rtnl_unregister(), this leads to > kfree_rcu(NULL, xxx), so add this case handling. > I don't see how. It would require the caller to unregister something they never registered. That would be a bug there, but I don't see that it's very useful to actually be defensive about bugs there. > And modify the return > value to 'void' in rtnl_unregister(). there is no case using it. > > Fixes: addf9b90de22 (net: rtnetlink: use rcu to free rtnl message handlers) > Fixes: 51e13685bd93 (rtnetlink: RCU-annotate both dimensions of rtnl_msg_handlers) It certainly fixes nothing in those patches. johannes