Commit Graph

296718 Commits

Author SHA1 Message Date
riastradh eaf33ef422 kern: Avoid arithmetic overflow in gettimeleft.
Sprinkle assertions in to verify we're monotonically counting the
time left down to zero.

Reported-by: syzbot+5f6a6329d139810dfe3c@syzkaller.appspotmail.com
2022-06-28 02:04:51 +00:00
riastradh 9515e06261 tcp(4): Bail early on sendoob if not connected.
XXX Not sure if testing tp->t_template is the right way to discern
this -- I just reached for it because the downstream crash is a panic
on tp->t_template == NULL in tcp_output.

XXX In principle this could try connecting to the address, except
it's not passed down from the logic in uipc_socket.c to tcp_sendoob.

Reported-by: syzbot+a01f4cfec72790855ce2@syzkaller.appspotmail.com
2022-06-28 01:44:19 +00:00
riastradh e7655ed829 fstrans(9): KASSERT(a && b) => KASSERT(a); KASSERT(b)
No functional change intended except better diagnostics in case of
crash.
2022-06-28 00:13:48 +00:00
riastradh c95f18c848 amd64: Handle __syscall trap frames specially too. 2022-06-27 23:36:48 +00:00
andvar 0e5bc969e0 fix various typos in comments. 2022-06-27 22:41:28 +00:00
andvar 517ecbe804 s/loobpack/loopback/ in comment. 2022-06-27 20:28:31 +00:00
riastradh 04d39af408 umidi(4): Fix fencepost in error branch.
Reported-by: syzbot+0bbf3d81c15fd1354759@syzkaller.appspotmail.com
2022-06-27 18:56:56 +00:00
christos 02e7c0b99a Enable FANCY mode for debugging purposes:
- To enable stand still mode (robot is not moving but waiting in place),
    specify a scorefile on the command line called <directory>/stand_still
  - To enable pattern roll mode (robot is changing which move to look first)
    specify a scorefile on the command line called <directory>/pattern_roll
2022-06-27 18:48:49 +00:00
christos ec01565c69 downgrade from LOG_ERR to LOG_DEBUG, requested by uwe@ 2022-06-27 16:44:58 +00:00
msaitoh a23cd0d208 KNF a little. No functional change. 2022-06-27 15:55:11 +00:00
msaitoh a66c184244 Add some MegaRAID devices (except Aero series). Not tested. 2022-06-27 15:38:19 +00:00
msaitoh 02d314e090 Regen. 2022-06-27 15:35:58 +00:00
msaitoh 445a47cefd Add some MegaRAID devices. 2022-06-27 15:35:23 +00:00
msaitoh 9d1358432e Add comment. Sort entries. No functional change. 2022-06-27 15:32:30 +00:00
martin 8f08765306 Fix editing mishap, should fix the build 2022-06-27 06:45:14 +00:00
riastradh c3bf6f9596 sendmsg(2): Avoid buffer overrun in ktrace of invalid cmsghdr.
Reported-by: syzbot+efded148140b23425f5c@syzkaller.appspotmail.com
2022-06-27 04:06:48 +00:00
riastradh 0e1986f662 ktrace(9): Make sure ktrkuser initializes the full ktr_id member.
strlcpy does not; strncpy does.  However, the member must be
NUL-terminated, because kdump uses it, e.g., with printf("%s"), so
expicitly set the last byte to NUL.

Possible fix for a host of sanitizer complaints in syzkaller.
2022-06-27 03:56:37 +00:00
knakahara 65b54797cc Remove confusable comment.
The comment was added in tcp_subr.c:r1.124 (2002/03/15).
tcp_drain() is called from softint context only, now.
2022-06-27 01:29:51 +00:00
riastradh 2699443359 setitimer(2): Avoid arithmetic overflow in periodic bookkeeping.
Reported-by: syzbot+93cef6090844ec304cde@syzkaller.appspotmail.com
2022-06-27 00:34:24 +00:00
riastradh ff733a254d opencrypto(9): Fix missing initialization in error branch.
Reported-by: syzbot+8c519140cac567be1ee1@syzkaller.appspotmail.com
2022-06-26 22:52:30 +00:00
riastradh 9bef90fe6e emdtv(4): More attach/detach bugs.
Reported-by: syzbot+9bbfb743349929e2c8c3@syzkaller.appspotmail.com
2022-06-26 22:49:09 +00:00
riastradh 36bb851c52 setitimer(2): Guard against overflow in arithmetic.
Reported-by: syzbot+6036bc8b6d2b963e3ba6@syzkaller.appspotmail.com
2022-06-26 22:31:58 +00:00
riastradh 54baa6cf23 kern: Use timespecsubok in ts2timo.
Should fix arithmetic overflow.

Reported-by: syzbot+4393a753a7c787abe6e2@syzkaller.appspotmail.com
2022-06-26 22:31:47 +00:00
riastradh 160a45aecc kern: New functions timespecaddok, timespecsubok.
Return false if timespecadd or timespecsub with the same arguments
would overflow (possibly in an intermediate calculation), true if OK.

Typical usage:

sys_wotsit(...)
{
	...
	if (!timespecsubok(x, y))
		return EINVAL;
	timespecub(x, y, xydelta);
	...
}
2022-06-26 22:31:38 +00:00
riastradh f26842077c amd64: Print effective syscall number for SYS_syscall stack traces.
This time with compile-testing, at least.
2022-06-26 22:31:12 +00:00
riastradh 9ba2bdaa37 Revert "amd64: Print effective syscall number for SYS_syscall stack traces."
Built the wrong kernel (arm64 is not amd64), oops.  Will redo.
2022-06-26 22:29:28 +00:00
riastradh fc12487158 amd64: Print effective syscall number for SYS_syscall stack traces. 2022-06-26 22:18:30 +00:00
riastradh 8ebaf25c47 route(4): Avoid unaligned access to struct rt_msghdr.
Reported-by: syzbot+e0048186a5cc97b1c5a6@syzkaller.appspotmail.com
2022-06-26 21:42:19 +00:00
riastradh 2b1f9e508e umcs(4): Reject invalid interrupt endpoints.
Reported-by: syzbot+cd1e60e112e840e40d0a@syzkaller.appspotmail.com
2022-06-26 21:35:53 +00:00
andvar 4b8fdc3b57 s/Ramdom/Random/ in comments. 2022-06-26 21:00:28 +00:00
tsutsui 755bba41cc Use aprint_*(9) for device attach messages. 2022-06-26 18:46:14 +00:00
riastradh 7feed94cb3 ldpd(8): Fix address of misaligned packed members.
PR kern/56895
2022-06-26 17:55:38 +00:00
riastradh a27b16dfba lagg(4): Safely handle misaligned mbufs.
Optimizing for non-strict-alignment architectures -- without falling
afoul of alignment sanitizers or overeager compilers -- is left as an
exercise for the reader.

PR kern/56894
2022-06-26 17:55:24 +00:00
riastradh fd8803f833 drm/ttm: Fix potential leak in error branch.
Not likely but let's not leave a rake to trip on.
2022-06-26 17:53:06 +00:00
riastradh 57b54f5ca4 arm/aes_neon: Fix formatting of self-test failure message.
Discovered by code inspection.  Remarkably, a combination of errors
made this fail to be a stack buffer overrun.  Verified by booting
with ARMv8.0-AES disabled and with the self-test artificially made to
fail.
2022-06-26 17:52:54 +00:00
skrll 1120ea0d7a Decorate the HPPA signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2022-06-26 14:37:12 +00:00
skrll d8ce3d4857 Teach the LLVM-derived unwinder about the DWARF pseudo-registers defined
by GCC for HPPA to hold the return address where the signal trampoline
will resume.  XXX Same treatment is needed for HPPA64, but not done as
part of this commit.

Thanks to thorpej for help with this. (ages ago)
2022-06-26 14:31:33 +00:00
tsutsui ae23d92f75 Unifdef __ELF__. 2022-06-26 14:14:46 +00:00
tsutsui 07dd92205f Consistently use "NetBSD/atari", not "NetBSD/Atari" on tertiary boot. 2022-06-26 14:08:15 +00:00
jmcneill a87250117a build fix: remove includes of opt_gic.h 2022-06-26 11:14:36 +00:00
rin 1ca2da5b85 Add SIGINFO support. Mostly stolen from scan_ffs(8). 2022-06-26 09:29:59 +00:00
martin 7ce098c867 cpu_reboot: use cpu_halt_others() instead of a (simple) open coded
version of it.
2022-06-26 09:23:32 +00:00
martin 9bd6d4f1a7 gcc is not smart enough to track the equivalence of conditions used
here and warns about an unused value - initialize "code" always.
2022-06-26 09:18:06 +00:00
martin 6a2f9c7852 Fix typo 2022-06-26 09:14:14 +00:00
rin b9429f260c PR toolchain/56268
For NetBSD/m68k, program header is erroneously readable from core dump,
although a page containing it is missing. This spoils relocation for
the main executable, and debugging with core dumps becomes impossible,
as described in the PR.

In order to avoid this failure, add consistency check for program header;
for NetBSD, 1st entry of program header refers program header itself. If
this is not the case, we should be reading random garbage from core dump.

Yes, this is a kind of the hackest hack. But, unable to debug with core
dump is critical. Therefore, I commit this workaround temporarily until
the real cause is found and fixed.

Note that this is not a recent regression for GDB nor kernel, as
mentioned in the PR. These from netbsd-8 and -9 fail in the same way
without this hack.
2022-06-26 08:28:07 +00:00
tsutsui 89d3f87095 Make local devsw functions static.
No visible regression on TT030.
2022-06-26 06:25:09 +00:00
tsutsui dca853ba03 Misc KNF and cleanup for readability. 2022-06-26 06:02:28 +00:00
rin 33bbb384fc PR port-powerpc/56899
Disable 128-bit long double for NetBSD/powerpc.
2022-06-26 05:55:30 +00:00
rin 85b2a9ecdc PR port-powerpc/56899
In addition to ``powerpc'', register NetBSD OS ABI also for ``rs6000'',
which is default target for powerpc.
2022-06-26 05:52:43 +00:00
rin 5900762b3f Regen for everyone, except for coldfire, for which toolchain does
no longer build...

> Part of PR port-powerpc/56899
>
> Set default OS ABI to NetBSD when target is *-*-netbsd*.
>
> This fixes default behaviors of GDB when no executable is loaded
> (== OS ABI is not determined yet).
2022-06-26 05:48:06 +00:00