<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/scsi, branch master</title>
<subtitle>Linux kernel mainline source</subtitle>
<id>http://mirrors.hust.edu.cn/git/linux.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/'/>
<updated>2026-09-06T03:45:18+00:00</updated>
<entry>
<title>Merge tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux</title>
<updated>2026-09-06T03:45:18+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-09-06T03:45:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=1fc5a74b108fc90951890ec513ac81869f5eaff1'/>
<id>urn:sha1:1fc5a74b108fc90951890ec513ac81869f5eaff1</id>
<content type='text'>
Pull kmalloc_obj conversions from Kees Cook:
 "Another run of the Coccinelle script for converting kmalloc()
  family of allocations to kmalloc_obj() via the existing rules
  in scripts/coccinelle/api/kmalloc_objs.cocci"

* tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  treewide: refresh kmalloc_obj() conversions
  drm/amd/display: Fix harmless type mismatch in allocation
</content>
</entry>
<entry>
<title>treewide: refresh kmalloc_obj() conversions</title>
<updated>2026-09-05T04:37:00+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees+treewide@kernel.org</email>
</author>
<published>2026-09-02T22:31:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d'/>
<id>urn:sha1:3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d</id>
<content type='text'>
This is another run of the Coccinelle script for converting kmalloc()
family of allocations to kmalloc_obj() via the existing rules in
scripts/coccinelle/api/kmalloc_objs.cocci

This catches both the set of kmalloc() uses added since the first
kmalloc_obj() conversions in v7.0 and adds a large group missed in the
first pass due to Coccinelle not interacting well with the cleanup.h
scoped_...() family of macros[1]. I worked around this with spatch's
"--macro-file" argument to a file with all the scoped_...() macros mapped
to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control
flow indicator I could find.

Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc,
riscv, and s390 with no new warnings.

Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1]
Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2]
Signed-off-by: Kees Cook &lt;kees+treewide@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: megaraid_sas: Limit NVMe request size to the PRP chain frame</title>
<updated>2026-09-02T16:13:15+00:00</updated>
<author>
<name>Thomas Lamprecht</name>
<email>t.lamprecht@proxmox.com</email>
</author>
<published>2026-08-27T17:24:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=af8c27375733fb6a6df9fa484cda77cc3dd0cb80'/>
<id>urn:sha1:af8c27375733fb6a6df9fa484cda77cc3dd0cb80</id>
<content type='text'>
megasas_make_prp_nvme() builds a command's PRP list in cmd-&gt;sg_frame, a
DMA pool buffer of instance-&gt;max_chain_frame_sz bytes, spending one
entry per NVMe page of the transfer plus one per page of the buffer for
the chain pointer. The loop runs until the transfer is described and
never checks the buffer bound.

max_hw_sectors comes straight from the MDTS the firmware reports for the
drive. On drives with a large MDTS the only thing keeping the list
inside the buffer was the block layer default of 1280 KiB, which needs
320 entries, which fit into a 4 KiB frame as that holds 512. But since
commit 9b8b84879d4a ("block: Increase BLK_DEF_MAX_SECTORS_CAP") that
default is 4 MiB, and such a transfer needs 1025 entries, so the list
runs a full page past the end of the frame:

  sd 1:0:1:0: [sdb] tag#630 page boundary ptr_sgl: 0x00000000ba62d13f
  BUG: unable to handle page fault for address: ff663bcb81e7c000
  #PF: supervisor write access in kernel mode
  #PF: error_code(0x0002) - not-present page
  RIP: 0010:megasas_build_and_issue_cmd_fusion+0xeaa/0x1870 [megaraid_sas]

If the page after the frame happens to be mapped, the overrun does not
fault but silently corrupts the neighbouring pool entry, which is
another in-flight command's PRP list.

Cap max_hw_sectors at what the chain frame can describe, less one page
for transfers that do not start on a page boundary and so need one entry
more. This is the megaraid_sas counterpart of commit 04631f55afc5
("scsi: mpt3sas: Limit NVMe request size to 2 MiB"), but derives the
limit from max_chain_frame_sz rather than hardcoding it.

Cc: stable@vger.kernel.org
Fixes: 9b8b84879d4a ("block: Increase BLK_DEF_MAX_SECTORS_CAP")
Reported-by: Lukasz Magiera &lt;me@magik.net&gt;
Closes: https://lore.kernel.org/all/GPhsSM0vkgyIrs0DIZ62qeUZX7X4RxwQXVKiuvMx-lHQVSPDxpztUyQOGS0xikqvJ-Z94hMV-dW_5KN_0CX2hsfV7kTf_t0MTf6vdAAaSEc=@magik.net/
Reported-by: Mira Limbeck &lt;m.limbeck@proxmox.com&gt;
Closes: https://lore.kernel.org/all/d171cc76-bf25-48ce-b482-d344669dfc24@proxmox.com/
Suggested-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/all/yq17bmzd5jr.fsf@ca-mkp.ca.oracle.com/
Signed-off-by: Thomas Lamprecht &lt;t.lamprecht@proxmox.com&gt;
Closes: https://lore.kernel.org/linux-scsi/20260827182106.535D61F000E9@smtp.kernel.org
Link: https://patch.msgid.link/20260827175743.734593-1-t.lamprecht@proxmox.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: bsg: Fix TOCTOU in io_uring passthrough command setup</title>
<updated>2026-09-02T14:36:52+00:00</updated>
<author>
<name>Rahul Chandelkar</name>
<email>rc@rexion.ai</email>
</author>
<published>2026-08-17T08:07:29+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=4b3c5965fca99f62d31c963294bd5b23cc488e97'/>
<id>urn:sha1:4b3c5965fca99f62d31c963294bd5b23cc488e97</id>
<content type='text'>
scsi_bsg_uring_cmd() reads bsg_uring_cmd from the shared mmap'd SQE.
Userspace can change a field after we check it and before we use it.
request_len is the sharp case: it can grow past sizeof(scmd-&gt;cmnd) after
the bound check and overflow scmd-&gt;cmnd in copy_from_user().

READ_ONCE() the SQE fields we check or use into locals before use.

Fixes: 7b6d3255e7f8 ("scsi: bsg: add io_uring passthrough handler")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20260527105931.3950913-1-rc@rexion.ai
Signed-off-by: Rahul Chandelkar &lt;rc@rexion.ai&gt;
Co-developed-by: Yang Xiuwei &lt;yangxiuwei@kylinos.cn&gt;
Signed-off-by: Yang Xiuwei &lt;yangxiuwei@kylinos.cn&gt;
Link: https://patch.msgid.link/20260817080730.967879-3-yangxiuwei@kylinos.cn
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: bsg: Cap io_uring sense copy to max_response_len</title>
<updated>2026-09-02T14:36:52+00:00</updated>
<author>
<name>Yang Xiuwei</name>
<email>yangxiuwei@kylinos.cn</email>
</author>
<published>2026-08-17T08:07:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=ece06de726737e887dc0225c8283477624f8ae21'/>
<id>urn:sha1:ece06de726737e887dc0225c8283477624f8ae21</id>
<content type='text'>
Completion copied scmd-&gt;sense_len to the user response buffer without
honoring max_response_len. After a valid sense, the midlayer sets
sense_len to the real length (up to SCSI_SENSE_BUFFERSIZE), so a smaller
user buffer was overrun.

Fixes: 7b6d3255e7f8 ("scsi: bsg: add io_uring passthrough handler")
Cc: stable@vger.kernel.org
Signed-off-by: Yang Xiuwei &lt;yangxiuwei@kylinos.cn&gt;
Link: https://patch.msgid.link/20260817080730.967879-2-yangxiuwei@kylinos.cn
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: mpt3sas: Avoid out-of-bounds cpumask_of_node() call in _base_assign_reply_queues()</title>
<updated>2026-09-02T02:22:23+00:00</updated>
<author>
<name>Ivy Lopez</name>
<email>skunkolee@gmail.com</email>
</author>
<published>2026-08-25T19:03:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=e0d26fe176a8db6ccad4ab38c5bab29391c1946b'/>
<id>urn:sha1:e0d26fe176a8db6ccad4ab38c5bab29391c1946b</id>
<content type='text'>
dev_to_node() can return NUMA_NO_NODE (-1) on systems without NUMA
topology information for the PCI device, such as single-socket boards
that don't expose device-to-node affinity. Passing -1 directly into
cpumask_of_node() indexes node_to_cpumask_map[-1], an out-of-bounds
array read caught by UBSAN:

  UBSAN: array-index-out-of-bounds in arch/x86/include/asm/topology.h:72:28
  index -1 is out of range for type 'cpumask *[1024]'

Fall back to cpu_online_mask when no NUMA node is available, rather than
assuming dev_to_node() always returns a valid node index.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221294
Suggested-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Fixes: 728bbc6cbff7 ("scsi: mpt3sas: Affinity high iops queues IRQs to local node")
Signed-off-by: Ivy Lopez &lt;skunkolee@gmail.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://patch.msgid.link/20260825190313.24013-1-skunkolee@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: mpi3mr: Fix use-after-free on tgt_dev-&gt;starget during target device refresh/update</title>
<updated>2026-09-02T02:18:54+00:00</updated>
<author>
<name>Laurence Oberman</name>
<email>loberman@redhat.com</email>
</author>
<published>2026-08-31T11:59:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=139f57343b3d6b26d9f01580123b2ba2d2150337'/>
<id>urn:sha1:139f57343b3d6b26d9f01580123b2ba2d2150337</id>
<content type='text'>
mpi3mr_refresh_tgtdevs() and mpi3mr_devinfochg_evt_bh() read
tgt_dev-&gt;starget and immediately pass it to starget_for_each_device()
without holding mrioc-&gt;tgtdev_lock. Every writer of this field --
mpi3mr_target_alloc(), mpi3mr_target_destroy(), mpi3mr_slave_destroy()
and mpi3mr_sdev_init() -- correctly serializes access under tgtdev_lock,
but these two read sites do not, which leaves a check-then-use window
against the SCSI core's target teardown path (scsi_remove_target(),
invoked e.g. via a concurrent host reset, sysfs "delete", or SCSI EH
device offlining running independently of the fwevt workqueue).

Sequence observed on production hardware, triggered on the
mpi3mr0_fwevt_wrkr workqueue during a SAS topology change shortly after
a controller reset:

  BUG: kernel NULL pointer dereference, address: 0000000000000058
  RIP: scsi_is_host_device+0x7/0x20
  Call Trace:
   starget_for_each_device+0x34/0x100
   mpi3mr_refresh_tgtdevs+0x152/0x1d0 [mpi3mr]
   mpi3mr_fwevt_bh+0x514/0x6c0 [mpi3mr]
   mpi3mr_fwevt_worker+0x1a/0x50 [mpi3mr]
   process_one_work+0x194/0x380
   worker_thread+0x2fe/0x410

mpi3mr_refresh_tgtdevs() reads tgt_dev-&gt;starget as non-NULL, but by the
time starget_for_each_device() dereferences it, a concurrent
mpi3mr_target_destroy() has already cleared tgt_dev-&gt;starget under
tgtdev_lock and the SCSI/device core has freed the underlying
scsi_target (and its embedded struct device). The stale pointer is then
walked by dev_to_shost() -&gt; scsi_is_host_device(), producing the
NULL/garbage dereference above.

Fix this by taking mrioc-&gt;tgtdev_lock around every read of
tgt_dev-&gt;starget, matching the existing writer-side discipline. Since
starget_for_each_device() and mpi3mr_update_sdev() can end up doing
non-atomic work (e.g. queue_limits_commit_update()), the lock cannot be
held across the whole call, so instead pin the target's device with
get_device() while holding the lock, drop the lock, then run
starget_for_each_device() against the pinned reference and put_device()
afterwards. This closes the TOCTOU window instead of merely narrowing
it.

The same unlocked read-and-dereference pattern also exists earlier in
mpi3mr_refresh_tgtdevs()'s first removal-scan loop
(tgt_dev-&gt;starget-&gt;hostdata); fix it the same way by holding tgtdev_lock
across that check, which is cheap since it only touches plain struct
fields.

Assisted-by: Claude:Sonnet5 [Claude Code]
Signed-off-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Acked-by: Chandrakanth Patil &lt;chandrakanth.patil@broadcom.com&gt;
Link: https://patch.msgid.link/20260831120047.14690-1-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch '7.3/scsi-queue' into 7.3/scsi-fixes</title>
<updated>2026-08-31T15:20:09+00:00</updated>
<author>
<name>Martin K. Petersen (Oracle)</name>
<email>mkp@kernel.org</email>
</author>
<published>2026-08-31T15:20:09+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=35131b1d29cbb30a4a3f32c541a0167bdfdbcbd1'/>
<id>urn:sha1:35131b1d29cbb30a4a3f32c541a0167bdfdbcbd1</id>
<content type='text'>
Pull in outstanding fixes queued for 7.3.

Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi</title>
<updated>2026-08-29T18:55:36+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-08-29T18:55:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=08dbfad3f5040f5bdb6c529da20d6d4e81fefd72'/>
<id>urn:sha1:08dbfad3f5040f5bdb6c529da20d6d4e81fefd72</id>
<content type='text'>
Pull more SCSI updates from Martin Petersen:
 "Remaining updates for the 7.3 merge window. The only core change is
  enabling context analysis for the SCSI layer and UFS.

  The remaining changes are either bug fixes or hardening"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi: (26 commits)
  scsi: snic: Fix SCSI host leak on workqueue allocation failure
  scsi: MAINTAINERS: Update my email address
  scsi: MAINTAINERS: Leave the cumana_1 and oak drivers to the RISCPC maintainers
  scsi: leapraid: Standardize NCQ priority sysfs attributes
  scsi: leapraid: Serialize firmware log mmap with teardown
  scsi: leapraid: Balance host references for firmware log VMAs
  scsi: lpfc: Remove unnnecessary NULL check
  scsi: qla2xxx: Fix an loop timeout test
  scsi: qla2xxx: Fix an error code in qla_get_tmf()
  scsi: ibmvfc: Fix use of uninitialized rport in ibmvfc_do_work()
  scsi: core: Enable context analysis for hosts.o
  scsi: lpfc: Replace strlcat() with sysfs_emit_at() in the sysfs show functions
  scsi: lpfc: Replace strlcat() with seq_buf in the debugfs dump helpers
  scsi: lpfc: Replace strlcat() with seq_buf in lpfc_rx_monitor_report()
  scsi: lpfc: Replace strlcat() with scnprintf() in lpfc_vport_symbolic_node_name()
  scsi: lpfc: Replace strlcat() with seq_buf in lpfc_info()
  scsi: core: Enable context analysis
  scsi: core: Protect host state changes with the host lock
  scsi: core: Add lock context annotations
  scsi: core: Pass the SCSI host pointer directly to scanning functions
  ...
</content>
</entry>
<entry>
<title>scsi: sg: Report request-table problems when any status is set</title>
<updated>2026-08-29T02:06:09+00:00</updated>
<author>
<name>Xu Rao</name>
<email>raoxu@uniontech.com</email>
</author>
<published>2026-07-06T08:44:43+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux.git/commit/?id=11300f8ddee301dca9914561f24bea4168de076d'/>
<id>urn:sha1:11300f8ddee301dca9914561f24bea4168de076d</id>
<content type='text'>
SG_GET_REQUEST_TABLE reports per-request diagnostic state through
sg_req_info::problem. The field is meant to indicate whether there is an
error to report for a completed request.

sg_fill_request_table() currently combines masked_status, host_status
and driver_status with bitwise AND. This only reports a problem when all
three status fields are non-zero at the same time. A normal target check
condition, for example, has masked_status set while host_status and
driver_status may both be zero, so the request is incorrectly reported
as clean.

Use the same condition as sg_new_read(), which sets SG_INFO_CHECK when
any of the three status fields is non-zero.

Signed-off-by: Xu Rao &lt;raoxu@uniontech.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/26BF67F369E2123E+20260706084443.805598-1-raoxu@uniontech.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
</feed>
