259013 Commits

Author SHA1 Message Date
kamil
497013ad4b Add new ATF tests: t_fork and t_vfork
Test behavior of raise(signal) in either fork(2)ed or vfork(2)ed child.

Tests:
 - raise1 SIGKILL
 - raise2 SIGSTOP
 - raise3 SIGTSTP
 - raise4 SIGTTIN
 - raise5 SIGTTOU
 - raise6 SIGABRT
 - raise7 SIGHUP
 - raise8 SIGCONT

t_vfork:raise2 fails ignoring non-maskable SIGSTOP.

The remaining ones pass.

Sponsored by <The NetBSD Foundation>
2018-05-18 06:39:58 +00:00
reinoud
99570477d4 Include our doctored types.h instead of the default 2018-05-18 05:51:23 +00:00
jmcneill
6ee8a75883 Set SUNXI_CCU_NM_DIVIDE_BY_TWO on mmc module clocks. There is an
undocumented post divider between the clock and mmc module.
2018-05-18 02:03:00 +00:00
jmcneill
480fd0a841 MMC clock source is the pll_periph's 2X output. 2018-05-18 01:52:58 +00:00
kamil
ed68aafd9d Correct assert in ATF t_zombie test
A failure is reported with -1, not 1.

Sponsored by <The NetBSD Foundation>
2018-05-18 00:25:30 +00:00
jmcneill
8fce728dbb Enable MMC HS200 on sun50i-a64 2018-05-17 23:07:47 +00:00
macallan
8408938098 really fix the fix 2018-05-17 19:08:51 +00:00
reinoud
88b5c3a09d Don't dynamically allocate memory we are only going to use once; so allocate
it on the stack.

While here, also include some more sanity checks.
2018-05-17 19:06:02 +00:00
reinoud
0767c295b1 Refactor for easier debugging and while here add some more signals 2018-05-17 19:00:39 +00:00
maxv
a9684b9a92 Fix the KASSERTs. It doesn't matter at all since the packet can't be this
big anyway, and there are many other places that have this kind of typo;
but still fix it, for the sake of closing PR/49834.
2018-05-17 12:07:48 +00:00
maxv
a127c0ebdb Add KASSERTs, related to PR/39794. 2018-05-17 11:59:36 +00:00
nat
c9be6b645f Fix a typo with sc_out/inports when setting the hardware recording gain on the
mix ring.  Found by mrg@

XXX pullup-8
2018-05-17 11:35:31 +00:00
ryo
c22bb30a9d allow to execute cache operation (DC CVAU,DC CIVAC, DC CVAC, IC IVAU) from userland. 2018-05-17 08:24:28 +00:00
maxv
68981e0ca6 Remove reference to tcpiphdr in comment. 2018-05-17 07:30:13 +00:00
wiz
36ad4ce7a8 Remove Tn for standard abbreviations. 2018-05-17 06:37:06 +00:00
thorpej
e832c294bb Default NFS mounts to using TCP transport instead of UDP.
PR kern/53166
2018-05-17 02:34:31 +00:00
macallan
6f84763bba special case IPIs so we don't mess with hardware IRQ sources
now SMP works on my PCI-X G5
2018-05-16 21:54:38 +00:00
joerg
33bc134aba Avoid complicated arithmetic involving NULL. 2018-05-16 20:21:39 +00:00
jakllsch
84b24ad8f1 During awaitkey(), move the cursor back to the beginning of the
countdown with '\b' only after waiting.

Some UEFI implementations have a destructive/erasing backspace,
and will not show the countdown if we move the cursor back before the
wait.

My ThinkPad T430 w/ Lenovo's UEFI exhibited this whiteout-backspace,
while my Gigabyte Brix GB-BXBT-2807 did not.

Should fix PR #53292.
2018-05-16 19:53:54 +00:00
jakllsch
cdb4519d6a Enable the appropriate memory or I/O space decode in the PCI
Command/Status Register upon mapping a BAR.

This should fix PR #53286.  It's also possible there are other similar
PRs that might be fixed by this.
2018-05-16 19:02:00 +00:00
maxv
dc20722125 Fix compilation on Xen. 2018-05-16 16:33:23 +00:00
joerg
ed9315c55a Improve type safety by using the correct enum values. 2018-05-16 13:55:39 +00:00
joerg
28f297b902 Annotate mixing of enums from different types with an explicit cast. 2018-05-16 13:54:48 +00:00
joerg
da40fa177a Cast enum explicitly to different type. 2018-05-16 13:54:03 +00:00
joerg
9a7065646c Remove obsolete register keywords from C++ code. 2018-05-16 13:53:28 +00:00
reinoud
fe9820e716 Regen usermode headers 2018-05-16 12:40:43 +00:00
reinoud
7dc3fd8f06 Add new mcontext and depends to the usermode generated headerfiles 2018-05-16 12:40:26 +00:00
jmcneill
779f22703a Add mic preamp controls and unswap L/R DAC channels to ADC mixer 2018-05-16 10:23:43 +00:00
jmcneill
bf8204f8cf Delete whitespace, NFC 2018-05-16 10:22:54 +00:00
jmcneill
b1d0e248b3 Set AUDIO_PROP_INDEPENDENT. 2018-05-16 10:15:20 +00:00
ryo
6fd2c10eb6 Fix memory leak. it was leaking one page every pmap_create().
pm->pm_vmlist must be initialized before calling _pmap_alloc_pdp().
2018-05-16 08:32:07 +00:00
maxv
741ad80355 Mitigation for CVE-2018-8897 on i386. Contrary to amd64 there is no clear
way to determine if we are in kernel mode but with the user context; so we
go the hard way, and scan the IDT.

On i386 the bug is less of a problem, since we don't have GSBASE. All an
attacker can do is panicking the system.
2018-05-16 08:16:36 +00:00
msaitoh
46830cfe8c Whitespace fix. No functional change. 2018-05-16 08:08:24 +00:00
msaitoh
768f4f0e0d Fix a problem that the watchdog timer sometimes mistakenly fires. Restore
TX sending check in the end of ixgbe_txeof which was wrongly removed in
ix_txrx.c rev. 1.42.
2018-05-16 07:51:17 +00:00
kamil
ea78951cdc Add extra asserts in three ATF ptrace(2) tests
In traceme* tests after validate_status_stopped() include additional check
the verify the received signal with PT_GET_SIGINFO.

All tests passes.

Sponsored by <The NetBSD Foundation>
2018-05-16 03:52:35 +00:00
kamil
fee84111f1 Improve the description of traceme_vfork_breakpoint (ATF ptrace(2) test)
Sponsored by <The NetBSD Foundation>
2018-05-16 03:18:38 +00:00
kamil
98c4cd6bac Add a new ATF ptrace(2) test: traceme_vfork_exec
Verify PT_TRACE_ME followed by exec(3) in a vfork(2)ed child.

This tests passes correctly.

Sponsored by <The NetBSD Foundation>
2018-05-16 02:47:25 +00:00
kamil
983fb9900d Improve the description of traceme_vfork_raise in ATF ptrace(2) tests
Set new description to:
 - "Verify PT_TRACE_ME followed by raise of " #sig " in a vfork(2)ed "
   "child"

The previous one was copy pasted from a different ATF test and not changed.

Sponsored by <The NetBSD Foundation>
2018-05-16 01:36:29 +00:00
kamil
78ed479f2f Add a new ATF ptrace(2) test: traceme_vfork_breakpoint
Verify software breakpoint in a vfork(2)ed child.

The expected behavior is not to route this signal to the parent, even if
that parent is a tracer. The parent cannot handle it and it would lead to
the deadlock.

This test passes correctly.

Sponsored by <The NetBSD Foundation>
2018-05-16 01:27:27 +00:00
kamil
108bf35cd1 Correct handling of: vfork(2) + PT_TRACE_ME + raise(2)
Follow the FreeBSD approach of not routing signals to the parent that is
a became tracer after calling PT_TRACE_ME by the vfork(2)ed child (before
exec(3)/exit(3)).

Now if a child calls raise(3), the signal is processed directly to this
child.

Add new ATF ptrace(2) tests:
 - traceme_vfork_raise1 (SIGKILL)
 - traceme_vfork_raise2 (SIGSTOP) // temporarily disabled
 - traceme_vfork_raise3 (SIGABRT)
 - traceme_vfork_raise4 (SIGHUP)
 - traceme_vfork_raise5 (SIGCONT)

The FreeBSD implementation introduces P_PPTRACE for this special case.
Right know keep opencoding check of this case in the kernel. It might be
refactored in future.

The Linux kernel does not follow this approach and causes dead locking of
the processes (parent and child).

Defer handling SIGSTOP into future.

This is an intermediate step towards correct handling of fork(2) and
vfork(2) in the context of ptrace(2).

All new tests pass.
There are no regressions in existing ATF ptrace(2) tests.

Sponsored by <The NetBSD Foundation>
2018-05-16 00:42:15 +00:00
jmcneill
39e8f1a4a0 Rename mic1 control to mic so audiorecord can use it 2018-05-16 00:12:57 +00:00
maxv
fbb9ed35f8 When reassembling IPv4/IPv6 packets, ensure each fragment has been subject
to the same IPsec processing. That is to say, that all fragments are ESP,
or AH, or AH+ESP, or none.

The reassembly mechanism can be used both on the wire and inside an IPsec
tunnel, so we need to make sure all fragments of a packet were received
on only one side.

Even though I haven't tried, I believe there are configurations where it
would be possible for an attacker to inject an unencrypted fragment into a
legitimate stream of already-decrypted-and-authenticated fragments.

Typically on IPsec gateways with ESP tunnels, where we can encapsulate
fragments (as opposed to the general case, where we fragment encapsulated
data).

Note, for the record: a funnier thing, under IPv4, would be to send a
zero-sized !MFF fragment at the head of the packet, and manage to trigger
an ICMP error; M_DECRYPTED gets lost by the reassembly, and ICMP will reply
with the packet in clear (not encrypted).
2018-05-15 19:16:38 +00:00
nat
82b545a2e8 Fix over cautious compiler error - setmode may not be initialized. 2018-05-15 10:23:03 +00:00
jmcneill
5bd370cfb7 Build fix for FDT kernels without audio 2018-05-15 10:17:55 +00:00
msaitoh
b349c72b56 The TQSMR register is not for receiving but for transmitting, so move the
initialization from ixgbe_initialize_receive_units() to
ixgbe_initialize_transmit_units(). No functional change.
2018-05-15 09:30:56 +00:00
wiz
853ea0cab6 Various improvements, more markup, typo fixes. 2018-05-15 09:30:01 +00:00
wiz
5233fcf201 Remove Tn. 2018-05-15 09:13:36 +00:00
nat
71f2adc779 Use the correct tag options. 2018-05-15 04:25:25 +00:00
thorpej
c98f5f31c8 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.
2018-05-15 02:02:18 +00:00
thorpej
d1b2b146ab 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.
2018-05-15 01:53:27 +00:00