CVS commit: [netbsd-7-0] src/sys/kern

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 15 04:48:16 UTC 2018

Modified Files:
src/sys/kern [netbsd-7-0]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1602):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.158.4.1.2.2 -r1.158.4.1.2.3 src/sys/kern/uipc_mbuf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/bta2dpd/bta2dpd

2018-05-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue May 15 04:25:25 UTC 2018

Modified Files:
src/usr.sbin/bta2dpd/bta2dpd: bta2dpd.8

Log Message:
Use the correct tag options.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/i2c

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 02:02:18 UTC 2018

Modified Files:
src/sys/dev/i2c: i2c.c

Log Message:
Fix a problem reported by jmcneill@ where by a system with multuple i2c
busses would end up with "ghost" device instances on the second bus.  This
issue was previously masked on ARM systems by the empty-child-devices
array issue fixed recently (that effectively blocked all indirect config
of i2c busses on those systems).

To fix this problem, we require that indirectly-configured devices have
to fully specify their parent spec and address, e.g.:

foo* at iic0 addr 0x55

NOT

foo* at iic? addr ?

or even:

foo* at iic? addr 0x55

This is needed because of how indirect configuration works... attach
directives in the kernel config file are enumerated, calling the bus's
search routine, which in the case of i2c, enumerates all i2c addresses
and calls the match routine for each address.  Because we can't always
reliably probe for i2c devices, we ended up with erroneous matches.

Direct configuration of i2c is still allowed to use wildcarded parent specs
and locators.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/i2c/i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 01:53:27 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: ALL GENERIC XEN3_DOM0
src/sys/arch/i386/conf: ALL GENERIC XEN3_DOM0

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.

N.B. The x86 platforms are sort of a mess, here... legacy indirect
config and ACPI direct config sort of smashed together with the
same config file directives.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.490 -r1.491 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.438 -r1.439 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1177 -r1.1178 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.127 -r1.128 src/sys/arch/i386/conf/XEN3_DOM0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/usbhidaction

2018-05-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue May 15 01:41:30 UTC 2018

Modified Files:
src/usr.bin/usbhidaction: usbhidaction.1 usbhidaction.c

Log Message:
Add an optional '-p pidfile' parameter.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/usbhidaction/usbhidaction.1
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/usbhidaction/usbhidaction.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/sunxi

2018-05-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue May 15 01:26:46 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c

Log Message:
Add outputs.mute control


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/evbarm/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 01:24:23 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: ARMADAXP ARMADILLO210 ARMADILLO9 CUBOX DNS323
GUMSTIX KUROBOX_PRO KURONAS_X4 MMNET_GENERIC MPCSA_GENERIC MV2120
TEAMASA_NPWR VTC100

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/ARMADAXP
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/conf/ARMADILLO210
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/conf/ARMADILLO9 \
src/sys/arch/evbarm/conf/MPCSA_GENERIC
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/CUBOX
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/DNS323
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/evbarm/conf/GUMSTIX
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/KUROBOX_PRO
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/KURONAS_X4
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/MMNET_GENERIC
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/MV2120
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/evbarm/conf/TEAMASA_NPWR
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/VTC100

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man7

2018-05-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue May 15 01:07:37 UTC 2018

Modified Files:
src/share/man/man7: intro.7

Log Message:
Update the introduction page to section 7 of the manual noting the audio
spec.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man7/intro.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sandpoint/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 01:07:06 UTC 2018

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC

Log Message:
Revert previous; we actually use direct-configuration of I2C in this
kernel config.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/sandpoint/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sandpoint/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 00:57:15 UTC 2018

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sandpoint/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2018-05-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue May 15 00:54:02 UTC 2018

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: audio.4
src/share/man/man7: Makefile
src/share/man/man9: audio.9
Added Files:
src/share/man/man7: audio.7

Log Message:
Add the audio mixer specification to section 7 of the manual.
See posting on tech-kern - "NetBSD Audio Specification 2018."


To generate a diff of this commit:
cvs rdiff -u -r1.1585 -r1.1586 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.84 -r1.85 src/share/man/man4/audio.4
cvs rdiff -u -r1.31 -r1.32 src/share/man/man7/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man7/audio.7
cvs rdiff -u -r1.45 -r1.46 src/share/man/man9/audio.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/zaurus/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 00:44:56 UTC 2018

Modified Files:
src/sys/arch/zaurus/conf: GENERIC INSTALL INSTALL_C700

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/zaurus/conf/INSTALL
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/conf/INSTALL_C700

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/alpha/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 15 00:42:35 UTC 2018

Modified Files:
src/sys/arch/alpha/conf: GENERIC

Log Message:
Actully, we can STAR the iic instances (the configuration code can
handle pinned pspecs to STAR'd potential parents).


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/sys/arch/alpha/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev

2018-05-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue May 15 00:28:00 UTC 2018

Modified Files:
src/sys/dev: audio.c

Log Message:
Expose the audio_info structure of vchan zero(0) the mix ring to allow
setting the hardware gain and balance via audioctl(1) using the -p 0
switch.

It is not possible to influence the hardware gain/blance from the
audio_info structure of vchans 1 onwards.  It is now possible to return
the audio mixers audio format from the audio_info structure of vchan 0 to
ease applications configuring for mmapped play back.

This is conformant to the audio specification posted on tech-kern see:
"NetBSD Audio Specification 2018"
or audio.7 manual page to be added in a follow up commit.


To generate a diff of this commit:
cvs rdiff -u -r1.453 -r1.454 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev

2018-05-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue May 15 00:19:08 UTC 2018

Modified Files:
src/sys/dev: audio.c

Log Message:
Fix numbering of vchan mixer controls to correspond to the vchan number in
use.
This makes the numbering of vchans consistient for audioctl and mixerctl.


To generate a diff of this commit:
cvs rdiff -u -r1.452 -r1.453 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/alpha/conf

2018-05-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon May 14 22:11:30 UTC 2018

Modified Files:
src/sys/arch/alpha/conf: GENERIC

Log Message:
Move iic0 at alipm? to iic1.  Using iic0 will conflict with the
iic0 at tsciic? on the API CS20.

XXX: Enumerate the similar-to-DS20L I2C devices on the CS20, which
IIRC are not all on the tsciic(4) I2C bus, and comment GENERIC
accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/arch/alpha/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/mmeye/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 14 22:01:57 UTC 2018

Modified Files:
src/sys/arch/mmeye/conf: MMEYE_WLF

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mmeye/conf/MMEYE_WLF

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/hpcarm/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 14 21:58:15 UTC 2018

Modified Files:
src/sys/arch/hpcarm/conf: NETBOOKPRO

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hpcarm/conf/NETBOOKPRO

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/evbmips/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 14 21:50:02 UTC 2018

Modified Files:
src/sys/arch/evbmips/conf: GDIUM LOONGSON

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbmips/conf/GDIUM
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbmips/conf/LOONGSON

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/alpha/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 14 21:11:39 UTC 2018

Modified Files:
src/sys/arch/alpha/conf: GENERIC

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/arch/alpha/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/acorn32/conf

2018-05-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 14 21:05:17 UTC 2018

Modified Files:
src/sys/arch/acorn32/conf: EB7500ATX GENERIC INSTALL LOWMEM_WSCONS NC

Log Message:
Fully specifiy the location of indirectly-configured I2C devices. In
particular, the parent spec must not be wild-carded, as doing so doesn't
work well on systems where more than one I2C bus is present.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/acorn32/conf/EB7500ATX
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/acorn32/conf/GENERIC
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/acorn32/conf/INSTALL
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/acorn32/conf/LOWMEM_WSCONS
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/acorn32/conf/NC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/doc

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 19:24:10 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
Tickets #805, #822 and #823.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.197 -r1.1.2.198 src/doc/CHANGES-8.0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/net/npf

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 19:22:30 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-8]: npf_alg_icmp.c npf_inet.c npf_sendpkt.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #823):

sys/net/npf/npf_inet.c: revision 1.45-1.47
sys/net/npf/npf_alg_icmp.c: revision 1.27-1.30
sys/net/npf/npf_sendpkt.c: revision 1.19

Fix use-after-free.

The nbuf can be reallocated as a result of caching 'enpc', so it is
necessary to recache 'npc', otherwise it contains pointers to the freed
mbuf - pointers which are then used in the ruleset machinery.

We recache 'npc' when we are sure we won't use 'enpc' anymore, because
'enpc' can be clobbered as a result of caching 'npc' (in other words,
only one of the two can be cached at the same time).
Also, we recache 'npc' unconditionally, because there is no way to know
whether the nbuf got clobbered relatively to it. We can't use the
NBUF_DATAREF_RESET flag, because it is stored in the nbuf and not in the
cache.

Discussed with rmind@.

Change npf_cache_all so that it ensures the potential ICMP Query Id is in
the nbuf. In such a way that we don't need to ensure that later.
Change npfa_icmp4_inspect and npfa_icmp6_inspect so that they touch neither
the nbuf nor npc. Adapt their callers accordingly.

In the end, if a packet has a Query Id, we set NPC_ICMP_ID in npc and leave
right away, without recaching npc (not needed since we didn't touch the
nbuf).

This fixes the handling of Query Id packets (that I broke in my previous
commit), and also fixes another possible use-after-free.

Retrieve the complete IPv4 header right away, and make sure we did retrieve
the IPv6 option header we were iterating on.

Ah, fix compilation. I tested my previous change by loading the kernel
module from the filesystem, but the Makefile didn't have DIAGNOSTIC
enabled, and the two KASSERTs I added did not compile properly.

If we fail to advance inside TCP/UDP/ICMPv4/ICMPv6, stop pretending L4
is unknown, and error out right away.

This prevents bugs in machinery, if a place looks for L4 in 'npc_proto'
without checking the cache too. I've seen a ~similar problem already.

In addition to checking L4 in the cache, here we also need to check the
protocol. The NPF entry point does not ensure that
ICMPv6 can be set only in IPv6
ICMPv4 can be set only in IPv4
So we could have ICMPv6 in IPv4.

apply some INET6 so this compiles in INET6-less kernels again.


To generate a diff of this commit:
cvs rdiff -u -r1.24.8.1 -r1.24.8.2 src/sys/net/npf/npf_alg_icmp.c
cvs rdiff -u -r1.37.6.1 -r1.37.6.2 src/sys/net/npf/npf_inet.c
cvs rdiff -u -r1.16.8.1 -r1.16.8.2 src/sys/net/npf/npf_sendpkt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 19:17:39 UTC 2018

Modified Files:
src/lib/libc/string [netbsd-8]: stresep.c
src/tests/lib/libc/string [netbsd-8]: t_stresep.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #822):

lib/libc/string/stresep.c: revision 1.4
tests/lib/libc/string/t_stresep.c: revision 1.4

PR/52499: Justin: stresep uses memmove with of-by-one length
Add test from PR/52499


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.4.1 src/lib/libc/string/stresep.c
cvs rdiff -u -r1.3 -r1.3.22.1 src/tests/lib/libc/string/t_stresep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/kern

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 19:11:21 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: kern_lwp.c

Log Message:
Pull up following revision(s) (requested by gson in ticket #805):

sys/kern/kern_lwp.c: revision 1.192

PR/kern/53202: Kernel hangs running t_ptrace_wait:resume1 test, revert
previous.


To generate a diff of this commit:
cvs rdiff -u -r1.189.2.1 -r1.189.2.2 src/sys/kern/kern_lwp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7-0] src/sys/net/npf

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 19:03:48 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-7-0]: npf_alg_icmp.c npf_inet.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1605):

sys/net/npf/npf_inet.c: revision 1.45
sys/net/npf/npf_alg_icmp.c: revision 1.27-1.29

Fix use-after-free.

The nbuf can be reallocated as a result of caching 'enpc', so it is
necessary to recache 'npc', otherwise it contains pointers to the freed
mbuf - pointers which are then used in the ruleset machinery.
We recache 'npc' when we are sure we won't use 'enpc' anymore, because
'enpc' can be clobbered as a result of caching 'npc' (in other words,
only one of the two can be cached at the same time).
Also, we recache 'npc' unconditionally, because there is no way to know
whether the nbuf got clobbered relatively to it. We can't use the
NBUF_DATAREF_RESET flag, because it is stored in the nbuf and not in the
cache.
Discussed with rmind@.

Change npf_cache_all so that it ensures the potential ICMP Query Id is in
the nbuf. In such a way that we don't need to ensure that later.
Change npfa_icmp4_inspect and npfa_icmp6_inspect so that they touch neither
the nbuf nor npc. Adapt their callers accordingly.
In the end, if a packet has a Query Id, we set NPC_ICMP_ID in npc and leave
right away, without recaching npc (not needed since we didn't touch the
nbuf).
This fixes the handling of Query Id packets (that I broke in my previous
commit), and also fixes another possible use-after-free.

Ah, fix compilation. I tested my previous change by loading the kernel
module from the filesystem, but the Makefile didn't have DIAGNOSTIC
enabled, and the two KASSERTs I added did not compile properly.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.6.1 src/sys/net/npf/npf_alg_icmp.c
cvs rdiff -u -r1.32 -r1.32.6.1 src/sys/net/npf/npf_inet.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys

2018-05-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon May 14 17:34:26 UTC 2018

Modified Files:
src/sys/netinet: ip_input.c
src/sys/netinet6: ip6_input.c
src/sys/netipsec: ipsec.c ipsec.h ipsec6.h
src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Merge ipsec4_input and ipsec6_input into ipsec_ip_input. Make the argument
a bool for clarity. Optimize the function: if M_CANFASTFWD is not there
(because already removed by the firewall) leave now.

Makes it easier to see that M_CANFASTFWD is not removed on IPv6.


To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.201 -r1.202 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.163 -r1.164 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.81 -r1.82 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.28 -r1.29 src/sys/netipsec/ipsec6.h
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/librump/rumpnet/net_stub.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/netinet

2018-05-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon May 14 17:26:16 UTC 2018

Modified Files:
src/sys/netinet: ip_mroute.c

Log Message:
Don't crash if there is no inner IP header.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/netinet/ip_mroute.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch

2018-05-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 14 17:15:54 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h
src/sys/arch/arm/cortex: gtmr.c
src/sys/arch/arm/include: armreg.h

Log Message:
Workaround A-008585 errata in GTMR.

Register reads and writes may provide unstable results if the counter
hardware is active at the same time. This results in non-monotonic
counters seen by both the gtmr interrupt and time counter.

The loops are currently applied unconditionally, restricting them to
appropiate FDT markers can be applied later.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/arm/include/armreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/cortex

2018-05-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 14 17:11:38 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gtmr.c

Log Message:
Remove a number of debug #if 0s.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/cortex/gtmr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/cortex

2018-05-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 14 17:09:41 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gtmr.c gtmr_var.h

Log Message:
Remove unused gtmr_bootdelay.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/cortex/gtmr_var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/doc

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:21:48 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Tickets #1604 and #1605


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.88 -r1.1.2.89 src/doc/CHANGES-7.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7-1] src/doc

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:21:13 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Ticket #1605


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/doc/CHANGES-7.1.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7-0] src/doc

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:20:55 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Ticket #1605


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.103 -r1.1.2.104 src/doc/CHANGES-7.0.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7-1] src/sys/net/npf

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:17:19 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-7-1]: npf_alg_icmp.c npf_inet.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1605):

sys/net/npf/npf_inet.c: revision 1.45
sys/net/npf/npf_alg_icmp.c: revision 1.27-1.29

Fix use-after-free.

The nbuf can be reallocated as a result of caching 'enpc', so it is
necessary to recache 'npc', otherwise it contains pointers to the freed
mbuf - pointers which are then used in the ruleset machinery.
We recache 'npc' when we are sure we won't use 'enpc' anymore, because
'enpc' can be clobbered as a result of caching 'npc' (in other words,
only one of the two can be cached at the same time).
Also, we recache 'npc' unconditionally, because there is no way to know
whether the nbuf got clobbered relatively to it. We can't use the
NBUF_DATAREF_RESET flag, because it is stored in the nbuf and not in the
cache.
Discussed with rmind@.

Change npf_cache_all so that it ensures the potential ICMP Query Id is in
the nbuf. In such a way that we don't need to ensure that later.
Change npfa_icmp4_inspect and npfa_icmp6_inspect so that they touch neither
the nbuf nor npc. Adapt their callers accordingly.
In the end, if a packet has a Query Id, we set NPC_ICMP_ID in npc and leave
right away, without recaching npc (not needed since we didn't touch the
nbuf).
This fixes the handling of Query Id packets (that I broke in my previous
commit), and also fixes another possible use-after-free.

Ah, fix compilation. I tested my previous change by loading the kernel
module from the filesystem, but the Makefile didn't have DIAGNOSTIC
enabled, and the two KASSERTs I added did not compile properly.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.12.1 src/sys/net/npf/npf_alg_icmp.c
cvs rdiff -u -r1.32 -r1.32.10.1 src/sys/net/npf/npf_inet.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/sys/net/npf

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:16:04 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-7]: npf_alg_icmp.c npf_inet.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1605):

sys/net/npf/npf_inet.c: revision 1.45
sys/net/npf/npf_alg_icmp.c: revision 1.27-1.29

Fix use-after-free.

The nbuf can be reallocated as a result of caching 'enpc', so it is
necessary to recache 'npc', otherwise it contains pointers to the freed
mbuf - pointers which are then used in the ruleset machinery.
We recache 'npc' when we are sure we won't use 'enpc' anymore, because
'enpc' can be clobbered as a result of caching 'npc' (in other words,
only one of the two can be cached at the same time).
Also, we recache 'npc' unconditionally, because there is no way to know
whether the nbuf got clobbered relatively to it. We can't use the
NBUF_DATAREF_RESET flag, because it is stored in the nbuf and not in the
cache.
Discussed with rmind@.

Change npf_cache_all so that it ensures the potential ICMP Query Id is in
the nbuf. In such a way that we don't need to ensure that later.
Change npfa_icmp4_inspect and npfa_icmp6_inspect so that they touch neither
the nbuf nor npc. Adapt their callers accordingly.
In the end, if a packet has a Query Id, we set NPC_ICMP_ID in npc and leave
right away, without recaching npc (not needed since we didn't touch the
nbuf).
This fixes the handling of Query Id packets (that I broke in my previous
commit), and also fixes another possible use-after-free.

Ah, fix compilation. I tested my previous change by loading the kernel
module from the filesystem, but the Makefile didn't have DIAGNOSTIC
enabled, and the two KASSERTs I added did not compile properly.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.2.1 src/sys/net/npf/npf_alg_icmp.c
cvs rdiff -u -r1.32.2.2 -r1.32.2.3 src/sys/net/npf/npf_inet.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/sys/dev/ic

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:11:09 UTC 2018

Modified Files:
src/sys/dev/ic [netbsd-7]: hme.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1604):

sys/dev/ic/hme.c: revision 1.97

Fix mis-placed right paren.  kern/53271


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.90.2.1 src/sys/dev/ic/hme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-6] src/doc

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:08:15 UTC 2018

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket #1548


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.337 -r1.1.2.338 src/doc/CHANGES-6.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-6] src/sys/dev/ic

2018-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 14 16:07:06 UTC 2018

Modified Files:
src/sys/dev/ic [netbsd-6]: hme.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1548):

sys/dev/ic/hme.c: revision 1.97

Fix mis-placed right paren.  kern/53271


To generate a diff of this commit:
cvs rdiff -u -r1.87.2.1 -r1.87.2.2 src/sys/dev/ic/hme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libc/sys

2018-05-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon May 14 12:44:40 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace.c

Log Message:
Revert previous change in t_ptrace.c

By a mistake this file started to include 
This is not needed.

The include was intended to be add just in t_ptrace_wait.c.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_ptrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libc/sys

2018-05-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon May 14 12:42:34 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_amd64_wait.h

Log Message:
Simplify the x86_64_cve_2018_8897 ATF ptrace(2) test

Do not call _exit() from the child, ad this code shall not be reached.
Put there assert().

No functional change. The test still passes.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_ptrace_amd64_wait.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2018-05-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon May 14 09:21:36 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixv.c

Log Message:
 Fix panic or hangup when "sysctl -w hw.ixgN.debug=1".

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.