Skip to content

floppy: suppress UBSAN warning in setup_rw_floppy()

Denis Efremov linux-block lkml 3 versions – Applied

Status from this message: Applied,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 6 repliesApplied
  2. v23 patches 7 repliesSuperseded
  3. v13 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- fix indentation in the second patch
- remove FD_RAW_REPLY_SIZE from print_hex_dump() in the third patch

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4floppy: use print_hex_dump() in setup_DMA()drivers/block/floppy.c+3 -61 reply
2/4floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_paramsdrivers/block/floppy.c include/uapi/linux/fd.h+9 -51 reply
3/4floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmddrivers/block/floppy.c include/uapi/linux/fd.h+17 -160 replies
4/4floppy: suppress UBSAN warning in setup_rw_floppy()drivers/block/floppy.c include/uapi/linux/fd.h+10 -50 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] floppy: suppress UBSAN warning in setup_rw_floppy()

These patches are based on Willy's cleanup patches
https://lkml.org/lkml/2020/3/31/609.

The first patch removes pr_cont() in setup_DMA() and prints the contents of cmd buffer with print_hex_dump(). The last patch also touches these lines and changes cmd buffer to fullcmd. The 2,3 patches introduce defines to make it more clear why cmd_count in struct floppy_raw_cmd allows out-of-bounds access for cmd, reply_count, reply fields. Last patch handles the warning.

There is the checkpatch warning because of the line length 81 > 80 in the definition of valid_floppy_drive_params(). This function intentionally uses autodetect[8] as argument to highlight that this is exactly the autodetect field from structs floppy_drive_params and compat_floppy_drive_params. I think that this warning is not a big problem since next function definition is 85 chars long and whole driver requires "restyling".

Changes in v3:
- fix indentation in the second patch
- remove FD_RAW_REPLY_SIZE from print_hex_dump() in the third patch

Changes in v2:
- add FD_RAW_CMD_FULLSIZE to the second patch
- add union with fullcmd to struct floppy_raw_cmd in the last patch

Denis Efremov (4):
floppy: use print_hex_dump() in setup_DMA()
floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params
floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmd
floppy: suppress UBSAN warning in setup_rw_floppy()

 drivers/block/floppy.c  | 39 ++++++++++++++-------------------------
 include/uapi/linux/fd.h | 26 ++++++++++++++++++++++----
 2 files changed, 36 insertions(+), 29 deletions(-)
Signature · 1 line
2.25.3