linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Efremov <efremov@linux.com>
To: linux-block@vger.kernel.org
Cc: Denis Efremov <efremov@linux.com>, Willy Tarreau <w@1wt.eu>,
	Christoph Hellwig <hch@infradead.org>,
	Joe Perches <joe@perches.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/4] floppy: suppress UBSAN warning in setup_rw_floppy()
Date: Fri,  1 May 2020 16:44:12 +0300	[thread overview]
Message-ID: <20200501134416.72248-1-efremov@linux.com> (raw)

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(-)

-- 
2.25.3


             reply	other threads:[~2020-05-01 13:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 13:44 Denis Efremov [this message]
2020-05-01 13:44 ` [PATCH v3 1/4] floppy: use print_hex_dump() in setup_DMA() Denis Efremov
2020-05-01 15:35   ` Christoph Hellwig
2020-05-01 13:44 ` [PATCH v3 2/4] floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params Denis Efremov
2020-05-01 15:36   ` Christoph Hellwig
2020-05-01 13:44 ` [PATCH v3 3/4] floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmd Denis Efremov
2020-05-01 13:44 ` [PATCH v3 4/4] floppy: suppress UBSAN warning in setup_rw_floppy() Denis Efremov
2020-05-01 18:02 ` [PATCH v3 0/4] " Joe Perches
2020-05-01 18:22   ` Denis Efremov
2020-05-01 18:31     ` Joe Perches
2020-05-06  7:33 ` Denis Efremov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200501134416.72248-1-efremov@linux.com \
    --to=efremov@linux.com \
    --cc=hch@infradead.org \
    --cc=joe@perches.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).