Skip to content

dm: simplify list ioctls

David Laight dm-devel lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dm: __list_versions(): Only process targets oncedrivers/md/dm-ioctl.c+29 -440 replies
2/3dm: list_devices(): Only process devices oncedrivers/md/dm-ioctl.c+40 -470 replies
3/3dm: lookup_ioctl(): Use designated array initialersdrivers/md/dm-ioctl.c+23 -240 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] dm: simplify list ioctls

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(-)
Signature · 1 line
2.39.5