Commit Graph

280241 Commits

Author SHA1 Message Date
thorpej
9f195b2aba - compare_{le,lt)(): Use float64_{le,lt}_quiet() to avoid raising
exceptions on QNaNs.
- alpha_fp_interpret(): Instructions are 32-bits wide, so don't use a
  uint64_t to contain them.
- alpha_fp_complete(): Operations on NaNs trap on Alpha, but the exception
  summary reports INV (invalid operation) rather than SWC (software
  completion) in this case.  So also interpret the instruction if INV
  is set in the exception summary.  This will emulate operations on
  NaN and correctly suppress FP traps for QNaNs.

This fixes bin/55633, which was caused by:

  -> Input string "nanotime" is passed to awk's internal is_number().
  -> strtod() interprets as "nan" and returns QNaN as the result.
  -> Result compared against HUGE_VAL, blows up because cmptle is called
     with a NaN operand, and the hardware doesn't care that it's quiet.
2020-09-01 08:22:36 +00:00
msaitoh
121c2aad9d Fix a panic on shutdown on a machine which use the recovery mode timer.
The recovery mode timer is first issued by the callout and it schedule
the workqueue. The workqueue then reschedule the callout. It's hard to
stop both of them without race only with callout_stop() and workqueue_wait.
To solve this problem. add new "detaching" flag and use it.

 The situation is almost the same as schedule_wqs_ok for the local_timer's
callout and workqueue, but the difference is that the local_timer isn't
required to run if the interface is not up. If it's not important to prevent
running timer while !IFF_UP, the flag can be integrated into one.
2020-09-01 04:19:16 +00:00
msaitoh
b600995833 Call ixgbe_ifstop() instead of ixgbe_stop_locked() in
ixgbe_setup_low_power_mode() to stop the timer workqueue.
2020-09-01 04:06:56 +00:00
uwe
4895509f32 Improvements from Dan Plassche. 2020-09-01 01:15:28 +00:00
christos
85da8872cb eat the sign, pointed out by uwe@ 2020-09-01 00:35:29 +00:00
christos
d21092d46f check explicitly for inf and nan. We can't check if it is a number,
because awk parses 1a as 1...
2020-09-01 00:21:01 +00:00
christos
4b14471916 Add a check_number function that does what is repeated in many places in
the code, but better.
2020-08-31 23:37:55 +00:00
christos
8871000030 Don't try so hard to convert strings into numbers. Results in bogus
conversions like:

% awk 'BEGIN { print "nanotime" + 123 }'
nan
% awk 'BEGIN { print "microtime" + 123 }'
123
% awk 'BEGIN { print "inftime" + 123 }'
inf
2020-08-31 23:36:58 +00:00
riastradh
fa197dbf76 wg: Avoid memory leak if socreate fails. 2020-08-31 20:34:43 +00:00
riastradh
9ccb9ca69e wg: Make it build with WG_DEBUG on 32-bit platforms. 2020-08-31 20:34:18 +00:00
riastradh
d1a81d3157 wg: Simplify locking.
Summary: Access to a stable established session is still allowed via
psref; all other access to peer and session state is now serialized
by struct wg_peer::wgp_lock, with no dancing around a per-session
lock.  This way, the handshake paths are locked, while the data
transmission paths are pserialized.

- Eliminate struct wg_session::wgs_lock.

- Eliminate wg_get_unstable_session -- access to the unstable session
  is allowed only with struct wgp_peer::wgp_lock held.

- Push INIT_PASSIVE->ESTABLISHED transition down into a thread task.

- Push rekey down into a thread task.

- Allocate session indices only on transition from UNKNOWN and free
  them only on transition back to UNKNOWN.

- Be a little more explicit about allowed state transitions, and
  reject some nonsensical ones.

- Sprinkle assertions and comments.

- Reduce atomic r/m/w swap operations that can just as well be
  store-release.
2020-08-31 20:33:58 +00:00
riastradh
4131d8f567 tests/net/if_wg: Allow one second of leeway for rekey. 2020-08-31 20:32:58 +00:00
riastradh
566d0c30dc wg: M_NOWAIT -> M_DONTWAIT
These happen to be aliases, but M_NOWAIT is part of the legacy malloc
API whereas M_DONTWAIT is part of the mbuf API.
2020-08-31 20:31:43 +00:00
riastradh
3ea30ceaf5 wg: wg_sockaddr audit.
- Ensure all access to struct wg_peer::wgp_endpoint happens while
  holding a psref.

- Simplify internalize/externalize logic and be more careful about
  verifying it before printing anything.
2020-08-31 20:31:03 +00:00
riastradh
993b555422 wg: On INIT, do DH and decrypt timestamp before locking session.
This narrows the window when the session is unlocked.  Really there
should be no such window, but we'll finish getting rid of it later.
2020-08-31 20:30:34 +00:00
riastradh
375c658faf wg: Verify or send cookie challenge before looking up session.
This step doesn't depend on the session, so let's avoid touching the
session state until we've passed it.
2020-08-31 20:29:14 +00:00
riastradh
f25326ab88 wg: Verify mac1 as the first step on INIT and RESP messages.
This avoids the expensive DH computation before the sender has proven
knowledge of our public key.
2020-08-31 20:27:06 +00:00
riastradh
b9cc45ec1f wg: Omit needless variable. 2020-08-31 20:26:46 +00:00
riastradh
f0e0eb88b7 wg: Switch to callout_stop for session destructor timer.
Can't release the lock here, and can't sleep waiting for the callout
while we hold it without risking deadlock.  But not waiting is fine;
after we transition out of WGS_STATE_UNKNOWN the timer has no effect.
2020-08-31 20:26:21 +00:00
riastradh
01e85b3e6c wg: Fix indentation. No functional change. 2020-08-31 20:25:33 +00:00
riastradh
cee9c1f171 wg: Just call callout_halt directly.
No functional change, just makes it easier to read where callout_halt
happens.
2020-08-31 20:25:11 +00:00
riastradh
9b47d5fd6f wg: Fix byte order on wire.
Give this a chance to work on big-endian systems.
2020-08-31 20:24:49 +00:00
riastradh
5dfb9270fc wg: mbuf m_freem audit.
1. wg_handle_msg_data frees m but the other wg_handle_msg_* just take
   a pointer to the mbuf content and not m itself, so free m in those
   cases.

2. Can't trivially prove that the pcq is empty by the time
   wg_destroy_peer runs pcq_destroy, so let's explicitly purge it
   just in case.

3. If wg_send_udp isn't doing udp_send or udp6_output, it still has
   to free m in the !INET6 error branch for IPv6 packets.

4. After rumpuser_wg_send_peer or rumpuser_wg_send_user, we still
   need to free the mbuf.
2020-08-31 20:24:19 +00:00
riastradh
2ca0f50d6d wg: Use thmap(9) for peer and session lookup.
Make sure we also don't trip over our own shoelaces by choosing the
same session index twice.
2020-08-31 20:23:56 +00:00
riastradh
aced4ea104 thmap: Use keyed BLAKE2s for second-level hash and beyond.
This thwarts hash-flooding, but pays the cost only for those keys
that collide under the cheaper murmurhash2.
2020-08-31 20:22:57 +00:00
riastradh
b73dc92dda wg: XAEAD doesn't use a counter, so don't pass one. 2020-08-31 20:21:30 +00:00
riastradh
3655877610 wg: Count down wg_npeers in wg_destroy_all_peers too.
Doesn't actually make a difference -- wg_destroy_all_peers is only
used when we're destroying the wg instance altogether -- but let's
not leave rakes to step on.
2020-08-31 20:21:09 +00:00
riastradh
7ec1face32 wg: Note lock order. 2020-08-31 20:20:48 +00:00
riastradh
4bf5fd0b75 wg: Remove IFF_POINTOPOINT.
Unclear why this was set; setting it seems to have required a kludge
in netinet/in.c that broke ipsec tunnels.  Clearing it makes wg work
again after that kludge was reverted.
2020-08-31 20:20:22 +00:00
rillig
7a2f02b40d make(1): move some of the :ts tests into a separate file
The successful cases can be easily tested in the .if conditions.  Around
these conditions, there is enough space for explaining the test cases
and their purpose.

The failure cases have been left in the file for now since they still
produce unwanted characters in the output.  These characters are not
produced when the parse error occurs in a conditional.
2020-08-31 19:58:21 +00:00
christos
67653226d1 PR/55629: Andreas Gustafsson: Don't crash when an emulation does not provide
e_dtrace_syscall (like compat_netbsd32)
2020-08-31 19:51:30 +00:00
rillig
32c7ea9694 make(1): inline a local variable in VarUniq
Just to eliminate any remote possibility of aliasing and thereby
forgetting to update all involved variables.
2020-08-31 19:09:19 +00:00
rillig
411604f9db make(1): add more examples to the documentation of ParseModifierPart 2020-08-31 19:05:53 +00:00
rillig
a91afb0520 make(1): extend the documentation for the test variants 2020-08-31 18:57:41 +00:00
macallan
c909aa453b defparam and use ADBKBD_LAYOUT, default to KB_US|KB_APPLE for tradition 2020-08-31 17:54:18 +00:00
macallan
f711ae1618 behave like USB keyboards - KB_US uses ctrl-alt-Fn, KB_APPLE variant uses
Command-Fn
2020-08-31 17:51:56 +00:00
rillig
faae3ee83c make(1): fix the :u modifier, which was broken for almost a day
Big thanks go to sjg, who discovered the bug and did the main work to
track it down.

In the unit tests for the :u modifier from the previous commit, I had
forgotten to actually add the :u modifier at the end.  I added it now
and also added a few other tests.  It's better to have a few more tests
than too few.
2020-08-31 17:41:38 +00:00
rillig
c119b05bf3 make(1): add test for the currently broken :u variable modifier
The :u modifier had been broken in var.c 1.479 from 2020.08.30.19.56.02.
The code that implements the :u modifier was well-covered in the unit
tests, except for the single line that actually deals with adjacent
duplicate words.

The "refactoring" commit that replaced brk_string with Str_Words had not
taken into account that the number of words (in ac) had to be passed to
WordList_JoinFree.  Instead, the number of words was always preserved,
and the words at the end were therefore duplicated in the result.

The fix for this bug will be in the follow-up commit.
2020-08-31 17:32:13 +00:00
rillig
28423acec1 make(1): document the purpose of the test variants 2020-08-31 17:25:29 +00:00
rillig
93031f070d make(1): add test driver for different build options
This program's purpose is to reduce the build failures of the whole
build.sh just because one of the many possible configurations fails.
2020-08-31 16:51:17 +00:00
rillig
490b9ed0a1 make(1): fix compilation for -DNDEBUG and -O3
The -O3 option of GCC 5.5 is unsure about whether s and t are always
defined, since SuffParseTransform only defines them if it returns TRUE.

Therefore assert that it does.  When compiled with -NDEBUG, this would
result in an unused variable, therefore use it using the well-known
cast-to-void pattern.
2020-08-31 16:44:25 +00:00
rillig
38e9e4c9c6 make(1): improve documentation for Buffer fields 2020-08-31 16:42:10 +00:00
rillig
1b001ba380 make(1): fix compilation with GCC 8 2020-08-31 16:41:19 +00:00
sjg
95f6f1e60d Add test case for FLAGS dependent on .TARGET 2020-08-31 16:20:00 +00:00
christos
ac669aab65 Unlike done() childwait() returns, found by clang. 2020-08-31 15:32:15 +00:00
msaitoh
8a46808207 Rename ix{gbe,v}_stop() with ix{gbe,v}_stop_locked(). No functional change. 2020-08-31 14:12:50 +00:00
martin
fb1355a7bc Skip timeout tests, pointing to PR 55632. 2020-08-31 14:03:56 +00:00
bouyer
6e9b47ae29 Add back <xen/xenio3.h>, it's needed by xentools413 2020-08-31 11:32:01 +00:00
msaitoh
167aba13e5 If an SFP+ module is not inserted, don't try to access SFP+ EEPROM.
This change eliminate long timeout.

 Reduce code duplication using with ixgbe_sfp_cage_full(hw).
2020-08-31 11:19:54 +00:00
rillig
90a952c9c5 make(1): fix copy-and-paste mistake for compiling with GCC10 2020-08-31 06:44:12 +00:00