<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/scsi/sg.c, branch linux-5.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-02-11T12:37:17Z</updated>
<entry>
<title>compat: scsi: sg: fix v3 compat read/write interface</title>
<updated>2020-02-11T12:37:17Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2019-12-04T08:35:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2b7195d43c63b6f20226b6f593db3416f80c227'/>
<id>urn:sha1:d2b7195d43c63b6f20226b6f593db3416f80c227</id>
<content type='text'>
commit 78ed001d9e7106171e0ee761cd854137dd731302 upstream.

In the v5.4 merge window, a cleanup patch from Al Viro conflicted
with my rework of the compat handling for sg.c read(). Linus Torvalds
did a correct merge but pointed out that the resulting code is still
unsatisfactory.

I later noticed that the sg_new_read() function still gets the compat
mode wrong, when the 'count' argument is large enough to pass a
compat_sg_io_hdr object, but not a nativ sg_io_hdr.

To address both of these, move the definition of compat_sg_io_hdr
into a scsi/sg.h to make it visible to sg.c and rewrite the logic
for reading req_pack_id as well as the size check to a simpler
version that gets the expected results.

Fixes: c35a5cfb4150 ("scsi: sg: sg_read(): simplify reading -&gt;pack_id of userland sg_io_hdr_t")
Fixes: 98aaaec4a150 ("compat_ioctl: reimplement SG_IO handling")
Reviewed-by: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2019-12-02T21:37:02Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2019-12-02T21:37:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef2cc88e2a205b8a11a19e78db63a70d3728cdf5'/>
<id>urn:sha1:ef2cc88e2a205b8a11a19e78db63a70d3728cdf5</id>
<content type='text'>
Pull SCSI updates from James Bottomley:
 "This is mostly update of the usual drivers: aacraid, ufs, zfcp,
  NCR5380, lpfc, qla2xxx, smartpqi, hisi_sas, target, mpt3sas, pm80xx
  plus a whole load of minor updates and fixes.

  The major core changes are Al Viro's reworking of sg's handling of
  copy to/from user, Ming Lei's removal of the host busy counter to
  avoid contention in the multiqueue case and Damien Le Moal's fixing of
  residual tracking across error handling"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (251 commits)
  scsi: bnx2fc: timeout calculation invalid for bnx2fc_eh_abort()
  scsi: target: core: Fix a pr_debug() argument
  scsi: iscsi: Don't send data to unbound connection
  scsi: target: iscsi: Wait for all commands to finish before freeing a session
  scsi: target: core: Release SPC-2 reservations when closing a session
  scsi: target: core: Document target_cmd_size_check()
  scsi: bnx2i: fix potential use after free
  Revert "scsi: qla2xxx: Fix memory leak when sending I/O fails"
  scsi: NCR5380: Add disconnect_mask module parameter
  scsi: NCR5380: Unconditionally clear ICR after do_abort()
  scsi: NCR5380: Call scsi_set_resid() on command completion
  scsi: scsi_debug: num_tgts must be &gt;= 0
  scsi: lpfc: use hdwq assigned cpu for allocation
  scsi: arcmsr: fix indentation issues
  scsi: qla4xxx: fix double free bug
  scsi: pm80xx: Modified the logic to collect fatal dump
  scsi: pm80xx: Tie the interrupt name to the module instance
  scsi: pm80xx: Controller fatal error through sysfs
  scsi: pm80xx: Do not request 12G sas speeds
  scsi: pm80xx: Cleanup command when a reset times out
  ...
</content>
</entry>
<entry>
<title>scsi: sg: sg_ioctl(): get rid of access_ok()</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1feefb7ec2fe11d666f6bdca6daa7affbf9c6ce9'/>
<id>urn:sha1:1feefb7ec2fe11d666f6bdca6daa7affbf9c6ce9</id>
<content type='text'>
simply not needed there - neither sg_new_read() nor sg_new_write() need
it.

Link: https://lore.kernel.org/r/20191017193925.25539-8-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_write(): get rid of access_ok()/__copy_from_user()/__get_user()</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a64e5a868573d6fe3b76e8d17538b10499239631'/>
<id>urn:sha1:a64e5a868573d6fe3b76e8d17538b10499239631</id>
<content type='text'>
Just use plain copy_from_user() and get_user().  Note that while a
buf-derived pointer gets stored into -&gt;dxferp, all places that actually use
the resulting value feed it either to import_iovec() or to
import_single_range(), and both will do validation.

Link: https://lore.kernel.org/r/20191017193925.25539-7-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_read(): get rid of access_ok()/__copy_..._user()</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8c12792d5fe11375af54c6bbbbebdda105eb933'/>
<id>urn:sha1:c8c12792d5fe11375af54c6bbbbebdda105eb933</id>
<content type='text'>
Use copy_..._user() instead, both in sg_read() and in sg_read_oxfer().  And
don't open-code memdup_user()...

Link: https://lore.kernel.org/r/20191017193925.25539-6-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_new_write(): don't bother with access_ok</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9fc5617bcb6f8278ffedd0f25bfbb697da5ca87'/>
<id>urn:sha1:d9fc5617bcb6f8278ffedd0f25bfbb697da5ca87</id>
<content type='text'>
... just use copy_from_user().  We copy only SZ_SG_IO_HDR bytes, so that
would, strictly speaking, loosen the check.  However, for call chains via
-&gt;write() the caller has actually checked the entire range and SG_IO passes
exactly SZ_SG_IO_HDR for count.  So no visible behaviour changes happen if
we check only what we really need for copyin.

Link: https://lore.kernel.org/r/20191017193925.25539-5-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_read(): simplify reading -&gt;pack_id of userland sg_io_hdr_t</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c35a5cfb41509c2214228aa321509ffd91cbf063'/>
<id>urn:sha1:c35a5cfb41509c2214228aa321509ffd91cbf063</id>
<content type='text'>
We don't need to allocate a temporary buffer and read the entire structure
in it, only to fetch a single field and free what we'd allocated.  Just use
get_user() and be done with it...

Link: https://lore.kernel.org/r/20191017193925.25539-4-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_write(): __get_user() can fail...</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=062c9d4527ccbdbf49139607efd44c9c3f82a2fd'/>
<id>urn:sha1:062c9d4527ccbdbf49139607efd44c9c3f82a2fd</id>
<content type='text'>
Link: https://lore.kernel.org/r/20191017193925.25539-3-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_new_write(): replace access_ok() + __copy_from_user() with copy_from_user()</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a62726cb9cb42b366f2af2c1951ae2fff66e2ad3'/>
<id>urn:sha1:a62726cb9cb42b366f2af2c1951ae2fff66e2ad3</id>
<content type='text'>
Link: https://lore.kernel.org/r/20191017193925.25539-2-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sg: sg_ioctl(): fix copyout handling</title>
<updated>2019-11-06T05:04:03Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2019-10-17T19:39:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a16a47416d3f4f78dd8766e3278459ead45d6193'/>
<id>urn:sha1:a16a47416d3f4f78dd8766e3278459ead45d6193</id>
<content type='text'>
First of all, __put_user() can fail with access_ok() succeeding.  And
access_ok() + __copy_to_user() is spelled copy_to_user()...

__put_user() *can* fail with access_ok() succeeding...

Link: https://lore.kernel.org/r/20191017193925.25539-1-viro@ZenIV.linux.org.uk
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
