mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ata: pata_parport: fix UAF on protocol module unload
@ 2026-09-08 11:47 Pei Xiao
  2026-09-08 11:47 ` [PATCH v2 1/2] ata: pata_parport: pin the protocol module before device_register() Pei Xiao
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pei Xiao @ 2026-09-08 11:47 UTC (permalink / raw)
  To: dlemoal, cassel, linux-ide, linux-kernel; +Cc: Pei Xiao

This series fixes use-after-free issues in pata_parport when a protocol
module goes away while pi_adapter devices created by it are still
attached.

Patch 1 pins the protocol module before the device becomes visible.
Previously try_module_get() ran after device_register(), so a forced
module unload in between left pi->proto dangling from the moment the
device appeared on the bus.

Patch 2 makes pata_parport_unregister_driver() tear down all adapters
using the protocol. Without this, the rollback path of a multi-protocol
module init (e.g. kbic registering k951 then k971) left the devices of
the already-registered protocol alive while the module loader freed the
module memory; removing such a dangling device later crashed in
pi_disconnect() dereferencing pi->proto->disconnect.

Pei Xiao (2):
  ata: pata_parport: pin the protocol module before device_register()
  ata: pata_parport: unregister devices on protocol unregister

 drivers/ata/pata_parport/pata_parport.c | 28 ++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-10 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08 11:47 [PATCH v2 0/2] ata: pata_parport: fix UAF on protocol module unload Pei Xiao
2026-09-08 11:47 ` [PATCH v2 1/2] ata: pata_parport: pin the protocol module before device_register() Pei Xiao
2026-09-08 11:47 ` [PATCH v2 2/2] ata: pata_parport: unregister devices on protocol unregister Pei Xiao
2026-09-09 10:52 ` [PATCH v2 0/2] ata: pata_parport: fix UAF on protocol module unload Niklas Cassel
2026-09-10 17:19   ` Niklas Cassel

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®