Re: [PATCH] PCI/sysfs: NULL res_attr slot after kfree as defence against double-remove
From: Gianfranco Dutka
Date: Wed May 20 2026 - 18:54:34 EST
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