<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/sym, branch upstream/11.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r311305 (by asomers):</title>
<updated>2017-03-23T06:40:20+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2017-03-23T06:40:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6352900b3df2d8e5409dbf52d6b3d6c494817605'/>
<id>6352900b3df2d8e5409dbf52d6b3d6c494817605</id>
<content type='text'>
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

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
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r313982, r314068:</title>
<updated>2017-03-14T02:06:03+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-03-14T02:06:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bd0faecc931277934a72772a410ede5663969cdb'/>
<id>bd0faecc931277934a72772a410ede5663969cdb</id>
<content type='text'>
sys: Replace zero with NULL for pointers.

Found with:	devel/coccinelle
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sys: Replace zero with NULL for pointers.

Found with:	devel/coccinelle
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r313949: Remove dead mentions of CAM target mode APIs from drivers.</title>
<updated>2017-02-28T06:46:41+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2017-02-28T06:46:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f7378b0367fdc1a615fc5d04dddc1adb86b94874'/>
<id>f7378b0367fdc1a615fc5d04dddc1adb86b94874</id>
<content type='text'>
This makes grepping kernel for target mode implementation much easier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes grepping kernel for target mode implementation much easier.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a riscv define.</title>
<updated>2016-06-01T14:03:13+00:00</updated>
<author>
<name>Ruslan Bukin</name>
<email>br@FreeBSD.org</email>
</author>
<published>2016-06-01T14:03:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b217eb93142e25b683c97f1e230aa10c5bf1ed80'/>
<id>b217eb93142e25b683c97f1e230aa10c5bf1ed80</id>
<content type='text'>
Submitted by:	Yukishige Shibata &lt;y-shibat@mtd.biglobe.ne.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Submitted by:	Yukishige Shibata &lt;y-shibat@mtd.biglobe.ne.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a bug in r298340: "sim" was referenced after being unset.</title>
<updated>2016-05-13T20:54:54+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2016-05-13T20:54:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ce59ff90af4617beb803cdd6f463dd6a4a3d9cb8'/>
<id>ce59ff90af4617beb803cdd6f463dd6a4a3d9cb8</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: minor spelling fixes.</title>
<updated>2016-05-03T03:41:25+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-05-03T03:41:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=453130d9bfc1c6d68b366dfcb041689d69f81295'/>
<id>453130d9bfc1c6d68b366dfcb041689d69f81295</id>
<content type='text'>
Most affect comments, very few have user-visible effects.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most affect comments, very few have user-visible effects.
</pre>
</div>
</content>
</entry>
<entry>
<title>sys/dev: extend use of the howmany() macro when available.</title>
<updated>2016-04-26T15:03:15+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-04-26T15:03:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=057b4402bf634907fd03590e2757e09e975d04c7'/>
<id>057b4402bf634907fd03590e2757e09e975d04c7</id>
<content type='text'>
We have a howmany() macro in the &lt;sys/param.h&gt; header that is
convenient to re-use as it makes things easier to read.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a howmany() macro in the &lt;sys/param.h&gt; header that is
convenient to re-use as it makes things easier to read.
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: use our roundup2/rounddown2() macros when param.h is available.</title>
<updated>2016-04-21T19:57:40+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-04-21T19:57:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489'/>
<id>d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489</id>
<content type='text'>
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
</pre>
</div>
</content>
</entry>
<entry>
<title>sym(4): Don't double-free 'sim' in failure case</title>
<updated>2016-04-20T05:13:36+00:00</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2016-04-20T05:13:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=26b5a97a27a2f16512197d3618b5874d183736f4'/>
<id>26b5a97a27a2f16512197d3618b5874d183736f4</id>
<content type='text'>
Reported by:	Coverity
CID:		1006106
Sponsored by:	EMC / Isilon Storage Division
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported by:	Coverity
CID:		1006106
Sponsored by:	EMC / Isilon Storage Division
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup unnecessary semicolons from the kernel.</title>
<updated>2016-04-10T23:07:00+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-04-10T23:07:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=74b8d63dcc17c07d8cb21e13f6db517698efd49f'/>
<id>74b8d63dcc17c07d8cb21e13f6db517698efd49f</id>
<content type='text'>
Found with devel/coccinelle.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found with devel/coccinelle.
</pre>
</div>
</content>
</entry>
</feed>
