From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B92492DA775 for ; Thu, 7 May 2026 16:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778170038; cv=none; b=DBPoL5JZeJdSApCGKmcNAtCSSnITPandjnZto8XQo6wnkYoGtEzUeIApSO+3atHoaFDRTW80PHdPYfRDX9m6Twj587r/b8MApKymNgjStU3KFzhnr7aNe5LbnQye9C5uAIIz4p3y4ahmlYCNaxFQ7lvD+nIMeKdi2qWYL9Zc/SY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778170038; c=relaxed/simple; bh=eeWF4DW8Vtc+uCRa4YdosWQ2ENZOTVVpLyovPsGpCwA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XMAyjTgtvZ2CnJQALQf9bihX5n7CsjJz2b6a4JDS7l+jtk2iIIDoOWLWsYeiyhZfLrJZsEQS7lgpBeXljr9ylYAuMPUFQlE0GzV4KLWnHbxl2ubz0rWk1kzAUhpSTPGizMkhe53j3I+v9YoFlimgcgRCUuNtOHxONVxtyENmN3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mUM7c/a1; arc=none smtp.client-ip=209.85.160.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mUM7c/a1" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-50d6b9bca48so12204991cf.2 for ; Thu, 07 May 2026 09:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778170036; x=1778774836; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=H/8IlocfHpqcK267BzWvtEjiH9A/YesBMhn3EFEYzaY=; b=mUM7c/a1Nxte8IoelOKj25eaUu6Fw5vLLHevT+uF+FBmhaktsQcFhVn0mnYOlmfsco 8IQ91ONCXzdyqv0S9xFOmsGU0c+vbe+90WZRo1+npIQ8xxf/ffiFOlKF36W/qtI8Sw5l VTFMzAdKb41ol5HJzNn2M6FobK452W6wo1IVZLrTLnbgLUHjABNSwTZHyBQy5lZBrxfc G2VYJ6nlxQ45NLi7dk0eS+zcz4GUYWnSKA8Gjn89dEjhhD3+i7rgsOiNfVVB5TDb17Yb z6RlRHfeKrgZIIhYywRTUQ29Y6gmIdW9OJKxxrs7mTX3rsmMSfA1fW56Dqgq/Tfqgq6D XTlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778170036; x=1778774836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H/8IlocfHpqcK267BzWvtEjiH9A/YesBMhn3EFEYzaY=; b=gLq9SoH8KUbLUMI4ihzvwy4c8FxepLDkGlN9S0w5xcJ9yekMa2RZma1nHuvD9cWUY9 sslygYa9tFf/fGdXaCV7voY6qKaZXDzRYgJzWf9jV9TwXCYJDFaYjU9uXz3lka4aWWaG 8wzGkxzVIM1mMBA15u7uEK1OjteuN9X6uHTrsGvxgOt9820Fd1weHZOTO9zjIZwMIs/0 +8mWK3bMza8T6PHQRFmOKja+vikG/enCKVtOgjWD4qAOJNwhrG+eDMop+KvUZP6DpukH r14mXrgRnPFF2RaJy/gSMSnkTwh8Sshsu/MQc6z5HtMCyVIaMSxxo//W+xT9APkjd5O8 D4lA== X-Forwarded-Encrypted: i=1; AFNElJ8KBXedaFb/RqyaKRIIaRvTY2WXfP/4xbTr8EAuPq6T3bop3tXi2s0q8GZM683jKrKO1inOgcX6Lf+zkNk=@vger.kernel.org X-Gm-Message-State: AOJu0YzjkVUOG03J7/dwc3gWl+JLJpBoqvc9dMC8MXwgBDGo7uxLS1th nliQyVj8XC0qVhP7Kge0+qJPeo6Q4sOsyvH/sJYk61NaNqu1mBIirp48 X-Gm-Gg: AeBDiesrPJwpyvxjMon2qT1FKpyBHpEadmsS374AFXAuAxvIv/iTF7KXg14hy7Nv2su PXQHoi24zolPUul0CsZpAKPY/q3r+RY0sjpc1idHtFkzmsYuLlnUte3gQkyGPmSm5KsY9Wb+VqK UTHqltL8TLz5K1g/uFF+PZ+lApjDOMMOp/upQjOJMXvZtqnQBhQjsDntuBHUNe47p9x/nQ+yMSt OCxAMKg5FcvUNCtGCS/zsjYKVik0GO+wbzQfInaQDMf5byRn4sABLvY3roQdRYeADX3Oc0m6jAR eNoeAM9rX3w4NSGPSvl17JJA5FCLxNPsfk5vdNZsGyhJCt3H7WSw+bRlkGKHyYn1yjKPLckH2gy BehCCGG57HGuAu2kcRbtZLQ276RaM2724/rjItZJMpMkpUKP7/Anq6i4qxpg0oM0k3cJmiKjLmy NfS4IjIUV648sVmrRw1rGC3xLuocEhopJQqw/lmVB4EWP6xjM= X-Received: by 2002:ac8:5c88:0:b0:50f:c1d4:d9e1 with SMTP id d75a77b69052e-51461f9e37dmr119360191cf.38.1778170035651; Thu, 07 May 2026 09:07:15 -0700 (PDT) Received: from devvm29614.prn0.facebook.com ([2a03:2880:f800:2f::]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-514851141ebsm665421cf.13.2026.05.07.09.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 09:07:15 -0700 (PDT) Date: Thu, 7 May 2026 09:07:11 -0700 From: Bobby Eshleman To: Jakub Kicinski Cc: Paolo Abeni , Alexander Duyck , kernel-team@meta.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bobby Eshleman Subject: Re: [PATCH net v2] eth: fbnic: fix double-free of PCS on phylink creation failure Message-ID: References: <20260504-fbnic-pcs-fix-v2-1-de45192821d9@meta.com> <6cec0c03-5bdc-4131-9899-bc5c77fba198@redhat.com> <20260507072453.5eec7051@kernel.org> <20260507072954.263ae8dd@kernel.org> <20260507090127.285a5087@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260507090127.285a5087@kernel.org> On Thu, May 07, 2026 at 09:01:27AM -0700, Jakub Kicinski wrote: > On Thu, 7 May 2026 08:35:21 -0700 Bobby Eshleman wrote: > > > > fbd is a devlink priv, not netdev priv, touching it after free_netdev() > > > > is perfectly fine. I wish Gemini tried a *little* harder instead of > > > > guessing :| Sorry for not commenting earlier. > > > > > > Ugh, not enough coffee. It's complaining about MDIO reads, I think > > > that's valid. > > > > It is, but I think the race pre-exists. > > > > static int > > fbnic_mdio_read_pmd(struct fbnic_dev *fbd, int addr, int regnum) > > [...] > > if (fbd->netdev) { > > fbn = netdev_priv(fbd->netdev); > > if (fbn->aui < FBNIC_AUI_UNKNOWN) > > aui = fbn->aui; > > } > > > > > > Definitely possible that ->netdev gets freed concurrently with > > fbd->netdev evaluating to true... but fbnic_netdev_free() faces the same > > race. > > > > I'm open to fixing this all at once, if preferred. Probably need to look > > at some of the other fbnic_net ptr guards too. > > I agree with Paolo, seems separate. > > FWIW I think the fix may be to move the single aui field that mdio > cares about to fbd instead of fbn ? Feels like the problem is due > to a layering violation, mdio should not be touching fbn fields. SGTM. And I'll take a look at moving aui. Thanks, Bobby