Commit Graph

297277 Commits

Author SHA1 Message Date
rin eb7145dc97 Do not declare unused tstamp for SMALL. NFC. 2022-08-06 10:19:44 +00:00
rin 82dbd18ccf Get back to the statically-allocated tbuf.
If a string is longer than tbuf, it cannot be a timestamp.
Therefore, no need for buffering anymore in this case.
2022-08-06 10:16:18 +00:00
rin df7debb42d Oops, fix thinko in the previous. 2022-08-06 09:42:33 +00:00
wiz 724324d7c9 binutils-2.39 out 2022-08-06 09:39:50 +00:00
rin 2a3cf2bf71 Do not discard \[.*\] which is not identified as a timestamp. 2022-08-06 09:39:32 +00:00
rin d67befb65b KNF. Do not unnecessarily define ADDC() for SMALL. No binary changes. 2022-08-06 09:33:56 +00:00
rillig 7808fd752b tests/make: document parsing behavior of modifiers
The table was created by manually inspecting the code of the various
ApplyModifier functions in var.c.

The modifiers are listed in alphabetical order, except for the SysV
modifier, which is listed at the end since it is used as a fallback
modifier for many other modifiers and because it does not have a fixed
prefix.
2022-08-06 07:06:58 +00:00
chs 1369379d41 allow KMSAN to work again by restoring the limiting of kva even with
NKMEMPAGES_MAX_UNLIMITED.  we used to limit kva to 1/8 of physmem
but limiting to 1/4 should be enough, and 1/4 still gives the kernel
enough kva to map all of the RAM that KMSAN has not stolen.

Reported-by: syzbot+ca3710b4c40cdd61aa72@syzkaller.appspotmail.com
2022-08-06 05:55:37 +00:00
riastradh 21ea4580f9 entropy: Don't disclose stack garbage in kern.entropy sysctls.
kern.entropy.consolidate and kern.entropy.gather are supposed to be
write-only -- it doesn't make any sense to read from them, but I
suppose it's better to read-as-zero than read-as-stack-secrets!
2022-08-05 23:43:46 +00:00
sekiya d980bb9fcc Do not unilaterally set M_HASFCS; this breaks protocols that lack CRC bytes
(such as AppleTalk).

Instead, remove/preserve the final four bytes in the packet ourselves on a per-
protocol basis, as we do in arch/arm/xscale/ixp425_if_npe.c (and dev/ic/gem.c,
and so forth).
2022-08-05 21:03:43 +00:00
rillig 279cb3bcf8 make: when parsing ':D' or ':U', only copy text if necessary
When parsing the expression ${:D any ${uninterpreted} text}, parsing of
the ':D' modifier only needs to skip to the next delimiter, there is no
need to keep record of the text that has been skipped.  In this
particular example, there had been an unnecessary memory allocation
since the nested expression was not copied to the result buffer.  Due to
that, the resulting buffer contained " any  text", which was not a
substring of the text passed to the parser, thereby forcing the memory
allocation.

No functional change.
2022-08-05 20:59:54 +00:00
rillig 4487a8e94d make: extract parsing of ':D' and ':U' modifiers into separate function
No functional change.
2022-08-05 20:35:55 +00:00
riastradh bd3b975119 ptyfs: Don't copy out cookies past end of buffer.
Reported-by: syzbot+2aae7c4eddc796f917e6@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=5fe24c1da952ac2ea498d745d6479bc6be91a751
2022-08-05 10:36:02 +00:00
riastradh 5c23615bdf i915: Restore non-obsolete set list entries. 2022-08-05 08:48:36 +00:00
skrll 29c8263b9d Sprinkle const on splfoo call results. 2022-08-05 05:50:54 +00:00
thorpej b116f7a825 In vcache_reclaim(), post NOTE_REVOKE immediately after changing the
vnode state to VS_RECLAIMING, before we actually call VOP_RECLAIM(),
which will release the reference on the lower node of a stacked FS
vnode, which is likely to free the upper node's v_klist backing store.

Acquire the vnode interlock when checking for kevent interest now,
because the vp->v_klist pointer is now volatile.

PR kern/56950
2022-08-05 05:20:39 +00:00
andvar 8e4f953b33 s/bufferred/buffered/ in memory description.L: 2022-08-04 21:11:52 +00:00
ryo c7071a7006 Don't pass a block of size 0 to fdt_memory_add_range().
There are some environments where size 0 blocks are passed from the loader.
2022-08-04 11:58:55 +00:00
riastradh e603605e86 proplib: Fix mistake in previous -- use strncmp for prefix matching. 2022-08-04 09:02:29 +00:00
riastradh efe5c7855e proplib: Don't run off end of buffer with memcmp.
The input is required to be NUL-terminated anyway, so just use strcmp
here.

Reported-by: syzbot+69838802c8ec55909ba3@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=927d66e8aa079ba2be43497425a6d9878025ad09
2022-08-03 21:20:21 +00:00
riastradh 3f7675e077 proplib: Nix trailing whitespace. 2022-08-03 21:13:46 +00:00
ryo de5ab53686 fix build with options PMAPBOOT_DEBUG and options DDB 2022-08-03 17:55:05 +00:00
riastradh c176bd8b34 kern/vfs_lockf.c: Fix overflow in overflow detection.
Reported-by: syzbot+cda9440741a1516747c8@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=030eb71324790093d467799263cd0789e5097229
2022-08-03 11:09:13 +00:00
riastradh ab293a4a77 rasctl(2): Avoid overflow in address range arithmetic.
Remove various contortions to suppress warnings.  Rely on
-Wno-type-limits instead.

Reported-by: syzbot+8b0f1ced3fce82031535@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=e9055200701cffd653d5b13491d85c34e07f06a3
2022-08-03 09:40:25 +00:00
riastradh 610f9263f0 sys: Build kernel with -Wno-type-limits.
The type-limits warning is actively harmful because it discourages
writing safe portable overflow detection logic which happens, on some
architectures, to be dead code.
2022-08-03 09:37:36 +00:00
skrll a84103a22f Add a KASSERT for the locking protocol in wm_ioctl.
Read the interface up/down status from sc_if_flags (under WM_CORE_LOCK)
when deciding if the multicast filter needs to be updated.

Discussed with msaitoh@, knakahara@ and riastradh@
2022-08-03 05:29:04 +00:00
skrll 5163322bd0 Add some KASSERTs around the locking protocol.
Discussed with msaitoh@, knakahara@ and riastradh@
2022-08-03 05:23:30 +00:00
chs 02f91ef077 change the ARC reclaim code to use the pagedaemon's free page target
rather than having a separate target.
2022-08-03 01:53:06 +00:00
chs f39adc8860 for platforms which define NKMEMPAGES_MAX_UNLIMITED, set nkmempages
high enough to allow the kernel to map all of RAM into kmem,
so that free physical pages rather than kernel virtual space is
the limiting factor in allocating kernel memory.  this gives ZFS
more flexibility in tuning how much memory to use for its ARC cache.
2022-08-03 01:52:11 +00:00
riastradh c45c044c8d sys/compat/common/if_media_80.c: Add kernel rcsid. 2022-08-03 01:38:51 +00:00
riastradh 0d57c6f297 genfb: Handle uninitialized softc in genfb_enable/disable_polling.
This can happen due to janky MD kludgerosity like x86
x86_genfb_ddb_trap_callback, which should really be cleaned up, but
at least this might help with the recursive traps we've been seeing
in syzbot.
2022-08-01 23:30:10 +00:00
kre 52acc68675 Provide _GNU_SOURCE for t_clone now that is required to make clone()
visible.
2022-08-01 15:48:39 +00:00
wiz b3d52618d0 sched.h: keep __clone() visible under _NETBSD_SOURCE 2022-08-01 15:16:05 +00:00
mlelstv 29d3175577 Prevent multiple unregistrations. 2022-08-01 14:44:15 +00:00
mlelstv 8db4c895b6 revert accidental commit. 2022-08-01 14:43:15 +00:00
wiz d7c5f8bdef sched.h: format comment to follow KNF
requested by thorpej@
2022-08-01 14:34:01 +00:00
wiz 2d37c7f39b clone(2): document that _GNU_SOURCE must be defined for the prototypes 2022-08-01 14:22:32 +00:00
wiz da31975915 sched.h: Linux documents clone and __clone as only available
when_GNU_SOURCE is defined - follow suit.

Ok martin@
2022-08-01 14:19:40 +00:00
kre 284455246e Revert this to 1.205, undoing changes apparently mistakenly
committed in 1.206, and the total disaster that the attempt to
revert those in 1.207 created.
2022-08-01 10:30:28 +00:00
mlelstv 0139e7faab Now really restore 1.24. 2022-08-01 08:09:30 +00:00
mlelstv 4982525b02 Revert last accidental commits. 2022-08-01 07:37:18 +00:00
mlelstv 1d93c6307f Also fix shift values for SCT constants. 2022-08-01 07:34:28 +00:00
rin ca8cc6f69f ms_wscons_ioctl(): Return EPASSTHROUGH instead of -1, for unsupported
ioctl, as done for other backends of wsmouse(4).
2022-08-01 01:32:15 +00:00
chs 78cda414a5 in pmap_enter_ptpage(), if we are allowed to fail then fail rather than
waiting for memory to be available.  when we are mapping an anon or uobj page
then we will be holding the lock for that page owner, and sleeping to wait
for memory with a page owner lock held is illegal because the pagedaemon
can wait for that lock, which will lead to deadlock.  fixes PR 56932.
2022-07-31 17:11:41 +00:00
mlelstv 876fd04d2a Fix build on 32bit. 2022-07-31 13:49:23 +00:00
mlelstv a566ce54a7 Count dropped packets caused by ENOBUFS as interface error. 2022-07-31 13:14:54 +00:00
mlelstv 6eb0866937 Don't panic for a negative offset, just fail the operation with EINVAL. 2022-07-31 13:08:18 +00:00
mlelstv 3418b37ee3 Compute a unique port number from interface index. 2022-07-31 13:01:16 +00:00
mlelstv 6441916c01 Don't report errors as timeout. 2022-07-31 12:59:26 +00:00
mlelstv d2698c432d Move libisns to /lib to allow /sbin/iscsid to work without /usr being
mounted.
2022-07-31 12:40:35 +00:00