Commit Graph

300293 Commits

Author SHA1 Message Date
ryo 65f9de9e0d commonize case block 2023-04-02 18:15:24 +00:00
ryo 60536c5379 don't pass add=1 to print_tree() when displaying by specifying nodes.
For example, "sysctl -w kern.mbuf=" had been displayed extra node names in the MIB.
 # sysctl -w kern.mbuf=
 kern.mbuf.mbuf.msize = 512
 kern.mbuf.mbuf.mclbytes = 2048
 :
2023-04-02 18:11:26 +00:00
christos db9593b63a switch gdb to gdb.old 2023-04-02 15:06:06 +00:00
mlelstv 1531b9a73e Add support for USB Audio Class 2.0. 2023-04-02 14:43:35 +00:00
mlelstv f143cd16be Add code for USB Audio Class 2.0.
This is only half of the game as UAC2 devices tend to use 24bit or 32bit
samples. This requires more support in audio(4).
2023-04-02 14:42:55 +00:00
skrll 85c3279dc2 Trailing whitespace 2023-04-02 07:26:17 +00:00
dholland d3728fec90 Fix lying comment. 2023-04-01 23:44:11 +00:00
christos 7f63469776 PR/57313: Timo Buhrmester: Don't bail if "." cannot be opened. From FreeBSD 2023-04-01 15:57:20 +00:00
mlelstv ca400598ed Also report precision from hwinfo. 2023-04-01 12:41:02 +00:00
rillig 5f84f05b9b libkvm: suppress lint warnings about extern declarations for now
This should be properly fixed by someone who is familiar with libkvm, as
it affects <sys/cpu_data.h> as well.
2023-04-01 09:08:11 +00:00
skrll 5e2a829c5f 0x%p -> %p in KASSERTMSGs 2023-04-01 06:30:19 +00:00
jschauma 8fb989fd32 +PIR (private information retrieval) 2023-04-01 00:59:10 +00:00
yamaguchi 4487631a49 Fix wrong variable names
This fixes build errors in virtio_mmio.c
2023-03-31 23:34:23 +00:00
riastradh 85f16c8847 mbuf(9): Sprinkle KASSERTMSG.
No functional change intended.
2023-03-31 19:22:56 +00:00
kre 2ae4426183 Correct the previous (change both "2023b" -> "2023c" not just one in the
dup & correct).
2023-03-31 19:10:11 +00:00
kre b441acd260 tzdata updated to 2023c (2023cgtz). 2023-03-31 19:09:08 +00:00
kre 27a443d8b7 Merge tzdata2023c 2023-03-31 19:05:28 +00:00
kre df4d5524c0 Import tzdata2023c from https://github.com/JodaOrg/global-tz/releases/download/2023cgtz/tzdata2023cgtz.tar.gz
Summary of changes in tzdata2023c (2023-03-28 12:42:14 -0700):

   This essentially reverts the 2023b update, as the proposed delay
   of the start of summer time in Lebanon didn't end up happening as
   intended.   What did happen was apparently chaos ... the official
   start of summer time was still delayed, but only until last Wednesday
   night (between 2023-03-29 and 2029-03-30) - which has already passed.

   Since it is unclear what local time was actually observed during
   the period between when summer time was originally planned to start
   (last Sat night, between 2023-03-25 and 2023-03-26) and when it
   officially did, for now, this update simply reverts to the original
   start time (2023-03-26 00:00:00 local).   Should that turn out to
   be sub-optimal, a later update can correct it.   Only timestamps
   for the period between 2023-03-26 00:00:00 and 2023-03-30 00:00:00
   are affected.
2023-03-31 19:03:06 +00:00
riastradh 5d38fb5bca spkr(4): Avoid some overflow issues.
XXX pullup-8
XXX pullup-9
XXX pullup-10

Reported-by: syzbot+1a9980f3631bbd710ded@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=ea851fc4688cbac29a567cb49a4fd24d9afff426

Reported-by: syzbot+b4655f9c1734f886d610@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=b61236df29f595e38b12ee533b7b3275c8ec1865
2023-03-31 15:00:26 +00:00
rillig ce2e717784 lint: allow querying for octal integer constants 2023-03-31 13:03:05 +00:00
yamaguchi 37b0b4baae Added flags to store status of attaching a virtio device
This prevents a panic on reboot after a virtio device had called
virtio_child_attach_failed().
2023-03-31 07:34:26 +00:00
yamaguchi 367194206f Use descriptor chain for free slots instead of vq_entry list
Descriptors can be chained by themself. And descriptors added to
avail ring or used ring are already chained. But it was not used
for unused descriptors and another linked list structure named
vq_entry was used.
The chain is also used for unused descriptors to make virtio(4)
simpler.
2023-03-31 07:31:48 +00:00
riastradh 285e4be122 openssl: Omit local comment.
May be helpful explanation but it didn't make its way upstream,
whereas the file has moved and had other upstream changes, so let's
make the next merge less painful.

No functional change intended.
2023-03-31 06:05:51 +00:00
rillig cb5396addb libpuffs: ignore lint warning about nested extern for now
This should be properly fixed by someone familiar with puffs.
2023-03-31 04:51:32 +00:00
mrg 54cb695492 bump XORG_SERVER_TEENY. 2023-03-30 23:05:12 +00:00
riastradh 65885579e5 atalk(4): Omit spurious satosat.
The input is already a struct sockaddr_at pointer.
2023-03-30 17:48:10 +00:00
riastradh d425b16c66 sockaddr_alloc(9): Avoid uninitialized buffer in sockaddr_checklen.
Manifests only under DIAGNOSTIC because the DIAGNOSTIC check itself
uses an uninitialized buffer.

Reported-by: syzbot+54b120643dfd6edc2318@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=afb5b6e5da6e806aeb7fddcf1d03c3262f6fc765
2023-03-30 15:58:21 +00:00
riastradh 4813aab66c atalk(4): Don't let userland control sa_len when adding addresses.
- The struct sockaddr_at object accessed by at_ifinit always comes
  from an ioctl buffer that is adequately sized and fully initialized
  from userland memory.

- The newly created sockaddr_at object is later used with
  sockaddr_copy, which requires sa_len to be correctly initialized.

- sa_len is not generally required to be correctly initialized by
  userland in most entry points (with some exceptions, e.g. gif(4)
  configuration).

I don't know whether existing userland programs initialize sa_len
correctly; if they do, we can verify it matches sizeof(struct
sockaddr_at), but there's no need to copy sa_len then if it is
verified to be that fixed value.

Reported-by: syzbot+fb4e112846e31bc4c09d@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=6e511f97443d681b8917c6258d6463b28b36e8c9

Reported-by: syzbot+dce8a2b69dc06d9d6115@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=e521a01ced5d0bbd363e998b81bc29f3282fd75f

Reported-by: syzbot+705a2a35990549b12c8d@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=b9147d4070e1d240acd27155ce1f863997175517

Reported-by: syzbot+b9c649832cc9b1fdc7d6@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=d5c9ad3d43042ec6e9f7bd30e13a37205e7e0373

Reported-by: syzbot+ac4ab136ca76e8152218@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=349c0c4eded3eff1ff5fc2cd2d88b42806e08a47

Reported-by: syzbot+b75c731d20e46e9543e9@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=e014d790e218797e217dd590ebe5a3a89e65b627

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-03-30 15:58:10 +00:00
riastradh 4dbf8e0c85 libc: Define __atomic_is_lock_free.
Limited to architectures where it is actually needed by gcc for any
calls to stdatomic.h atomic_is_lock_free for now.

We should also add it to other architectures too, along with lockful
atomic r/m/w operations for sizes that can't be handled natively, but
that's a lot more work.  It is also necessary for -fno-inline-atomics
but we're missing a lot of other symbols for that too, to be fixed.
For now, this should enable the OpenSSL build to complete on these
architectures again after I reverted a local change.

XXX pullup-10
2023-03-30 15:03:35 +00:00
riastradh f9fd253c05 atalk(4): Don't abuse queue(9) internals. 2023-03-30 11:21:08 +00:00
riastradh df6e87d701 raidframe: Nix unused parameter to raidwrite_component_area.
All calls use the same value.  Prune dead branches using it.
2023-03-30 11:02:15 +00:00
riastradh 9a8042f57d style(5): Forbid extern in .c files.
Discussed on tech-userlevel (bcc tech-kern):
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
2023-03-30 10:39:30 +00:00
uwe e0b356926e systat(1): try to give this page a quick facelift
... too bad what it really needs is reconstructive surgery.  I tried
to fix the most obvious problems (unsorted lists, obviously wrong
markup, pleonastic wording that drowns out useful information in
repetition and lifetime supply of quote marks).

This page really needs a native speaker to take some loving care of it.
2023-03-29 21:44:35 +00:00
kre fffcd3e6b6 PR misc/57305 from Nan Xiao
Be consistent with method (and style) when referring to the mbufs and
ifstat sub-commands when describing what is available (and correct
"mbuf" to be "mbufs" which is what the internal command really is).

That is don't just "double quote" one and 'single quote' the other.
2023-03-29 19:40:18 +00:00
christos 40f1ca5508 PR/57288: Mingye Wang: <ssp/ssp.h>: Use __builtin_dynamic_object_size
for LLVM > 9 and GCC > 12, introducing _SSP_FORTIFY_LEVEL == 3
2023-03-29 13:37:10 +00:00
riastradh 0871060bc5 openssl: Remove local micro-optimization on AMD (but not Intel).
Upstream OpenSSL changed

	loop 1b

to

	dec %rcx
	jnz 1b

which has mostly the same semantics, in this change:

https://github.com/openssl/openssl/pull/4743

For some reason, in one of the OpenSSL updates, we ended up with a
local change to revert this.

The Intel and AMD optimization guides are silent on the LOOP
instruction, but Agner Fog's tables shows that while LOOP is one
cycle shorter than DEC;JNZ on AMD Zen microarchitectures, it is a
good half dozen cycles longer than DEC;JNZ on recent Intel
microarchitectures.

The history of the OpenSSL change suggests it was intended, and I
can't find any indication other than `merge conflicts' that we
intended to keep the LOOP version.  So let's reduce the local diff by
nixing it.
2023-03-29 13:07:46 +00:00
kardel 619690a502 use carp mac address when replying to neighbor solicitations referring
to carp interface addresses.
unconfuses commercial routers
2023-03-29 13:01:44 +00:00
riastradh 0a26078547 openssl: Omit local indentation diff in mips bignum assembly.
Cute as it is to write the an instruction in a delay slot with an
extra space, it's not really useful to keep this around as a local
change since the substantive change was applied upstream years ago.
2023-03-29 10:29:09 +00:00
riastradh 64606f3c6f openssl: Omit needless sprintf->snprintf under OPENSSL_SYS_WIN32.
Much as I'm happy to eliminate sprintf, there's very little value to
maintaining a local change under an #ifdef that will never, ever be
taken on NetBSD.

Verified libcrypto.so does not sprout any references to sprintf as a
result.
2023-03-29 10:25:11 +00:00
riastradh 86d3010405 openssl: Omit needless #ifdef notyet around __atomic_is_lock_free.
At the time this was done, our gcc version did not have it, but now
it does, so let's reduce the local diff.
2023-03-29 10:21:27 +00:00
riastradh 59e2a3aa76 openssl: Omit needless #include <inttypes.h> in mem_clr.c.
This was needed back when the file was patched locally to cast a
pointer to intptr_t rather than to int, but that code is now gone and
the include is no longer necessary.  So let's reduce the local diff
by omitting this unnecessary change.
2023-03-29 10:19:39 +00:00
riastradh e34dbb0364 openssl: Revert local patch around fileno(stdin/stdout).
According to the commit history, this was introduced when gcc4.5
complained about using the return value of fileno without checking it
against -1.  gcc 10.4 no longer appears to object, so let's just nix
the local patch.
2023-03-29 10:18:50 +00:00
riastradh 964b90baf6 virtio(4): Use flexible array members, not zero-length arrays.
This enables the compiler to detect sizeof mistakes like
PR kern/57304.
2023-03-29 09:45:05 +00:00
riastradh 31edf7b5b5 virtio(4): Fix sizing of virtqueue allocation.
vq->vq_avail[0].ring is a zero-length array, and thus sizeof is zero;
likewise vq->vq_used[0].ring.

Use vq->vq_avail[0].ring[0] and vq->vq_used[0].ring[0] to fix this
and restore the previous allocation sizing logic.

XXX We shouldn't use zero-length arrays here -- they are asking for
trouble like this, and C99 has a standard way to express what we're
actually trying to get at it, flexible array members.

PR kern/57304

Reported-by: syzbot+7fb1047f5dfa33b26331@syzkaller.appspotmail.com
2023-03-29 09:44:25 +00:00
andvar abfbdcf24d s/ourput/output/ in comment. 2023-03-28 20:10:01 +00:00
rillig d0a5c1bc3c lint: warn about 'extern' declarations inside function bodies
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html

The previous attempt (message 351 about 'extern' declarations outside
headers) did not cover the proposal from the tech-userlevel mailing list
but instead warns about a different usage pattern of the 'extern'
keyword.
2023-03-28 20:04:51 +00:00
andvar 88c7a0e2ff s/interrput/interrupt/ and s/accesss/access/ in comments. 2023-03-28 20:01:57 +00:00
rillig c6d07ee57d lint: clean up comments for handling 'linted' comments
No functional change.
2023-03-28 20:01:21 +00:00
riastradh c3a044b881 x86/bus_dma.c: Sprinkle KASSERTMSG. 2023-03-28 19:55:42 +00:00
rillig 1621797966 lint: condense debugging code
No functional change.
2023-03-28 15:52:50 +00:00