From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f228.google.com (mail-qt1-f228.google.com [209.85.160.228]) (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 2D90E313293 for ; Wed, 20 May 2026 22:45:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779317152; cv=none; b=AGXlzO1UKiYrEI8EYIXokhvx1d55l+mwCbpjV+7Viq4AqPiQlc8TDL/W95Nyr0Xv0eCDuCLrTN9DF6Tuey8AXCXNaz0aE3vw5ogQrddu73J1kR5TN6Au0hnIvNRzOI+6NZecUGqfQWQxhWV+XoHiXdNXi8lOGBNj8gU3/Jwijs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779317152; c=relaxed/simple; bh=NL1DLuFEKLwlX611De6uZFVhrhG8WqHFPsk3nbBe+3g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References; b=hP/DZCseVvWHd6co1FDiJX+KNK+AduAeO2GEZcv4rsb8BaNcTYsbN1l0j7EEMGR1/sADIiJkPDw+2ZfKI3fqHjWgCcWzZywY62nD81o/tEWwMM6na4FatClkdM3AXnWrrrEywZCWWYp8BquMBfI4g6tObV6LxQXVgLmycGxNR6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=arista.com; spf=pass smtp.mailfrom=arista.com; dkim=pass (2048-bit key) header.d=arista.com header.i=@arista.com header.b=YRWbe3Pq; arc=none smtp.client-ip=209.85.160.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=arista.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arista.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arista.com header.i=@arista.com header.b="YRWbe3Pq" Received: by mail-qt1-f228.google.com with SMTP id d75a77b69052e-50e5bea4045so41285201cf.3 for ; Wed, 20 May 2026 15:45:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779317150; x=1779921950; h=content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0ikrSU9XktaZzVYO+3LJLhuj5lBGwDhqjYZ9LS64/4I=; b=jSymQ0Bt2+df+/Z4SCAWwFQHpJfRjNxaUhnEq5ZIRLweJt840GMzG/JT2bKH5Ix/1g rmAFzDKyZ/l9QMFdCP/PCdlGw+YZhgXHGwbygtONFmLfeMpyWtXaudDEVfx22gIFOu/7 fKkoz8qUlQtLmdYmkxb6JtHVrbqV1B4SrRyWnR+b5XZ2WIGlsMfzxD/ANUFdGA509NTH WLvUmHKV9haksTdotljbhnA9UHCOegqcajhh+CuyZZmB72+3tqrRUfg9KdbvWQZXpXmO zszYSF4jH8V8PKj6LHbBGgK4j5MhOLmCSVjjjWEd2rJgk9pDVFZKuebjyIpfthI4U1n0 zlhA== X-Forwarded-Encrypted: i=1; AFNElJ/fu0xGyC4bSEzizwjAuNivAsrHXbdq0Nb2tj96o2fnZL/F894/HMZla/wn6JHIKArVBvW4AqLiWBoAbLE=@vger.kernel.org X-Gm-Message-State: AOJu0YwCvR/NX1+4qHnG6cqpL4TNYIjsWxycHkbSCpmGWr75CPlvi/Hv iY41Y1oI4dKs/iHrqwDVpkNQJiCmp6XQbRViWHd4ZEL3lxHXxFA34aL5zD3b1NQBS/7qu50DB4D fFc7d+yvA2ebP/if5cFmnz/+UI+2NntK2wg== X-Gm-Gg: Acq92OFoAKhFRKpl4FoVPEOK76REixLEDzEi9Izg/WAKHBS7CxergI+RT+XtIbTMb0L 7KWwrBtasuTZHm0FzWEWatQIQLMCI+QZK5gGPntWB86VM+/A95o1ypLY5dvsSUv73quPNbEtxQ0 LhOs5FaktBbXXe1GdhxJwuTtUkWBpm8dtvQ8HKwJZAZnyKYTxzaa2CrC9yZXNyOXtOD7YZ9AEjT YLW0oYPtc/cRVwS/EtXCYwqwfndf1qb3pv3cxssaP0tMW0HyDiJi3sRxBv7YtM9AmccKMviZgm2 cSdb9Cp5F//YvK2Z1FGfMlh3Oooy5YT27SaCi47b5Oy5hwv3XeDqiLjS1tDWqExuUDKiWjv9R+I fyvOL8SQKn6/VOg2Xo7+sYfTwYl8xnp1c2qz+AbnGTueQ X-Received: by 2002:a05:622a:512:b0:510:141d:9d03 with SMTP id d75a77b69052e-516c544a603mr6986401cf.7.1779317150070; Wed, 20 May 2026 15:45:50 -0700 (PDT) Received: from smtp.aristanetworks.com ([74.123.28.25]) by smtp-relay.gmail.com with ESMTPS id 6a1803df08f44-8ca361896bdsm10753296d6.21.2026.05.20.15.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 15:45:50 -0700 (PDT) X-Relaying-Domain: arista.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=Arista-A; t=1779317149; bh=0ikrSU9XktaZzVYO+3LJLhuj5lBGwDhqjYZ9LS64/4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YRWbe3PqxTnFYmIgjr++Pr9fc9OzNzYSt6BUETEzVT3CurIFVtVJsAJhzOP+t8/KL yhPbtbjDf6W7PsR9ijEOS8hFwpzveqO/zR3fJKzN4vMU44hmsrNunbtMc6KlmwW8NS endWgVqpNgfns5S08cyk0EBpR8yrRPaRpvOUPxxEDKzmIWN5GzhmZrDgywsmJpaUAG cQZnLjxu3v4Q0oZKVrWC4amr2hx0austHmwbbOlHUpftZh6VxjUcPDFIr5G08fBhix UwLCdstd0xLOIl/yNrGumqLIu+vu3bUmBN/LnYSIa4tpeYCyGiJrke2MatjMySxbC5 eeNBOOIOF+jwg== Received: from gianfranco-dutka-usb-uas.sjc.aristanetworks.com (dhcp-224-35-225.sjc.aristanetworks.com [10.224.35.225]) by smtp.aristanetworks.com (Postfix) with ESMTP id 33AC5100607; Wed, 20 May 2026 22:45:49 +0000 (UTC) X-SMTP-Authentication: Allow-List-permitted X-SMTP-Authentication: Allow-List-permitted From: Gianfranco Dutka To: Bjorn Helgaas Cc: Gianfranco Dutka , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/sysfs: NULL res_attr slot after kfree as defence against double-remove Date: Wed, 20 May 2026 15:45:49 -0700 Message-ID: <20260520224549.3304374-1-gianfranco.dutka@arista.com> In-Reply-To: <20260520211306.3301893-1-gianfranco.dutka@arista.com> References: <20260520211306.3301893-1-gianfranco.dutka@arista.com> Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Thanks for the review. Both findings concern code paths I have not independently debugged or reproduced, so I do not want to confirm or refute them as bugs from the sender side of this patch -- that is for the PCI maintainers and, in the alpha case, the alpha maintainers to judge. What I can say about this patch: it is intentionally defence-in-depth, not a fix for the concurrency window or for the alpha allocation pattern. The read-then-NULL it adds is not atomic, so if pci_remove_resource_files() is genuinely reachable from two threads concurrently then this patch does not close that window. And the patch makes no change to how the two pointers are freed, so if those pointers do alias the same allocation on alpha then this patch does not change the underlying free behaviour either. For this patch itself I am happy with any of: - merge as-is for defence-in-depth, and let the issues raised in review be addressed (or not) in separate work, - hold it pending a proper fix for whichever of those issues you consider blocking, - NACK if you would rather not carry a NULL-after-free that does not address the underlying concerns. Whichever you prefer. Thanks, Gianfranco