The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] dm: simplify list ioctls
@ 2026-06-24 14:52 David Laight
  2026-06-24 14:52 ` [PATCH 1/3] dm: __list_versions(): Only process targets once David Laight
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Laight @ 2026-06-24 14:52 UTC (permalink / raw)
  To: Mikulas Patocka, Tony Asleson, Bryn M . Reeves, Alasdair Kergon,
	Mike Snitzer, Benjamin Marzinski, dm-devel, linux-kernel
  Cc: David Laight

Scanning for poossibly unbounded strlen() found the device/disk
manager ioctls that do a double scan of the data to check whether
the caller supplied buffer is large enough, and then to fill it.

If the buffer is too small the required size isn't returned.

So simplify everything and make it all less likely to overrun
the kernel buffer (copied back to user later) if anything changes
between the scans.

I managed a minimal test that the ioctls still work.

David Laight (3):
  dm: __list_versions(): Only process targets once
  dm: list_devices(): Only process devices once
  dm: lookup_ioctl(): Use designated array initialers

 drivers/md/dm-ioctl.c | 207 +++++++++++++++++++-----------------------
 1 file changed, 92 insertions(+), 115 deletions(-)

-- 
2.39.5


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

end of thread, other threads:[~2026-06-24 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 14:52 [PATCH 0/3] dm: simplify list ioctls David Laight
2026-06-24 14:52 ` [PATCH 1/3] dm: __list_versions(): Only process targets once David Laight
2026-06-24 14:52 ` [PATCH 2/3] dm: list_devices(): Only process devices once David Laight
2026-06-24 14:52 ` [PATCH 3/3] dm: lookup_ioctl(): Use designated array initialers David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox