Commit Graph

249132 Commits

Author SHA1 Message Date
mrg
ba6321fe7f build fixes and updates for libxcb / xcb-proto 1.12. 2017-03-05 09:27:52 +00:00
maxv
dcfa345c83 Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.

On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.

However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.

Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.

With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.
2017-03-05 09:08:18 +00:00
maxv
778a84e641 Should be PG_k, doesn't change anything. 2017-03-05 08:36:35 +00:00
mrg
d279eec2b8 install libsync.h. new in libdrm 2.4.75. 2017-03-04 23:24:50 +00:00
mrg
18912d7579 define HAVE_STRLCPY. 2017-03-04 23:23:21 +00:00
bouyer
39e4ed2971 Try to be smarted in the rx path: if the packet is small enough copy the
data to the mbuf's data area instead of allocating a new page from the pool.
While there fix a struct xennet_rxreq leak if xennet_checksum_fill()
fails with ENOMEM.
2017-03-04 19:11:01 +00:00
njoly
5e0724b3f9 Fix {clock,pthread}_getcpuclockid to return an error number on
failure, to match OpenGroup specifications.
2017-03-04 11:16:33 +00:00
jakllsch
0d9606d5f1 Fix up OFW_DEBUG printfs, particularly regarding newlines and error cases. 2017-03-04 01:29:27 +00:00
palle
b18d99202a sun4v: Fixed PR 51554 - Avoid unsafe allocation in ldc/vdsk 2017-03-03 21:09:25 +00:00
mrg
0f2a619001 define HAVE_ARC4RANDOM_BUF. 2017-03-03 20:48:02 +00:00
jakllsch
c634706878 Add check during mvsdio_attach that CMD line is in idle state.
If the CMD line is not in idle state, the interrupt handler routine will
misbehave causing an endless interrupt handler loop.  This would prevent
the the kernel from getting to mountroot.

On my Pogoplug POGO-V4-A3-01, this was caused by U-Boot routing com1's TX
and RX signals to the SD card slot's CMD and DAT[0] lines respectively.

We should probably grow Marvell SoC MPP (pinmux) configuration frobs.
2017-03-03 16:52:08 +00:00
knakahara
3b864806d6 fix r1.492 bug, sorry 2017-03-03 16:48:55 +00:00
kre
1cd3fe6ea7 Since it is unlikely that any of this really wants to test whether
[v]fork() produces pid==1 (init) (if it were useful to test that, an
entirely different test would be appropriate) change the tests so
they check for [v]fork() failure, as probably intended, instead.
2017-03-03 12:23:26 +00:00
wiz
fdc74d1a1d Improve wording and formatting.
New sentence, new line.
Fix typo.
2017-03-03 11:36:20 +00:00
knakahara
70c816d80b add WM_RX_PROCESS_LIMIT_DEFAULT and WM_RX_INTR_PROCESS_LIMIT_DEFAULT description
pointed out by pgoyette@n.o, thanks.
2017-03-03 10:44:25 +00:00
nonaka
face8f0c90 efiboot: fix efivar command. 2017-03-03 09:29:57 +00:00
knakahara
44ae67faf0 implement AIM(Adaptive Interrupt Moderation), but not enable yet.
Currently, it causes performance degration if enabled.
More ITR calcuration tuning is required...
2017-03-03 07:57:49 +00:00
knakahara
495b9e44cf make kernel config option WM_RX_PROCESS_LIMIT_DEFAULT and WM_RX_INTR_PROCESS_LIMIT_DEFAULT
e.g. if
    - WM_RX_PROCESS_LIMIT_DEFAULT is set 0
    - WM_RX_INTR_PROCESS_LIMIT_DEFAULT is set -1 (means almost infinite)
that means wm(4) does not use polling mode.
2017-03-03 07:38:52 +00:00
ozaki-r
8155a2ae5c Provide a more robust regexp for time formats of 1day-ish 2017-03-03 07:34:04 +00:00
knakahara
ae5f0e6023 implement polling mode for multiqueue. It can suppress performance degration at high load.
e.g. I354 IP forwarding throughput performance
    + before
      - 133Mbps forwarding performance at 200Mbps input load
      - 41Mbps forwarding performance at 800Mbps input load
    + after
      - 150Mbps forwarding performance at 200Mbps input load
      - 150Mbps forwarding performance at 800Mbps input load
2017-03-03 07:32:36 +00:00
ozaki-r
2495e7a0c7 Pass inpcb/in6pcb instead of socket to ip_output/ip6_output
- Passing a socket to Layer 3 is layer violation and even unnecessary
- The change makes codes of callers and IPsec a bit simple
2017-03-03 07:13:06 +00:00
kamil
20b74e97d9 TODO.ptrace: Remove entry about addition of TRAP_SCE and TRAP_SCX
These siginfo(2) codes have been committed.
2017-03-03 07:11:49 +00:00
kamil
5147fe4e0c Add new entry in TODO.ptrace about QPassSignals
Added:
   support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to
   stop routing a set of signals to tracer as they are uninteresting - GDB and
   LLDB expect this feature
2017-03-03 07:03:11 +00:00
msaitoh
f71865e18b Add missing opt_net_mpsafe.h. 2017-03-03 06:27:20 +00:00
msaitoh
418e1bb3d4 Set PCI_INTR_MPSAFE, SOFTINT_MPSAFE, CALLOUT_MPSAFE and IFEF_START_MPSAFE
if NET_MPSAFE is defined.
2017-03-03 04:37:05 +00:00
knakahara
8f35265a4d IFEF_START_MPSAFE flag should be set only if WM_MPSAFE defined. some refactor.
pointed out and suggested by msaitoh@n.o, thanks.
2017-03-03 03:33:44 +00:00
mrg
29bcf0191f avoid using %s in UVMHIST. 2017-03-02 20:11:19 +00:00
christos
a262455532 remove debugging abort that makes tests fail. 2017-03-02 15:43:14 +00:00
kamil
e663963d4a Add new entry in TODO.ptrace about PT_STEP with a signal
Added:
  GDB Remote Protocol expects a case with a step with a signal to be sent,
  this is currently unsupported on NetBSD
2017-03-02 14:25:41 +00:00
hannken
a57a3961af Add an operation to test a mount for fstrans support and use it for
_fstrans_start(), fstrans_done(), fstrans_is_owner(), vfs_suspend()
and vfs_resume().

Test for fstrans support before ASSERT_SLEEPABLE().
2017-03-02 10:41:27 +00:00
ozaki-r
f27f4e283c Plug a race condition on accessing i6mm_maddr 2017-03-02 09:48:20 +00:00
ozaki-r
362a23cbc0 Fix racy in6m_sol
Relook up the entry instead of reusing it, which makes locking simple.
2017-03-02 09:16:46 +00:00
msaitoh
c96e148c62 Fix a problem that m_defrag() isn't called in if_transmit path. Now both
if_start and if_transmit do m_defrag() correctly. This change improves the
performance of TSO.
2017-03-02 05:35:01 +00:00
ozaki-r
030b9751dc Protect ia_allhosts by in_ifaddr_lock 2017-03-02 05:31:04 +00:00
ozaki-r
d0c11d0872 Make sure imo_membership is protected by inp's lock (solock) 2017-03-02 05:29:31 +00:00
ozaki-r
549f799fbf Protect ia6_memberships by in6_ifaddr_lock 2017-03-02 05:27:39 +00:00
ozaki-r
3e6e186e8a Make sure im6o_memberships is protected by in6p's lock (solock) 2017-03-02 05:26:24 +00:00
ozaki-r
36ae5d22b0 Make usages of ifp MP-safe in some functions of IP multicast 2017-03-02 05:24:23 +00:00
msaitoh
3b94ce3722 Fix a bug that TSO doesn't work correctly. This bug was added in
ix_txrx.c rev. 1.17.
2017-03-02 04:33:56 +00:00
nonaka
f6bba051d1 drmkms_pci: Use MSI if available (Take 2)
tested by martin@ and yhardy@
2017-03-02 04:31:51 +00:00
snj
f90bed86ca CardBus capitalization police 2017-03-02 01:10:21 +00:00
ozaki-r
0b2f4040ea Use LIST_* macros
No functional change.
2017-03-02 01:05:02 +00:00
christos
e6016d46a9 ifdef reduction 2017-03-02 00:43:40 +00:00
hannken
08fe30ea3a Make compile again without "options WAPBL".
From John D. Baker via current-users@, slightly modified by me.
2017-03-01 21:55:07 +00:00
skrll
35c97a0f45 Set xscale_cache_clean_addr appropriately and re-arrange default KVA
layout to allow direct map for all boards.

OVERO/DUOVERO/PEPPER aren't tested.

PR/52010: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT ram_size
2017-03-01 16:44:54 +00:00
sjg
1b370898b9 loadfile: in the mmap case ensures that the buffer ends with \n
do the same for the non-mmap case - avoids core dump.
2017-03-01 16:39:49 +00:00
skrll
668e93fe49 Fix compile... is this right? 2017-03-01 16:27:25 +00:00
kre
6087ee4af9 Improve appearance (a little) when read with nroff, rather than troff 2017-03-01 13:05:11 +00:00
skrll
1036908cdb Can't profile ras_atomic_cas_noupdate 2017-03-01 11:54:53 +00:00
hannken
f36a76571a Protect genfs_getpages() against vnodes disappearing during a
forced mount update from read-write to read-only.
2017-03-01 10:47:26 +00:00