Re: [PATCH v2 1/7] ata: don't keep pci_device_id

From: Niklas Cassel

Date: Tue Jun 30 2026 - 08:00:57 EST


Hello Gary,

On Tue, Jun 30, 2026 at 12:09:01PM +0100, Gary Guo wrote:
> pci_device_id is not guaranteed to live longer than probe due to presence
> of dynamic ID. All information apart from driver_data can be easily
> retrieved from pci_dev, so just store driver_data.
>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>

Please write a proper commit message.

The commit message should be detailed enough for someone to realize what
is going on without reading your cover-letter (as information in the cover
letter in not part of the accepted commit).

1) Explain how to reproduce.

2) Explain the problem.

3) Explain the consequences of the problem. UAF? Crash?

4) Explain how you fix it.


AFAICT, this is somehow related to pci_add_dynid(), which is called when
user-space is doing something like:

$ echo "vendor device" > /sys/bus/pci/drivers/your_driver/new_id


Kind regards,
Niklas