<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/ppbus, branch stable/10</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:41:13+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2017-03-23T06:41:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=63a2397e28702b82eca0410a0a7db8f60fc51215'/>
<id>63a2397e28702b82eca0410a0a7db8f60fc51215</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 r296944:</title>
<updated>2017-02-10T05:42:06+00:00</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2017-02-10T05:42:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=688be43e823c600d933ba005568863d7ceadfb6e'/>
<id>688be43e823c600d933ba005568863d7ceadfb6e</id>
<content type='text'>
This unbreaks ia64.LINT

r296944 (by imp):

Fix debug printf
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This unbreaks ia64.LINT

r296944 (by imp):

Fix debug printf
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r296891 (by imp):</title>
<updated>2017-01-26T21:35:58+00:00</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2017-01-26T21:35:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=532006e2a91eb35c38f7e9c2636d86add03eb43a'/>
<id>532006e2a91eb35c38f7e9c2636d86add03eb43a</id>
<content type='text'>
Make sure we check for CAM_CDB_POINTER for all drivers. Also, for the
drivers I've touched, filter out CAM_CDB_PHYS.

Differential Revision: https://reviews.freebsd.org/D5585
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure we check for CAM_CDB_POINTER for all drivers. Also, for the
drivers I've touched, filter out CAM_CDB_PHYS.

Differential Revision: https://reviews.freebsd.org/D5585
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r305345:</title>
<updated>2016-09-07T19:02:47+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2016-09-07T19:02:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7994d2322a9573f77833617d0d7a14a0382e550f'/>
<id>7994d2322a9573f77833617d0d7a14a0382e550f</id>
<content type='text'>
With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
	if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
		     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
		if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
		    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
					nACK | SELECT | PERROR | nBUSY)) {
					~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D7771
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
	if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
		     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
		if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
		    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
					nACK | SELECT | PERROR | nBUSY)) {
					~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D7771
</pre>
</div>
</content>
</entry>
<entry>
<title>  Clean up SIOCSIFDSTADDR usage from ifnet drivers. The ioctl itself is</title>
<updated>2013-09-11T09:19:44+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2013-09-11T09:19:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=540b1a7238d2a19d873f4b26fd87284b6cc29990'/>
<id>540b1a7238d2a19d873f4b26fd87284b6cc29990</id>
<content type='text'>
extremely outdated, and I doubt that it was ever used for ifnet drivers.
It was used for AF_INET sockets in pre-FreeBSD time.

Approved by:	re (hrs)
Sponsored by:	Nginx, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
extremely outdated, and I doubt that it was ever used for ifnet drivers.
It was used for AF_INET sockets in pre-FreeBSD time.

Approved by:	re (hrs)
Sponsored by:	Nginx, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add const qualifier to the dst parameter of the ifnet if_output method.</title>
<updated>2013-04-26T12:50:32+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2013-04-26T12:50:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=47e8d432d5db395e2812c03093b70227e48a1c6d'/>
<id>47e8d432d5db395e2812c03093b70227e48a1c6d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>- Corrrect mispellings of word useful</title>
<updated>2013-04-17T11:45:15+00:00</updated>
<author>
<name>Gabor Kovesdan</name>
<email>gabor@FreeBSD.org</email>
</author>
<published>2013-04-17T11:45:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8fb3bbe7706f0919ce074f9b44f04d8fafe690e6'/>
<id>8fb3bbe7706f0919ce074f9b44f04d8fafe690e6</id>
<content type='text'>
Submitted by:	Christoph Mallon &lt;christoph.mallon@gmx.de&gt; (via private mail)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Submitted by:	Christoph Mallon &lt;christoph.mallon@gmx.de&gt; (via private mail)
</pre>
</div>
</content>
</entry>
<entry>
<title>- Correct mispellings of the word occurrence</title>
<updated>2013-04-17T11:40:10+00:00</updated>
<author>
<name>Gabor Kovesdan</name>
<email>gabor@FreeBSD.org</email>
</author>
<published>2013-04-17T11:40:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ab3f6b347ef97e755cf291ed77f9eb4a48531d15'/>
<id>ab3f6b347ef97e755cf291ed77f9eb4a48531d15</id>
<content type='text'>
Submitted by:	Christoph Mallon &lt;christoph.mallon@gmx.de&gt; (via private mail)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Submitted by:	Christoph Mallon &lt;christoph.mallon@gmx.de&gt; (via private mail)
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename device_delete_all_children() into device_delete_children().</title>
<updated>2011-11-22T21:56:55+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2011-11-22T21:56:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3b12bdb58f3ab1b077e536cd72894cbe3e56dff5'/>
<id>3b12bdb58f3ab1b077e536cd72894cbe3e56dff5</id>
<content type='text'>
Suggested by:	jhb @ and marius @
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Suggested by:	jhb @ and marius @
MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>- There's no need to overwrite the default device method with the default</title>
<updated>2011-11-22T21:28:20+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2011-11-22T21:28:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4b7ec27007570e0ce4fe9dbb447e7afc131b487a'/>
<id>4b7ec27007570e0ce4fe9dbb447e7afc131b487a</id>
<content type='text'>
  one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.
</pre>
</div>
</content>
</entry>
</feed>
