<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block/floppy.c, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-07-18T15:43:20Z</updated>
<entry>
<title>Merge branch 'floppy'</title>
<updated>2019-07-18T15:43:20Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-07-18T15:43:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=47d6a7607443ea43dbc4d0f371bf773540a8f8f4'/>
<id>urn:sha1:47d6a7607443ea43dbc4d0f371bf773540a8f8f4</id>
<content type='text'>
Merge floppy ioctl verification fixes from Denis Efremov.

This also marks the floppy driver as orphaned - it turns out that Jiri
no longer has working hardware.

Actual working physical floppy hardware is getting hard to find, and
while Willy was able to test this, I think the driver can be considered
pretty much dead from an actual hardware standpoint.  The hardware that
is still sold seems to be mainly USB-based, which doesn't use this
legacy driver at all.

The old floppy disk controller is still emulated in various VM
environments, so the driver isn't going away, but let's see if anybody
is interested to step up to maintain it.

The lack of hardware also likely means that the ioctl range verification
fixes are probably mostly relevant to anybody using floppies in a
virtual environment.  Which is probably also going away in favor of USB
storage emulation, but who knows.

Will Decon reviewed the patches but I'm not rebasing them just for that,
so I'll add a

  Reviewed-by: Will Deacon &lt;will@kernel.org&gt;

here instead.

* floppy:
  MAINTAINERS: mark floppy.c orphaned
  floppy: fix out-of-bounds read in copy_buffer
  floppy: fix invalid pointer dereference in drive_name
  floppy: fix out-of-bounds read in next_valid_format
  floppy: fix div-by-zero in setup_format_params
</content>
</entry>
<entry>
<title>floppy: fix out-of-bounds read in copy_buffer</title>
<updated>2019-07-17T21:45:50Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@ispras.ru</email>
</author>
<published>2019-07-12T18:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=da99466ac243f15fbba65bd261bfc75ffa1532b6'/>
<id>urn:sha1:da99466ac243f15fbba65bd261bfc75ffa1532b6</id>
<content type='text'>
This fixes a global out-of-bounds read access in the copy_buffer
function of the floppy driver.

The FDDEFPRM ioctl allows one to set the geometry of a disk.  The sect
and head fields (unsigned int) of the floppy_drive structure are used to
compute the max_sector (int) in the make_raw_rw_request function.  It is
possible to overflow the max_sector.  Next, max_sector is passed to the
copy_buffer function and used in one of the memcpy calls.

An unprivileged user could trigger the bug if the device is accessible,
but requires a floppy disk to be inserted.

The patch adds the check for the .sect * .head multiplication for not
overflowing in the set_geometry function.

The bug was found by syzkaller.

Signed-off-by: Denis Efremov &lt;efremov@ispras.ru&gt;
Tested-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>floppy: fix invalid pointer dereference in drive_name</title>
<updated>2019-07-17T21:45:50Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@ispras.ru</email>
</author>
<published>2019-07-12T18:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9b04609b784027968348796a18f601aed9db3789'/>
<id>urn:sha1:9b04609b784027968348796a18f601aed9db3789</id>
<content type='text'>
This fixes the invalid pointer dereference in the drive_name function of
the floppy driver.

The native_format field of the struct floppy_drive_params is used as
floppy_type array index in the drive_name function.  Thus, the field
should be checked the same way as the autodetect field.

To trigger the bug, one could use a value out of range and set the drive
parameters with the FDSETDRVPRM ioctl.  Next, FDGETDRVTYP ioctl should
be used to call the drive_name.  A floppy disk is not required to be
inserted.

CAP_SYS_ADMIN is required to call FDSETDRVPRM.

The patch adds the check for a value of the native_format field to be in
the '0 &lt;= x &lt; ARRAY_SIZE(floppy_type)' range of the floppy_type array
indices.

The bug was found by syzkaller.

Signed-off-by: Denis Efremov &lt;efremov@ispras.ru&gt;
Tested-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>floppy: fix out-of-bounds read in next_valid_format</title>
<updated>2019-07-17T21:45:49Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@ispras.ru</email>
</author>
<published>2019-07-12T18:55:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5635f897ed83fd539df78e98ba69ee91592f9bb8'/>
<id>urn:sha1:5635f897ed83fd539df78e98ba69ee91592f9bb8</id>
<content type='text'>
This fixes a global out-of-bounds read access in the next_valid_format
function of the floppy driver.

The values from autodetect field of the struct floppy_drive_params are
used as indices for the floppy_type array in the next_valid_format
function 'floppy_type[DP-&gt;autodetect[probed_format]].sect'.

To trigger the bug, one could use a value out of range and set the drive
parameters with the FDSETDRVPRM ioctl.  A floppy disk is not required to
be inserted.

CAP_SYS_ADMIN is required to call FDSETDRVPRM.

The patch adds the check for values of the autodetect field to be in the
'0 &lt;= x &lt; ARRAY_SIZE(floppy_type)' range of the floppy_type array indices.

The bug was found by syzkaller.

Signed-off-by: Denis Efremov &lt;efremov@ispras.ru&gt;
Tested-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>floppy: fix div-by-zero in setup_format_params</title>
<updated>2019-07-17T21:45:49Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@ispras.ru</email>
</author>
<published>2019-07-12T18:55:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3554aeb991214cbfafd17d55e2bfddb50282e32'/>
<id>urn:sha1:f3554aeb991214cbfafd17d55e2bfddb50282e32</id>
<content type='text'>
This fixes a divide by zero error in the setup_format_params function of
the floppy driver.

Two consecutive ioctls can trigger the bug: The first one should set the
drive geometry with such .sect and .rate values for the F_SECT_PER_TRACK
to become zero.  Next, the floppy format operation should be called.

A floppy disk is not required to be inserted.  An unprivileged user
could trigger the bug if the device is accessible.

The patch checks F_SECT_PER_TRACK for a non-zero value in the
set_geometry function.  The proper check should involve a reasonable
upper limit for the .sect and .rate fields, but it could change the
UAPI.

The patch also checks F_SECT_PER_TRACK in the setup_format_params, and
cancels the formatting operation in case of zero.

The bug was found by syzkaller.

Signed-off-by: Denis Efremov &lt;efremov@ispras.ru&gt;
Tested-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>docs: blockdev: add it to the admin-guide</title>
<updated>2019-07-15T14:03:01Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-06-18T14:47:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7751617dd0599ceadf4221cb08e04307b00aa1f'/>
<id>urn:sha1:e7751617dd0599ceadf4221cb08e04307b00aa1f</id>
<content type='text'>
The blockdev book basically contains user-faced documentation.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
</content>
</entry>
<entry>
<title>docs: blockdev: convert to ReST</title>
<updated>2019-07-15T12:20:26Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-04-18T20:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=39443104c7d3f2b05a4a330fbcef6da68f80d60b'/>
<id>urn:sha1:39443104c7d3f2b05a4a330fbcef6da68f80d60b</id>
<content type='text'>
Rename the blockdev documentation files to ReST, add an
index for them and adjust in order to produce a nice html
output via the Sphinx build system.

The drbd sub-directory contains some graphs and data flows.
Add those too to the documentation.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
</content>
</entry>
<entry>
<title>floppy: fix harmless clang build warning</title>
<updated>2019-06-20T07:36:21Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2019-06-19T13:19:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2af47c10e80baf91cff56c44cec47402e05ac45c'/>
<id>urn:sha1:2af47c10e80baf91cff56c44cec47402e05ac45c</id>
<content type='text'>
clang warns about unusual code in floppy.c that looks like it
was intended to be a bit mask operation, checking for a specific
bit in the UDP-&gt;cmos variable (FLOPPY1_TYPE expands to '4' on
ARM):

drivers/block/floppy.c:3902:17: error: use of logical '&amp;&amp;' with constant operand [-Werror,-Wconstant-logical-operand]
        if (!UDP-&gt;cmos &amp;&amp; FLOPPY1_TYPE)
                       ^  ~~~~~~~~~~~~
drivers/block/floppy.c:3902:17: note: use '&amp;' for a bitwise operation
        if (!UDP-&gt;cmos &amp;&amp; FLOPPY1_TYPE)

The check here is redundant anyway, if FLOPPY1_TYPE is zero, then
assigning it to a zero UDP-&gt;cmos field does not change anything,
so removing the extra check here has no effect other than shutting
up the warning.

On x86, this will no longer read a hardware register, as the
FLOPPY1_TYPE macro is not expanded if UDP-&gt;cmos is already
zero, but the result is the same.

Cc: Robert Elliott &lt;elliott@hpe.com&gt;
Cc: Keith Busch &lt;kbusch@kernel.org&gt;
Link: https://patchwork.kernel.org/patch/10851841/
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier for more missed files</title>
<updated>2019-05-21T08:50:45Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-19T12:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09c434b8a0047c69e48499de0107de312901e798'/>
<id>urn:sha1:09c434b8a0047c69e48499de0107de312901e798</id>
<content type='text'>
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have MODULE_LICENCE("GPL*") inside which was used in the initial
   scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-5.2/block-20190507' of git://git.kernel.dk/linux-block</title>
<updated>2019-05-08T01:14:36Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-05-08T01:14:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67a242223958d628f0ba33283668e3ddd192d057'/>
<id>urn:sha1:67a242223958d628f0ba33283668e3ddd192d057</id>
<content type='text'>
Pull block updates from Jens Axboe:
 "Nothing major in this series, just fixes and improvements all over the
  map. This contains:

   - Series of fixes for sed-opal (David, Jonas)

   - Fixes and performance tweaks for BFQ (via Paolo)

   - Set of fixes for bcache (via Coly)

   - Set of fixes for md (via Song)

   - Enabling multi-page for passthrough requests (Ming)

   - Queue release fix series (Ming)

   - Device notification improvements (Martin)

   - Propagate underlying device rotational status in loop (Holger)

   - Removal of mtip32xx trim support, which has been disabled for years
     (Christoph)

   - Improvement and cleanup of nvme command handling (Christoph)

   - Add block SPDX tags (Christoph)

   - Cleanup/hardening of bio/bvec iteration (Christoph)

   - A few NVMe pull requests (Christoph)

   - Removal of CONFIG_LBDAF (Christoph)

   - Various little fixes here and there"

* tag 'for-5.2/block-20190507' of git://git.kernel.dk/linux-block: (164 commits)
  block: fix mismerge in bvec_advance
  block: don't drain in-progress dispatch in blk_cleanup_queue()
  blk-mq: move cancel of hctx-&gt;run_work into blk_mq_hw_sysfs_release
  blk-mq: always free hctx after request queue is freed
  blk-mq: split blk_mq_alloc_and_init_hctx into two parts
  blk-mq: free hw queue's resource in hctx's release handler
  blk-mq: move cancel of requeue_work into blk_mq_release
  blk-mq: grab .q_usage_counter when queuing request from plug code path
  block: fix function name in comment
  nvmet: protect discovery change log event list iteration
  nvme: mark nvme_core_init and nvme_core_exit static
  nvme: move command size checks to the core
  nvme-fabrics: check more command sizes
  nvme-pci: check more command sizes
  nvme-pci: remove an unneeded variable initialization
  nvme-pci: unquiesce admin queue on shutdown
  nvme-pci: shutdown on timeout during deletion
  nvme-pci: fix psdt field for single segment sgls
  nvme-multipath: don't print ANA group state by default
  nvme-multipath: split bios with the ns_head bio_set before submitting
  ...
</content>
</entry>
</feed>
