259119 Commits

Author SHA1 Message Date
wiz
244692fac0 Remove superfluous Pp. 2018-05-31 07:37:45 +00:00
pgoyette
c5a4053b92 Fix a typo in the example properties 2018-05-31 07:36:25 +00:00
maxv
85add8c74c Disable draft_00 in racoon, discussed on tech-net@ and now in PR/53334.
While here clarify the comments, no #undef.

No need to increase the library version I guess, since draft_00 is not
used in libipsec.
2018-05-31 07:16:16 +00:00
maxv
f645db7adb Remove support for non-IKE markers in the kernel. Discussed on tech-net@,
and now in PR/53334. Basically non-IKE markers come from a deprecated
draft, and our kernel code for them has never worked.

Setsockopt will now reject UDP_ENCAP_ESPINUDP_NON_IKE.

Perhaps we should also add a check in key_handle_natt_info(), to make
sure we also reject UDP_ENCAP_ESPINUDP_NON_IKE in the SADB.
2018-05-31 07:03:57 +00:00
maxv
ec343e4518 Constify ipseczeroes, and remove one use of it. 2018-05-31 06:25:41 +00:00
maxv
80da173622 Add a comment and a KASSERT. I remember wondering whether this check was a
problem, since ARC4 has a blocksize of one. Normally ARC4 can't be used in
IPsec.
2018-05-31 06:14:18 +00:00
maxv
824196ce25 style 2018-05-31 05:52:09 +00:00
mrg
a37025c593 introduce MKFIRMWARE that controls where (most) of the contents
of /libdata/firmware and /usr/libdata/firmware are not installed
if set to "no".  from the bsd.README:

MKFIRMWARE      If "no", install the /libdata/firmware directory,
		which is necessary for several drivers: athn(4), bwfm(4),
		ipw(4), iwi(4), iwm(4), iwn(4), otus(4), rtwn(4), urtwn(4),
		wpi(4), ral(4), rum(4), run(4), zyd(4), bcm43xx(4), and
		the Tegra 124 SoC.
		Default: yes on amd64, cobalt, evbarm evbmips, evbppc, hpcarm,
		hppa, i386, mac68k, macppc, sandpoint, and sparc64, no elsewhere.

convert MKRADEONFIRMWARE and MKTEGRAFIRMWARE into FOO.arch lists,
and move their defaults above the general defaults setting.

saves about 12MB in a normal installation for other platforms.
2018-05-31 05:27:45 +00:00
msaitoh
91615b8df2 Fix the bit location of SSBD in the macro for snprintb. 2018-05-31 03:29:01 +00:00
msaitoh
a013b7ec80 Regen. 2018-05-31 02:50:37 +00:00
msaitoh
c25a9c6d49 - Add some Intel 82965 devices.
- Change Intel 0x2a06 from IDE to IDER
2018-05-31 02:50:14 +00:00
ozaki-r
122cb40f7f Relax a lock check in if_mcast_op unless NET_MPSAFE
It seems that there remain some paths that don't satisfy the constraint that is
required only if NET_MPSAFE.  So don't check it by default.

One known path is nd6_rtrequest => in6_addmulti => if_mcast_op, which is not
easy to address.
2018-05-31 02:10:23 +00:00
kamil
391c8a1797 Fix build with MKCATPAGES=yes
zpool-features.8 -> zpool-features.0
2018-05-31 00:25:38 +00:00
kamil
edd6979004 Simplify comparison of two processes
No need to check p_pid to compare whether two processes are the same.

No functional change intended.

Sponsored by <The NetBSD Foundation>
2018-05-30 23:54:03 +00:00
uwe
51b70d0925 Avoid widowed signal numbers. 2018-05-30 23:41:44 +00:00
uwe
7f402ed8d4 Shorten pleonastic "by the tty driver tty(4)". 2018-05-30 23:24:13 +00:00
mrg
114ca20a4a use FIRMWAREDIR instead of hard coded /libdata/firmware. 2018-05-30 20:54:06 +00:00
maxv
d52acbb31e Correctly handle the padding for IPv6-AH, as specified by RFC4302. Seen in
a FreeBSD bug report, by Jason Mader.

The RFC specifies that under IPv6 the complete AH header must be 64bit-
aligned, and under IPv4 32bit-aligned. That's a rule we've never respected.
The other BSDs and MacOS never have either.

So respect it now.

This makes it possible to set up IPv6-AH between Linux and NetBSD, and also
probably between Windows and NetBSD.

Until now all the tests I made were between two *BSD hosts, and everything
worked "correctly" since both hosts were speaking the same non-standard
AHv6, so they could understand each other.

Tested with Fedora<->NetBSD, hmac-sha2-384.
2018-05-30 18:02:40 +00:00
kamil
6abbe0506f Add a comment for the workaround in trigger_bus()
Explain PROT_READ|PROT_WRITE.
2018-05-30 17:48:13 +00:00
kamil
398835f368 Make the trigger_bus() test compatible with more CPUs (at least ALPHA)
If we write a byte character into a pointer, a compiler can emit a
read-modify-write operation, especially when a CPU cannot access directly
a character wide address.

In this scenario calling mmap(2) with PROT_WRITE, without PROT_READ will
emit unexpected trap.

There are two possible workarounds for this issue:
 - write register wide memory without rmw sequence,
 - mark the region with additional protection PROT_READ

Both work for NetBSD/alpha.

Go for the latter as perhaps more safe for dump compilers emitting rmw
sequences.

Investigated by <martin>
2018-05-30 17:31:34 +00:00
maxv
7aac0885cf Introduce ah_authsiz, which computes the length of the ICV only. Use it in
esp_hdrsiz, and clarify.

Until now we were using ah_hdrsiz, and were relying on the fact that the
size of the AH header happens to be equal to that of the ESP trailer.

Now the size of the ESP trailer is added manually. This also fixes one
branch in esp_hdrsiz: we always append an ESP trailer, so it must always
be taken into account, and not just when an ICV is here.
2018-05-30 17:17:11 +00:00
maxv
de1c7e1421 Apply the previous change in esp_input too, same as esp_output. 2018-05-30 16:49:38 +00:00
maxv
f4ab40f822 Remove dead code, 'espx' is never NULL and dereferenced earlier, so no need
to NULL-check all the time.
2018-05-30 16:43:29 +00:00
maxv
173a0d4a18 Simplify the padding computation. Until now 'padlen' contained the ESP
Trailer (two bytes), and we were doing minus two all the time.

Declare 'tlen', which contains padlen+ESP_Trailer+ICV, and use 'struct
esptail' instead of hardcoding the construction of the trailer. 'padlen'
now indicates only the length of the padding, so no need to do -2.
2018-05-30 16:32:26 +00:00
maxv
bc40d0f4f9 Rename padding -> padlen, pad -> tail, and clarify. 2018-05-30 16:15:19 +00:00
ryoon
02db46494a Remove double and trailing whitespaces 2018-05-30 13:20:39 +00:00
msaitoh
e41f381b01 Add hw.ixgN.debug sysctl. "sysctl -w hw.ixgN.debug=1" dumps some registers
to console.
2018-05-30 09:17:17 +00:00
msaitoh
d7b75ca1c5 Clear que->disabled_count in {ixgbe,ixv}_init_locked(). Without this,
interrupt mask state and EIMS may mismatch and if_init doesn't recover
from TX/RX stall problem.

 This change itself doesn't fix PR#53294.
2018-05-30 08:35:26 +00:00
kre
64d884c8fc The bytes_transfer_piod_read_auxv test uses 4096 for the size param
to bytes_transfer() which asserted that the size is < the size of 512 AuxInfo
structs.   On a 32 bit system, an AuxInfo is 8 bytes, and 512 AuxInfo
structs is thus 4096 bytes, and 4096 is not < 4096, so the assertion
failed.   It would probably work as a <= assert, but I am not confident
enough with this test case to make that call, so instead increase the
array size to be 513 instead, 4096 is < 513*8 so happiness should return
and all should be right with the world.   At least for this one test.
(There was no problem on 64 bit systems as AuxInfo is bigger there.)
2018-05-30 05:09:11 +00:00
kamil
be7413dae4 Harden PT_ATTACH in ptrace(2)
Don't allow to PT_ATTACH from a vfork(2)ed child (before exec(3)/_exit(3))
to its parent. Return error with EPERM errno.

This scenario does not have a purpose and there is no clear picture how to
route signals.

Sponsored by <The NetBSD Foundation>
2018-05-29 23:34:18 +00:00
zafer
85d69259a9 Add AltGr modifier for brazilian abnt2 keymap.
Fixes PR misc/50147 by Vicente Chaves.
2018-05-29 19:45:31 +00:00
maxv
14fc7e2d6a Fix an XXX of mine, be clearer about what we're doing. Basically we want to
preserve the fragment offset and flags. That's necessary if the packet
we're fragmenting is itself a fragment.
2018-05-29 17:21:57 +00:00
kamil
926e9b7f23 Introduce new example kernel module: panic_string
The panic_string module accepts input from a device file over the write(2)
system call.

It prints panic(9) message passed from user space, e.g.:

   echo "Hello world" > /dev/panic

If a string is empty or contain only whitespaces it's ignored and panic(9)
is not triggered. If a non printable character is passed within the input
buffer, the rest of the string is ignored.

This module performs the sync(8) operation before panic(9) to flush cache.

Submitted by Harry Pantazis.
Simplified and cleaned up by myself.
2018-05-29 16:53:56 +00:00
maxv
4b1bee9844 Strengthen and simplify, once more. 2018-05-29 16:50:38 +00:00
maxv
90aec87ff9 Remove aarp_clean, unused. By the way this function was probably buggy
since it didn't reset aat_hold to NULL.
2018-05-29 16:29:47 +00:00
maxv
375907a025 Remove an XXX of mine, actually it's fine. While here also remove a
misleading printf.
2018-05-29 16:24:34 +00:00
maxv
055894c4bc Remove dead code, we don't care. 2018-05-29 16:21:30 +00:00
martin
b30263c2e7 Use proper forward declaration for kmutex_t. This makes MKDTRACE=no builds
work again.
2018-05-29 14:29:53 +00:00
martin
351fd74422 Ooops, backout previous - it was an update build artifact (or something) 2018-05-29 13:10:28 +00:00
ryoon
8728d020f4 Remove trailing tab 2018-05-29 11:38:24 +00:00
martin
2e95568bb1 Backout previous: "typedef void *kmutex_t;
is incompatible with our kmutex_t and breaks the build. ZFS will need
to find a better way to work around this.
2018-05-29 11:18:50 +00:00
kamil
fa04ee6693 Add new ATF ptrace(2) tests verifying crash signal handling
Add new tests:
 - traceme_crash_trap
 - traceme_crash_segv
 - traceme_crash_ill (temporarily disabled)
 - traceme_crash_fpe
 - traceme_crash_bus
 - unrelated_tracer_sees_crash_trap
 - unrelated_tracer_sees_crash_segv
 - unrelated_tracer_sees_crash_ill (temporarily disabled)
 - unrelated_tracer_sees_crash_fpe
 - unrelated_tracer_sees_crash_bus

These tests verify two subtle kernel paths that differ internally:
 - for a tracer that is a parent of a traced program (and not vforked)
   real parent == tracer
 - for a tracer that is an unrelated process of a traced program
   real parent != tracer

Regressions in the signal code can cause to break one of the scenarios, and
keep working the other one. It might be propagated to a scenario like:
 - attaching to a process with a debugger (over pid)
 - starting a process inside a debugger

We can assert on the ATF level that both will be functional.

While there, cover all the crash signals as testing is done practically
for free. While the Machine Independent signal routing code for crash
signals is mostly the same in the kernel, we can verify whether Machine
Dependent parts works as expected emitting the proper signal number and
signal code (si_code).

There have been already caught an unexpected behavior on Alpha, that
instead of SIGBUS we receive SIGSEGV.

Another benefit is that it's easier to catch races, as they pop up more
frequently. (This already helped to catch bugs more quickly)

These tests will help assert correctness of future kernel changes in the
signal routines.

All tests pass.

Sponsored by <The NetBSD Foundation>
2018-05-29 10:40:54 +00:00
ozaki-r
25ec1e8354 Fix non-INET6 builds 2018-05-29 09:25:44 +00:00
reinoud
2dccb90aac Only report the things we've passed in the mcontext and leave out flags that
are not reported in the mcontext anyway!
2018-05-29 09:25:01 +00:00
prlw1
5c4807153d Mark in6m as used for non-DIAGNOSTIC builds. 2018-05-29 09:10:39 +00:00
wiz
b41d19c5ae Remove superfluous Pp. 2018-05-29 08:37:33 +00:00
maxv
4b9322a057 Replace KASSERT by m_pullup. While the ethernet header is always there
when the packet was received on a physical interface, it may not be if
the packet was received over L2TP/EtherIP.

In particular, if the inner ethernet header ends up on two separate IP
fragments. Here the KASSERT is triggered, and on !DIAGNOSTIC we corrupt
memory.

Note that this is a widespread problem: a lot of L2 code was written with
the assumption that "most" headers are present in the first mbuf.
Obviously, that's not true if L2 encapsulation is being used.
2018-05-29 08:24:59 +00:00
reinoud
d5f4676544 Implement cpu_lwp_setprivate(). This removes the need for the cpu_switch()
hack.

Programs with TLS work fine now, including gdb!
2018-05-29 07:35:39 +00:00
reinoud
8ed4e5c044 Only set requested parts of the mcontext in cpu_setmcontext()
Make the atomic switcher `atomic' by using splhigh()
2018-05-29 07:09:21 +00:00
jdolecek
b478cbed47 fix off-by-one in the mapping of the ISA DMA page registers, they actually
start at 0x81; the code used bus_space_map() starting from 0x80 but
used +1 offset for actual I/O, now it maps starting 0x81 and does I/O
without offset

the reads and writes work exactly the same as before, but this frees
0x80 for being mapped independantly

patch provided in PR kern/52468 by Jonathan Chapman; checked against the spec
and also FreeBSD sys/x86/isa/isa_dma.c
2018-05-29 06:14:33 +00:00