Commit Graph

257291 Commits

Author SHA1 Message Date
maxv 54954d76d2 Fix wrong order; first enable WP, then enable interrupts. Otherwise we
might get an interrupt before re-enabling WP, and be rescheduled as a
result. In practice it never happens, because the previous PSL always
has interrupts disabled too.
2018-03-13 16:52:42 +00:00
maxv b454699f28 Mmh, add a missing x86_disable_intr(). My intention there was to ensure
interrupts were disabled before the barriers.
2018-03-13 16:45:52 +00:00
maxv 76b851610b Mmh, put back the RFC6946 check (about dummy fragments), otherwise NPF
is not happy in npf_reassembly, because NPC_IPFRAG is again returned after
the packet was reassembled.

I'm wondering whether it would not be better to just remove the fragment
header in frag6_input directly.
2018-03-13 16:23:40 +00:00
kamil a9dda15d6e ATF: Add new test race1 in t_ptrace_wait*
Reuse the attach1's test body for race1.

Add a new test race1:
  Assert that await_zombie() in attach1 always finds a single
  process and no other error is reported

race1 requires HAVE_PID in wait(2)-like function.

This test is executed in a loop for 5 seconds (16k iterations on Intel i7).
A buggy kernel was asserting an error within this timeframe almost always.

The bug in the kernel is now gone and this test is expected to pass
correctly.

Sponsored by <The NetBSD Foundation>
2018-03-13 14:54:13 +00:00
kamil c6513ba7ad ATF t_ptrace_wait*: Disable debug messages in msg.h
msg.h is a dummy IPC interface.

Disable additional debugging logging here, especially wanted in race*
tests.

Sponsored by <The NetBSD Foundation>
2018-03-13 14:45:36 +00:00
kamil 8fa6ff479d Add a new function in ATF t_ptrace_wait*: await_zombie_raw()
Add await_zombie_raw() that is the same as await_zombie(), whith an
addition of additional "useconds_t ms" parameter indicating delays between
new polling for a zombie process.

This new function will be used for testing a race condition that has been
observed occassionally crashing a test case -- returning duplicate entries
for KERN_PROC_PID.

Sponsored by <The NetBSD Foundation>
2018-03-13 13:34:40 +00:00
maxv 84ba156ea5 Fix two consecutive mistakes.
The first mistake was npf_inet.c rev1.37:

	"Don't reassemble ipv6 fragments, instead treat the first fragment
	as a regular packet (subject to filtering rules), and pass
	subsequent fragments in the same group unconditionally."

Doing this was entirely wrong, because then a packet just had to push
the L4 payload in a secondary fragment, and NPF wouldn't apply rules on
it - meaning any IPv6 packet could bypass >=L4 filtering. This mistake
was supposed to be a fix for the second mistake.

The second mistake was that ip6_reass_packet (in npf_reassembly) was
getting called with npc->npc_hlen. But npc_hlen pointed to the last
encountered header in the IPv6 chain, which was not necessarily the
fragment header. So ip6_reass_packet was given garbage, and would fail,
resulting in the packet getting kicked. So basically IPv6 was broken by
NPF.

The first mistake is reverted, and the second one is fixed by doing:

-			hlen = sizeof(struct ip6_frag);
+			hlen = 0;

Now the iteration stops on the fragment header, and the call to
ip6_reass_packet is valid.

My npf_inet.c rev1.38 is partially reverted: we don't need to worry
about failing properly to advance; once the packet is reassembled
npf_cache_ip gets called again, and this time the whole chain should be
there.

Tested with a simple UDPv6 server - send a 3000-byte-sized buffer, the
packet gets correctly reassembled by NPF now.
2018-03-13 09:04:02 +00:00
ryo 1d7345fd9c fix compile error (variable set but not used) 2018-03-13 06:41:53 +00:00
ryo f3b490eb68 fix build error. add options __HAVE_CPU_UAREA_ALLOC_IDLELWP for MULTIPROCESSOR 2018-03-13 06:21:59 +00:00
ryo 449cb354a6 fix build error. need midi* for umidi 2018-03-13 06:21:22 +00:00
ryo 87501bba52 fix build error. if no usb, don't define USB_DEBUG 2018-03-13 06:20:41 +00:00
ryo 25c58f1dc3 fix compile error (unused variables) 2018-03-13 06:19:30 +00:00
ryo 2baafe6908 fix compile error 2018-03-13 06:18:47 +00:00
ryo 1cb6351b40 fix compile error (printf format) 2018-03-13 06:18:17 +00:00
knakahara a0d17a179a Enhance assertion ipsecif(4) ATF to avoid confusing setkey(8) error message.
When setkey(8) says "syntax error at [-E]", it must mean get_if_ipsec_unique()
failed.
2018-03-13 03:50:26 +00:00
mrg 7b319e81c3 fix the cleanfiles for hooks mechanism 2018-03-13 03:17:01 +00:00
mrg 76c587cf23 add the generated prog.conf.5 to CLEANFILES. 2018-03-13 03:07:51 +00:00
mrg 6e029617f0 add *template.x to CLEANFILES. 2018-03-13 03:06:51 +00:00
mrg c62ada779a include bsd.clean.mk so that we actually clean up the attempted "params" 2018-03-13 03:06:28 +00:00
knakahara e7acdb682b comment out confusing (and incorrect) code and add comment. Pointed out by maxv@n.o, thanks. 2018-03-13 03:05:12 +00:00
mrg f0a3006c1d use CLEANFILES+= not CLEANFILES= to avoid overriding what was already
setup before now.
2018-03-13 03:03:33 +00:00
kamil a1788664a1 Make sysctl_doeproc() more predictable
Swap the order of looking into zombie and all process lists, start now
with the zombie one. This prevents a race observed previously that the
same process could be detected on both lists during a single polling call.

While there:
 - Short-circuit break for KERN_PROC_PID, once a pid has been detected.
 - Removal of redundant "if (kbuf)" and "if (marker)" checks.
 - Update of comments regarding potential optimization, explaining why we
   don't want to it as of now. Performance gain from lookup call vs
   iteration over a list is neglible on a regular system.
 - Return ESRCH when no results have been found. This allows more easily
   to implement a retry or abandon algorithm.

This corrects races observed in the existing ATF ptrace(2) tests, related
to await_zombie(). This function was expecting to check whether a process
has been transformed into a zombie, however it was causing occasional
crashes as it was overflowing the return buffer, returning the same pid
twice: once from allproc list and the second time from zombieproc one.

Fix suggested by <christos>
Short-circuit break suggested by <kre>

Discussed on tech-kern.

Sponsored by <The NetBSD Foundation>
2018-03-13 02:24:26 +00:00
mrg d28ac4e2bc add missing pcfwrite.c. 2018-03-13 02:23:28 +00:00
mrg 0955925eb7 clean up CRUNCHBIN.map 2018-03-13 02:22:43 +00:00
knakahara 51a1e9f49e Fix IPv6 ipsecif(4) ATF regression, sorry.
There must *not* be padding between the src sockaddr and the dst sockaddr
after struct sadb_x_policy.
2018-03-13 02:12:05 +00:00
mrg cbb4749bb3 update for new amdgpu and radeon driver versions. 2018-03-12 18:48:49 +00:00
maxv 473744b505 Remove dead branches, 'npc' can't be NULL (and it is dereferenced
earlier).
2018-03-12 12:45:26 +00:00
pgoyette 2461f62e8b Remove exgtraneous comma 2018-03-12 11:56:34 +00:00
wiz 2458e695f0 Remove Tn. 2018-03-12 09:29:43 +00:00
msaitoh 40af7057a9 AMD L3 cache association bitfield is not 8bit but 4bit like others association
bitfields.
2018-03-12 07:35:45 +00:00
msaitoh d536bc686b s/CLFUSH/CLFLUSH/
No functional change.
2018-03-12 07:12:54 +00:00
msaitoh 928f98ab1c Add 3way and 6way of L2 cache or TLB on AMD CPU. 2018-03-12 06:20:33 +00:00
christos 68ed0ec4e8 improve previous, use getprogname() to get the invocation name. 2018-03-12 01:15:00 +00:00
khorben 0b9ecbe221 Reflect the new name of vndconfig(8) in the usage screen
vnconfig(8) was renamed to vndconfig(8) in NetBSD 7. While the manual page
now defaults to vndconfig, the usage screen still referred to the old name.
2018-03-12 01:10:25 +00:00
dholland ab87b60207 Explicitly mention use of -- for format strings beginning with -,
per PR 21970.
2018-03-12 00:42:05 +00:00
christos 42004fe06d sort, add missing lint file 2018-03-11 23:49:39 +00:00
joerg aa18a61198 Stub out on platforms without ifunc support in the linker. 2018-03-11 21:20:22 +00:00
mrg 2f4e8debbd regen these files for xkeyboard-config 2.23.1. 2018-03-11 20:17:19 +00:00
christos e9e7b01807 undo previous; breaks the build. handle inside flex. 2018-03-11 18:32:43 +00:00
christos cf5485362c don't need sys/cdefs.h if tool. 2018-03-11 18:32:10 +00:00
kre 0ec94bd49e Make a comment meaningful. ie: s/Ditto/what it was copying/ (more or less)
That is, there was a comment "Ditto" - which once upon a time, was used
to indicate the the previous comment applied here as well.   Time passed,
and software mutated, and the previous comment was unfortunately sacrificed.

Poor little Ditto was left all alone.

Noticed while doing some software archaeology.
2018-03-11 15:13:05 +00:00
christos ecaf5f24ed deal with cvs meta-data directories not called CVS. 2018-03-11 14:59:41 +00:00
maxv e11a6c86b3 Explain the TSC drift thing. 2018-03-11 13:38:02 +00:00
tih 62971bca43 Add myself. 2018-03-11 11:48:39 +00:00
mrg cbcc8121fa mark fontcache files as obsolete. 2018-03-11 11:34:33 +00:00
mrg b3255b1841 20180311:
bdftopcf was updated and may need cleaning in the
	src/external/mit/xorg/tools/bdftopcf subdirectory if there are
	link errors.
2018-03-11 11:18:06 +00:00
mrg 2cca8ab520 move the src list from libXfont stuff to local stuff. 2018-03-11 11:01:07 +00:00
mrg 45c2b575db update for bdftopcf 1.4.0. 2018-03-11 10:48:38 +00:00
mrg be73d44615 fix libXfont2 sources list. update for xfs 1.2.0. 2018-03-11 10:17:10 +00:00
hans ccac921152 Fix build of tools/lex on platforms lacking sys/cdefs.h by including
nbtool_config.h in tools/compat/regex.h. Tested on illumos.
2018-03-11 10:14:04 +00:00