<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/mps, branch releng/12.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2022-09-07T07:55:40Z</updated>
<entry>
<title>mps(4): Remove a double word in a source code comment</title>
<updated>2022-09-07T07:55:40Z</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2022-09-04T11:48:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4f4afebc8e13e9531314d8379d8ed56b0ff870c6'/>
<id>urn:sha1:4f4afebc8e13e9531314d8379d8ed56b0ff870c6</id>
<content type='text'>
- s/the the/the/

(cherry picked from commit d6f9a3c0a8b11fa0e26e364266e37805ca1dcca2)
</content>
</entry>
<entry>
<title>mpr/mps/mpt: verify cfg page ioctl lengths</title>
<updated>2022-04-04T00:46:34Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2022-03-28T13:33:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=56d0638c738e3f9b7fbc7f78bd49590523e01ada'/>
<id>urn:sha1:56d0638c738e3f9b7fbc7f78bd49590523e01ada</id>
<content type='text'>
*_CFG_PAGE ioctl handlers in the mpr, mps, and mpt drivers allocated a
buffer of a caller-specified size, but copied to it a fixed size header.
Add checks that the size is at least the required minimum.

Note that the device nodes are owned by root:operator with 0640
permissions so the ioctls are not available to unprivileged users.

This change includes suggestions from scottl, markj and mav.

Two of the mpt cases were reported by Lucas Leong (@_wmliang_) of
Trend Micro Zero Day Initiative; scottl reported the third case in mpt.
Same issue found in mpr and mps after discussion with imp.

Reported by:	Lucas Leong (@_wmliang_), Trend Micro Zero Day Initiative
Reviewed by:	imp, mav
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34692

(cherry picked from commit 8276c4149b5fc7c755d6b244fbbf6dae1939f087)
</content>
</entry>
<entry>
<title>mpr, mps: clear CCBs allocated on the stack</title>
<updated>2021-12-01T18:52:36Z</updated>
<author>
<name>Edward Tomasz Napierala</name>
<email>trasz@FreeBSD.org</email>
</author>
<published>2021-05-21T06:42:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a1e06684e708cca9eba2c3978c20a9552a55283f'/>
<id>urn:sha1:a1e06684e708cca9eba2c3978c20a9552a55283f</id>
<content type='text'>
Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30301

(cherry picked from commit 7608b98c4394590840a53d2b38b908582253de32)
</content>
</entry>
<entry>
<title>mpr/mps(4): Make device mapping some more robust.</title>
<updated>2021-12-01T18:51:24Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2021-04-24T03:18:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9d842d84f49af6d4aacaea694dcaea4173522684'/>
<id>urn:sha1:9d842d84f49af6d4aacaea694dcaea4173522684</id>
<content type='text'>
Allow new enclosure to replace previously existing one if there is
no completely unused table entry, same as it is done for devices.

If we can not process DPM due to corruption -- wipe it and restart
from scratch.  Otherwise I don't see a way to recover persistence if
something go wrong and there is no BIOS to recover it for us.

Together this solves a problem that appeared when 9300-8i firmware
update to 16.00.10.00 somehow switched its mapping mode from Device
Persistence to Enclosure/Slot without wiping the DPM table.  It made
HBA completely unusable, since overflowed and conflicting mapping
table was unable to map any of enclosures and so devices.

Also while there make some enclosure mapping errors more informative.

MFC after:	1 month
Sponsored by:	iXsystems, Inc.

(cherry picked from commit b99419aee49e2cc53747730be4d0ec4f9b330eb2)
</content>
</entry>
<entry>
<title>Remove unused wrappers around kproc_create() and kproc_exit().</title>
<updated>2021-12-01T18:46:48Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2021-03-12T17:47:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9d98b001a8c5dad3735796e22ad0e4e776c91d4e'/>
<id>urn:sha1:9d98b001a8c5dad3735796e22ad0e4e776c91d4e</id>
<content type='text'>
Reviewed by:	imp, kib
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D29205

(cherry picked from commit 645b15e558dc102ff70a6332b1d0b0aa733fd2bb)
</content>
</entry>
<entry>
<title>mpr, mps: Fix a stack buffer overflow in the user passthru ioctl</title>
<updated>2021-01-11T14:43:37Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-01-08T18:32:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ed6fa9d618bff47dcd3fb000e5805e29d331578d'/>
<id>urn:sha1:ed6fa9d618bff47dcd3fb000e5805e29d331578d</id>
<content type='text'>
Previously we copied in the request into a stack-allocated structure
that could be smaller than the request size.  Furthermore, we checked
the request size only after doing the copyin.

Fix this by allocating a buffer to hold the request, then copying the
buffer's contents into a command descriptor.  This is a bit heavy-handed
but I expect the overhead will not be noticeable.  The approach of
coping the header in first is susceptible to TOCTOU problems.

Reviewed by:	imp
Reported by:	maxpl0it@protonmail.com
Differential Revision:	https://reviews.freebsd.org/D27963

(cherry picked from commit de828a91db29fb20440e0d92f3d3136b314a9584)
</content>
</entry>
<entry>
<title>mpr, mps: Fix an off-by-one bug in the BTDH_MAPPING ioctl</title>
<updated>2021-01-11T14:43:17Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-01-08T18:32:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ee01a1e7d862a5a33b43b8ae9da220d83f089c21'/>
<id>urn:sha1:ee01a1e7d862a5a33b43b8ae9da220d83f089c21</id>
<content type='text'>
The device mapping table contains sc-&gt;max_devices entries, so only
indices in [0, sc-&gt;max_devices) are valid.

Differential Revision:	https://reviews.freebsd.org/D27964

(cherry picked from commit adc0dcc352bb9f5a67a054d95c6959ea5aa26d91)
</content>
</entry>
<entry>
<title>MFC r367044: Introduce support of SCSI Command Priority.</title>
<updated>2020-11-24T13:17:12Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-11-24T13:17:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4b74fa5dd5aef9786aee4f9359be15b9da9a096d'/>
<id>urn:sha1:4b74fa5dd5aef9786aee4f9359be15b9da9a096d</id>
<content type='text'>
SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default.  SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL.  Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles.  Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target.  Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.
</content>
</entry>
<entry>
<title>MFC r363852: Remove extra memset() left after r342388.</title>
<updated>2020-08-11T00:41:48Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2020-08-11T00:41:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0611f3541ea76c9498330a78f6abd7cca4795321'/>
<id>urn:sha1:0611f3541ea76c9498330a78f6abd7cca4795321</id>
<content type='text'>
This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(),
that broke target reset on device removal, making later re-insertion into
the same slot impossible, since firmware was still waiting for the driver
to finish with the removed device.
</content>
</entry>
<entry>
<title>MFC r363608:</title>
<updated>2020-08-03T23:06:33Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2020-08-03T23:06:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9c4a78a41a2cdce7b1a749ad9a295a8953faa9ab'/>
<id>urn:sha1:9c4a78a41a2cdce7b1a749ad9a295a8953faa9ab</id>
<content type='text'>
mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK).
</content>
</entry>
</feed>
