Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp409534pxv; Thu, 8 Jul 2021 05:29:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1mOkiY+qrF9cfIyVZYijjgdx1cayNmB5Ct2yWMlLN2AfdXbkn8P9OYsDoFLKXcTrH3W0u X-Received: by 2002:a02:a891:: with SMTP id l17mr24486097jam.144.1625747372721; Thu, 08 Jul 2021 05:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625747372; cv=none; d=google.com; s=arc-20160816; b=K5wYLWMHPmMkXqX099VivyzavoGynK0I2xokeVJ3MVXu8Y4fvwtDMe/uzw0RJCBboG 5GbFA7cA/NJrgjLW+nziD1Ld+hn3lGOPaVZWv+3wCtOBO5MOJsqGqMNtfcPVSAQ1TL80 zob5c9kdFJ4wTgehUH8SlgJTyTXjffHL+dW2EfbO2JZQYkSsLWPh4Yl0/VwwKM+d6yau A7GM0r7MWViMux3QESumusyaN+r0wQx/owL5PVMxm706s4ipGbi9sY5XOXzsvmEh1PY6 0X9Q5HS07s+RMcKSzSA91sE1v1X5g5tjySArXotB//HEzp9qkoaKTyHxOarfLYkSXmho k0LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2BNe9rKXhY8MmWQX67o+G5gKAgLO+47b5LDxS9l4Meo=; b=J8G4c3Y2G3+e4qqbp9EwbQBAiLCFrxs8XuC/ol6+RZ35gNV5+3ak+aVEdnNc71xZmK bEZrxJHLI/eJsveURrUXC/g+nJ2NKldtde7WP7afeZn/IlA+KLE8WCqUdNVyhcoPW8Ye o8uYmrLvgNL7xpNdFUepE6cAwICGOMQIL60U08IEANv18hLYxc2KX61+bX1NfJnpFgRM b+yttGiYTdIA0CyTHfmSA1+BaU6eoSvzVg9r5wBQEfDIysej05hmJDCdoU/YuXkm/fOh 9YX3AA6AfWsFRjWEcVmKqp1gYkGGY7IfE8+KV3F7BaYj+ZI0RACLlX41Q0WdfVIPtH/a M7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=olyx2nDd; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si2098481jat.81.2021.07.08.05.29.20; Thu, 08 Jul 2021 05:29:32 -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=@gmail.com header.s=20161025 header.b=olyx2nDd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230493AbhGHM3Z (ORCPT + 99 others); Thu, 8 Jul 2021 08:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbhGHM3Z (ORCPT ); Thu, 8 Jul 2021 08:29:25 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFFC1C061574; Thu, 8 Jul 2021 05:26:42 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id b14-20020a1c1b0e0000b02901fc3a62af78so6567666wmb.3; Thu, 08 Jul 2021 05:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2BNe9rKXhY8MmWQX67o+G5gKAgLO+47b5LDxS9l4Meo=; b=olyx2nDd+kC70burfasIdtGB3O5hE3fqw3l3Tg1BcdWGpI9BUvAtoUbHTyhixSBrDa AHRa6CVMvdm+ROYzQeDNeLYkhb56HPeQ2tIS++yJ09jLKmJ+flmSbe7mEQnltNhX5MdR rlv+/L0RUYPRYX9zJVHvW0Iv/GHXqCqwwFNNyEOnVLjDo+dK2vajysrfs6cTlJy52fhv B0aKfjBKwtPtt5O1fMqDB/Z94RciRu7xqrHvMS3YzVtF266lmppQbGNZ9x/ZQHSPE87X H7Of6CkYFdKyHoDwxLdCkrHSvt6Dq0Q1XvLmp993Ynb5QBAgnKMpIp5mSf/iyTsSGG9f jzQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2BNe9rKXhY8MmWQX67o+G5gKAgLO+47b5LDxS9l4Meo=; b=PHOa6KwMK8WcoJZFz8+Ieg5XMl1FSCGg3hIm1sgE0xQwv2+/S0NeO92xfaNtnoz6gU MjcZCtlpFaeMbFsaJVN/YBs0RHvkF9wQasyia9UWTIOlN/wv41q/o0CCr3IGd6JbWMR/ RgiKSkTI3TONBaVKIIMqzh9+nrn7YGXfSu4cOfNOGkjnirPUuRIV/vyLyeL9oeCFdds3 cFoADrLnmZuC6023dpaL0EBzaTU1/PidfZVlzlyYEqOIIfdw6vJLm5cG4iIJz4tHgisx Oq716bZ02TUfULcjTe1SqmUcjyuSoQIAStHKHe2G8YQk2sxZazKIchL253BS1bPkelUi VSPg== X-Gm-Message-State: AOAM530xbdIq5sRQ+hAWCRI9frRP7IGGU9/PCUweLCRPDgYaX/h8ozVW YDIMcRnIeJMN8Sl84lu6FjKG18IHsTg= X-Received: by 2002:a05:600c:224a:: with SMTP id a10mr5073252wmm.7.1625747201217; Thu, 08 Jul 2021 05:26:41 -0700 (PDT) Received: from [10.0.0.3] ([37.165.6.154]) by smtp.gmail.com with ESMTPSA id s1sm9105516wmj.8.2021.07.08.05.26.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jul 2021 05:26:40 -0700 (PDT) Subject: Re: [PATCH v2] net: rtnetlink: Fix rtnl_dereference may be return NULL To: Vladimir Oltean , Johannes Berg Cc: Yajun Deng , "davem@davemloft.net" , "kuba@kernel.org" , "ryazanov.s.a@gmail.com" , "avagin@gmail.com" , "cong.wang@bytedance.com" , "roopa@cumulusnetworks.com" , "zhudi21@huawei.com" , "edumazet@google.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20210708092936.20044-1-yajun.deng@linux.dev> <3c160d187382677abe40606a6a88ddac0809c328.camel@sipsolutions.net> <20210708111118.kti4jprkz7bus62g@skbuf> From: Eric Dumazet Message-ID: <7e11f410-9a97-c7d8-ee6a-fa776a4d1f0e@gmail.com> Date: Thu, 8 Jul 2021 14:26:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210708111118.kti4jprkz7bus62g@skbuf> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/8/21 1:11 PM, Vladimir Oltean wrote: > On Thu, Jul 08, 2021 at 11:43:20AM +0200, Johannes Berg wrote: >> 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. > > Besides, isn't kfree_rcu(NULL) safe anyway? > Only from linux-5.3 I think. (commit 12edff045bc6dd3ab1565cc02fa4841803c2a633 was not backported to old kernels) But yes, this patch is not solving any bug, as I suspected.