<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/storage, branch v6.7</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=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-12-15T13:00:58Z</updated>
<entry>
<title>usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3</title>
<updated>2023-12-15T13:00:58Z</updated>
<author>
<name>Tasos Sahanidis</name>
<email>tasos@tasossah.com</email>
</author>
<published>2023-12-07T13:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=772685c14743ad565bb271041ad3c262298cd6fc'/>
<id>urn:sha1:772685c14743ad565bb271041ad3c262298cd6fc</id>
<content type='text'>
This flash drive reports write protect during the first mode sense.

In the past this was not an issue as the kernel called revalidate twice,
thus asking the device for its write protect status twice, with write
protect being disabled in the second mode sense.

However, since commit 1e029397d12f ("scsi: sd: Reorganize DIF/DIX code to
avoid calling revalidate twice") that is no longer the case, thus the
device shows up read only.

[490891.289495] sd 12:0:0:0: [sdl] Write Protect is on
[490891.289497] sd 12:0:0:0: [sdl] Mode Sense: 2b 00 80 08

This does not appear to be a timing issue, as enabling the usbcore quirk
USB_QUIRK_DELAY_INIT has no effect on write protect.

Fixes: 1e029397d12f ("scsi: sd: Reorganize DIF/DIX code to avoid calling revalidate twice")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Tasos Sahanidis &lt;tasos@tasossah.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20231207134441.298131-1-tasos@tasossah.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility</title>
<updated>2023-10-28T10:23:41Z</updated>
<author>
<name>LihaSika</name>
<email>lihasika@gmail.com</email>
</author>
<published>2023-10-27T17:28:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e3139e6543b241b3e65956a55c712333bef48ac'/>
<id>urn:sha1:0e3139e6543b241b3e65956a55c712333bef48ac</id>
<content type='text'>
Change lower bcdDevice value for "Super Top USB 2.0  SATA BRIDGE" to match
1.50. I have such an older device with bcdDevice=1.50 and it will not work
otherwise.

Cc: stable@vger.kernel.org
Signed-off-by: Liha Sikanen &lt;lihasika@gmail.com&gt;
Link: https://lore.kernel.org/r/ccf7d12a-8362-4916-b3e0-f4150f54affd@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb-storage,uas: make internal quirks flags 64bit</title>
<updated>2023-10-21T10:45:14Z</updated>
<author>
<name>Milan Broz</name>
<email>gmazyland@gmail.com</email>
</author>
<published>2023-10-16T07:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d181b34bd381b336558fc5d5100ee13063eb6bac'/>
<id>urn:sha1:d181b34bd381b336558fc5d5100ee13063eb6bac</id>
<content type='text'>
Switch internal usb-storage quirk value to 64-bit as quirks currently
use all 32 bits.

Signed-off-by: Milan Broz &lt;gmazyland@gmail.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20231016072604.40179-3-gmazyland@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb-storage: remove UNUSUAL_VENDOR_INTF macro</title>
<updated>2023-10-21T10:44:07Z</updated>
<author>
<name>Milan Broz</name>
<email>gmazyland@gmail.com</email>
</author>
<published>2023-10-16T07:25:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=35b62f6f582264ed681a7f159e9ffca08a0f5edd'/>
<id>urn:sha1:35b62f6f582264ed681a7f159e9ffca08a0f5edd</id>
<content type='text'>
This patch removes macro that was used only by commit that was reverted
in commit ab4b71644a26 ("USB: storage: fix Huawei mode switching
regression")

Signed-off-by: Milan Broz &lt;gmazyland@gmail.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20231016072604.40179-2-gmazyland@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb-storage: alauda: Fix uninit-value in alauda_check_media()</title>
<updated>2023-08-04T12:57:16Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2023-08-02T17:49:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a6ff6e7a9dd69364547751db0f626a10a6d628d2'/>
<id>urn:sha1:a6ff6e7a9dd69364547751db0f626a10a6d628d2</id>
<content type='text'>
Syzbot got KMSAN to complain about access to an uninitialized value in
the alauda subdriver of usb-storage:

BUG: KMSAN: uninit-value in alauda_transport+0x462/0x57f0
drivers/usb/storage/alauda.c:1137
CPU: 0 PID: 12279 Comm: usb-storage Not tainted 5.3.0-rc7+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x191/0x1f0 lib/dump_stack.c:113
  kmsan_report+0x13a/0x2b0 mm/kmsan/kmsan_report.c:108
  __msan_warning+0x73/0xe0 mm/kmsan/kmsan_instr.c:250
  alauda_check_media+0x344/0x3310 drivers/usb/storage/alauda.c:460

The problem is that alauda_check_media() doesn't verify that its USB
transfer succeeded before trying to use the received data.  What
should happen if the transfer fails isn't entirely clear, but a
reasonably conservative approach is to pretend that no media is
present.

A similar problem exists in a usb_stor_dbg() call in
alauda_get_media_status().  In this case, when an error occurs the
call is redundant, because usb_stor_ctrl_transfer() already will print
a debugging message.

Finally, unrelated to the uninitialized memory access, is the fact
that alauda_check_media() performs DMA to a buffer on the stack.
Fortunately usb-storage provides a general purpose DMA-able buffer for
uses like this.  We'll use it instead.

Reported-and-tested-by: syzbot+e7d46eb426883fb97efd@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/0000000000007d25ff059457342d@google.com/T/
Suggested-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support")
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/693d5d5e-f09b-42d0-8ed9-1f96cd30bcce@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb-storage: fix deadlock when a scsi command timeouts more than once</title>
<updated>2023-05-13T09:53:03Z</updated>
<author>
<name>Maxime Bizon</name>
<email>mbizon@freebox.fr</email>
</author>
<published>2023-05-05T11:47:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a398d5eac6984316e71474e25b975688f282379b'/>
<id>urn:sha1:a398d5eac6984316e71474e25b975688f282379b</id>
<content type='text'>
With faulty usb-storage devices, read/write can timeout, in that case
the SCSI layer will abort and re-issue the command. USB storage has no
internal timeout, it relies on SCSI layer aborting commands via
.eh_abort_handler() for non those responsive devices.

After two consecutive timeouts of the same command, SCSI layer calls
.eh_device_reset_handler(), without calling .eh_abort_handler() first.

With usb-storage, this causes a deadlock:

  -&gt; .eh_device_reset_handler
    -&gt; device_reset
      -&gt; mutex_lock(&amp;(us-&gt;dev_mutex));

mutex already by usb_stor_control_thread(), which is waiting for
command completion:

  -&gt; usb_stor_control_thread (mutex taken here)
    -&gt; usb_stor_invoke_transport
      -&gt; usb_stor_Bulk_transport
        -&gt; usb_stor_bulk_srb
	  -&gt; usb_stor_bulk_transfer_sglist
	    -&gt; usb_sg_wait

Make sure we cancel any pending command in .eh_device_reset_handler()
to avoid this.

Signed-off-by: Maxime Bizon &lt;mbizon@freebox.fr&gt;
Cc: linux-usb@vger.kernel.org
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/all/ZEllnjMKT8ulZbJh@sakura/
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20230505114759.1189741-1-mbizon@freebox.fr
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>2023-04-26T22:39:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-04-26T22:39:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b68ee1c6131c540a62ecd443be89c406401df091'/>
<id>urn:sha1:b68ee1c6131c540a62ecd443be89c406401df091</id>
<content type='text'>
Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (megaraid_sas, scsi_debug, lpfc, target,
  mpi3mr, hisi_sas, arcmsr).

  The major core change is the constification of the host templates
  (which touches everything) along with other minor fixups and clean
  ups"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (207 commits)
  scsi: ufs: mcq: Use pointer arithmetic in ufshcd_send_command()
  scsi: ufs: mcq: Annotate ufshcd_inc_sq_tail() appropriately
  scsi: cxlflash: s/semahpore/semaphore/
  scsi: lpfc: Silence an incorrect device output
  scsi: mpi3mr: Use IRQ save variants of spinlock to protect chain frame allocation
  scsi: scsi_debug: Fix missing error code in scsi_debug_init()
  scsi: hisi_sas: Work around build failure in suspend function
  scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup()
  scsi: mpt3sas: Fix an issue when driver is being removed
  scsi: mpt3sas: Remove HBA BIOS version in the kernel log
  scsi: target: core: Fix invalid memory access
  scsi: scsi_debug: Drop sdebug_queue
  scsi: scsi_debug: Only allow sdebug_max_queue be modified when no shosts
  scsi: scsi_debug: Use scsi_host_busy() in delay_store() and ndelay_store()
  scsi: scsi_debug: Use blk_mq_tagset_busy_iter() in stop_all_queued()
  scsi: scsi_debug: Use blk_mq_tagset_busy_iter() in sdebug_blk_mq_poll()
  scsi: scsi_debug: Dynamically allocate sdebug_queued_cmd
  scsi: scsi_debug: Use scsi_block_requests() to block queues
  scsi: scsi_debug: Protect block_unblock_all_queues() with mutex
  scsi: scsi_debug: Change shost list lock to a mutex
  ...
</content>
</entry>
<entry>
<title>scsi: usb: uas: Declare two host templates and host template pointers const</title>
<updated>2023-03-24T23:20:00Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2023-03-22T19:55:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=04d1fa4346ccedde68886a4d5a0003f3a322467b'/>
<id>urn:sha1:04d1fa4346ccedde68886a4d5a0003f3a322467b</id>
<content type='text'>
Improve source code documentation by constifying host templates that are
not modified.

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt; (for usb-storage)
Acked-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: linux-usb@vger.kernel.org
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20230322195515.1267197-81-bvanassche@acm.org
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS583Gen 2</title>
<updated>2023-03-16T11:44:17Z</updated>
<author>
<name>Yaroslav Furman</name>
<email>yaro330@gmail.com</email>
</author>
<published>2023-03-12T09:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a37eb61b6ec064ac794b8a1e89fd33eb582fe51d'/>
<id>urn:sha1:a37eb61b6ec064ac794b8a1e89fd33eb582fe51d</id>
<content type='text'>
Just like other JMicron JMS5xx enclosures, it chokes on report-opcodes,
let's avoid them.

Signed-off-by: Yaroslav Furman &lt;yaro330@gmail.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/20230312090745.47962-1-yaro330@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: ene_usb6250: Allocate enough memory for full object</title>
<updated>2023-02-06T12:46:42Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2023-02-04T18:35:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce33e64c1788912976b61314b56935abd4bc97ef'/>
<id>urn:sha1:ce33e64c1788912976b61314b56935abd4bc97ef</id>
<content type='text'>
The allocation of PageBuffer is 512 bytes in size, but the dereferencing
of struct ms_bootblock_idi (also size 512) happens at a calculated offset
within the allocation, which means the object could potentially extend
beyond the end of the allocation. Avoid this case by just allocating
enough space to catch any accesses beyond the end. Seen with GCC 13:

../drivers/usb/storage/ene_ub6250.c: In function 'ms_lib_process_bootblock':
../drivers/usb/storage/ene_ub6250.c:1050:44: warning: array subscript 'struct ms_bootblock_idi[0]' is partly outside array bounds of 'unsigned char[512]' [-Warray-bounds=]
 1050 |                         if (le16_to_cpu(idi-&gt;wIDIgeneralConfiguration) != MS_IDI_GENERAL_CONF)
      |                                            ^~
../include/uapi/linux/byteorder/little_endian.h:37:51: note: in definition of macro '__le16_to_cpu'
   37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
      |                                                   ^
../drivers/usb/storage/ene_ub6250.c:1050:29: note: in expansion of macro 'le16_to_cpu'
 1050 |                         if (le16_to_cpu(idi-&gt;wIDIgeneralConfiguration) != MS_IDI_GENERAL_CONF)
      |                             ^~~~~~~~~~~
In file included from ../drivers/usb/storage/ene_ub6250.c:5:
In function 'kmalloc',
    inlined from 'ms_lib_process_bootblock' at ../drivers/usb/storage/ene_ub6250.c:942:15:
../include/linux/slab.h:580:24: note: at offset [256, 512] into object of size 512 allocated by 'kmalloc_trace'
  580 |                 return kmalloc_trace(
      |                        ^~~~~~~~~~~~~~
  581 |                                 kmalloc_caches[kmalloc_type(flags)][index],
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  582 |                                 flags, size);
      |                                 ~~~~~~~~~~~~

Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20230204183546.never.849-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
