mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gianfranco Dutka <gianfranco.dutka@arista.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Gianfranco Dutka <gianfranco.dutka@arista.com>,
	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	[thread overview]
Message-ID: <20260520224549.3304374-1-gianfranco.dutka@arista.com> (raw)
In-Reply-To: <20260520211306.3301893-1-gianfranco.dutka@arista.com>

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

  reply	other threads:[~2026-05-20 22:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 21:13 Gianfranco Dutka
2026-05-20 22:45 ` Gianfranco Dutka [this message]
2026-05-21 11:54   ` Krzysztof Wilczyński
2026-05-21 10:22 ` Ilpo Järvinen
2026-05-21 12:01   ` Krzysztof Wilczyński
2026-05-21 12:04     ` Ilpo Järvinen
2026-05-21 11:59 ` Krzysztof Wilczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260520224549.3304374-1-gianfranco.dutka@arista.com \
    --to=gianfranco.dutka@arista.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®