<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/virtio/scsi, branch release/12.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r357040: virtio_scsi: use max target ID plus one as the initiator ID</title>
<updated>2020-02-27T14:52:55+00:00</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2020-02-27T14:52:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4f6e8eeebe3020a3ec366e8f86c79a1e7b650799'/>
<id>4f6e8eeebe3020a3ec366e8f86c79a1e7b650799</id>
<content type='text'>
This bus does not really have a concept of the initiator ID, so use
a guaranteed dummy one that won't conflict with any real target.

This change fixes a problem with virtio_scsi on GCE where disks get
sequential target IDs starting from one.  If there are seven or more
disks, then a disk with the target ID of seven would not be discovered
by FreeBSD as that ID was reserved as the initiator ID -- see
scsi_scan_bus().

Sponsored by:	Panzura
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This bus does not really have a concept of the initiator ID, so use
a guaranteed dummy one that won't conflict with any real target.

This change fixes a problem with virtio_scsi on GCE where disks get
sequential target IDs starting from one.  If there are seven or more
disks, then a disk with the target ID of seven would not be discovered
by FreeBSD as that ID was reserved as the initiator ID -- see
scsi_scan_bus().

Sponsored by:	Panzura
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r349285</title>
<updated>2019-07-03T19:52:24+00:00</updated>
<author>
<name>Eric van Gyzen</name>
<email>vangyzen@FreeBSD.org</email>
</author>
<published>2019-07-03T19:52:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7b4d80f6e3f018cd80228fbd98e029aa4a722ab0'/>
<id>7b4d80f6e3f018cd80228fbd98e029aa4a722ab0</id>
<content type='text'>
VirtIO SCSI:  validate seg_max on attach

Until head r349278 (stable/12 r349690), bhyve presented a seg_max
to the guest that was too large.  Detect this case and clamp it to
the virtqueue size.  Otherwise, we would fail the "too many segments
to enqueue" assertion in virtqueue_enqueue().

I hit this by running a guest with a MAXPHYS of 256 KB.

Reviewed by:	bryanv cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20703
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
VirtIO SCSI:  validate seg_max on attach

Until head r349278 (stable/12 r349690), bhyve presented a seg_max
to the guest that was too large.  Detect this case and clamp it to
the virtqueue size.  Otherwise, we would fail the "too many segments
to enqueue" assertion in virtqueue_enqueue().

I hit this by running a guest with a MAXPHYS of 256 KB.

Reviewed by:	bryanv cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20703
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r346161: Fix SCSI sense data pass through.</title>
<updated>2019-04-19T03:47:23+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2019-04-19T03:47:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9924b1f0cf78784a82da7b1848679704b4843384'/>
<id>9924b1f0cf78784a82da7b1848679704b4843384</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>sys/dev: further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-27T14:52:40+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-27T14:52:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=718cf2ccb9956613756ab15d7a0e28f2c8e91cab'/>
<id>718cf2ccb9956613756ab15d7a0e28f2c8e91cab</id>
<content type='text'>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
</pre>
</div>
</content>
</entry>
<entry>
<title>Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)</title>
<updated>2017-01-04T20:26:42+00:00</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2017-01-04T20:26:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4195c7de2471d6212744bcbf128d659e94801d17'/>
<id>4195c7de2471d6212744bcbf128d659e94801d17</id>
<content type='text'>
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:		215474
Reported by:	Coverity
CID:		1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:		1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:		1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:		1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:		1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:		1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:		1010035 1010036 1010042 1010041 1010040 1010039
Reviewed by:	imp, sephe, slm
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9037
Differential Revision:	https://reviews.freebsd.org/D9038
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:		215474
Reported by:	Coverity
CID:		1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:		1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:		1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:		1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:		1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:		1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:		1010035 1010036 1010042 1010041 1010040 1010039
Reviewed by:	imp, sephe, slm
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9037
Differential Revision:	https://reviews.freebsd.org/D9038
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent overflow issues in timeout processing</title>
<updated>2014-11-21T21:01:24+00:00</updated>
<author>
<name>Steven Hartland</name>
<email>smh@FreeBSD.org</email>
</author>
<published>2014-11-21T21:01:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=85c9dd9d895261632d58cf98da6608b93dd5d7f8'/>
<id>85c9dd9d895261632d58cf98da6608b93dd5d7f8</id>
<content type='text'>
Previously, any timeout value for which (timeout * hz) will overflow the
signed integer, will give weird results, since callout(9) routines will
convert negative values of ticks to '1'. For unsigned integer overflow we
will get sufficiently smaller timeout values than expected.

Switch from callout_reset, which requires conversion to int based ticks
to callout_reset_sbt to avoid this.

Also correct isci to correctly resolve ccb timeout.

This was based on the original work done by Eygene Ryabinkin
&lt;rea@freebsd.org&gt; back in 5 Aug 2011 which used a macro to help avoid
the overlow.

Differential Revision:	https://reviews.freebsd.org/D1157
Reviewed by:	mav, davide
MFC after:	1 month
Sponsored by:	Multiplay
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, any timeout value for which (timeout * hz) will overflow the
signed integer, will give weird results, since callout(9) routines will
convert negative values of ticks to '1'. For unsigned integer overflow we
will get sufficiently smaller timeout values than expected.

Switch from callout_reset, which requires conversion to int based ticks
to callout_reset_sbt to avoid this.

Also correct isci to correctly resolve ccb timeout.

This was based on the original work done by Eygene Ryabinkin
&lt;rea@freebsd.org&gt; back in 5 Aug 2011 which used a macro to help avoid
the overlow.

Differential Revision:	https://reviews.freebsd.org/D1157
Reviewed by:	mav, davide
MFC after:	1 month
Sponsored by:	Multiplay
</pre>
</div>
</content>
</entry>
<entry>
<title>Read each field of the configuration individually</title>
<updated>2014-01-25T07:01:51+00:00</updated>
<author>
<name>Bryan Venteicher</name>
<email>bryanv@FreeBSD.org</email>
</author>
<published>2014-01-25T07:01:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8c457c885ea9f5cde3701403e726d112ef70b036'/>
<id>8c457c885ea9f5cde3701403e726d112ef70b036</id>
<content type='text'>
In the forthcoming VirtIO spec, the device configuration is
always in little endian instead of guest edian. This is a
noop change for now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the forthcoming VirtIO spec, the device configuration is
always in little endian instead of guest edian. This is a
noop change for now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove spaces before tabs in the function prototype list</title>
<updated>2014-01-25T06:54:04+00:00</updated>
<author>
<name>Bryan Venteicher</name>
<email>bryanv@FreeBSD.org</email>
</author>
<published>2014-01-25T06:54:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=31ac03991bd55e89e87bc9d0b2586e0717a82786'/>
<id>31ac03991bd55e89e87bc9d0b2586e0717a82786</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add unmapped IO support to virtio_scsi(4)</title>
<updated>2014-01-13T04:46:48+00:00</updated>
<author>
<name>Bryan Venteicher</name>
<email>bryanv@FreeBSD.org</email>
</author>
<published>2014-01-13T04:46:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=22525db507aeb56af0484f7b2c61f495071d8cff'/>
<id>22525db507aeb56af0484f7b2c61f495071d8cff</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove incorrect bit shift when assigning the LUN request field</title>
<updated>2014-01-12T17:40:47+00:00</updated>
<author>
<name>Bryan Venteicher</name>
<email>bryanv@FreeBSD.org</email>
</author>
<published>2014-01-12T17:40:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bf51187b26e2285be944dc9e8eb52fa5fa2ba5c0'/>
<id>bf51187b26e2285be944dc9e8eb52fa5fa2ba5c0</id>
<content type='text'>
This caused duplicate targets appearing on Google Compute Engine
instances.

PR:		kern/185626
Submitted by:	Venkatesh Srinivas &lt;venkateshs@google.com&gt;
MFC after:	3 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This caused duplicate targets appearing on Google Compute Engine
instances.

PR:		kern/185626
Submitted by:	Venkatesh Srinivas &lt;venkateshs@google.com&gt;
MFC after:	3 days
</pre>
</div>
</content>
</entry>
</feed>
