Commit Graph

300996 Commits

Author SHA1 Message Date
rillig 5d22d06a84 style: remove mentions of ANSI C
The distinction between traditional C and ISO C90 or later is no longer
needed in the style guide. Any old-style code is caught by the
compilers.

https://mail-index.netbsd.org/tech-userlevel/2023/04/15/msg013768.html
https://mail-index.netbsd.org/tech-userlevel/2023/04/17/msg013776.html
2023-04-21 16:12:53 +00:00
skrll 66be60e703 More devmap updates 2023-04-21 15:04:47 +00:00
skrll 30ba21540f Trailing whitespace 2023-04-21 15:00:27 +00:00
skrll c5a673c118 Trailing whitespace. 2023-04-21 14:58:34 +00:00
skrll 5ea443a011 Trailing whitespace 2023-04-21 14:57:52 +00:00
christos ef8fd1897c Align types with readline-8.2 (wiz@) 2023-04-21 14:56:13 +00:00
yamaguchi 55d6298230 virtio(4): change members of struct vring_desc_extra before free a slot
This prevents the following race condition.
1. Thread-A: calls virtio_dequeue_commit() and
             puts a slot into free descriptor chain in vq_free_slot()
2. Thread-B: calls virtio_enqueue_prep() and get the slot stored by Thread-A
3. Thread-B: calls virtio_enqueue_reserve() and
             changes desc_base and desc_free_idx for the slot
4. Thread-A: changes the same members updated by Thread-B

reported by hannken, thanks.
2023-04-21 02:17:32 +00:00
gutteridge 74010a1af9 resize.c: use estrdup(3) with basename(3)
basename(3) is invoked more than once on different paths. Retain the
correct name for the utility itself on error. Addresses PR bin/57355
from RVP, who provided the patch.
2023-04-20 22:23:53 +00:00
uwe a9b7771ff9 optstr(9): markup fixes
While here, wrap long .Fn lines for readability and make the
optstr_get_item list compact.
2023-04-20 10:43:17 +00:00
skrll d1b2ebc5ed Update to include value conversion routines. 2023-04-20 09:06:02 +00:00
skrll 4e4f3181fe Extend optstr(9) to provide some functions to convert the value.
Proposed on tech-kern some time ago.
2023-04-20 09:04:45 +00:00
skrll 6d5cf3578a Provide a shared pmap_devmap implementation and convert all pmap_devmap
arrays to use DEVMAP_ENTRY{,_END}
2023-04-20 08:28:02 +00:00
manu e1e4666ea6 Add reloc keyworkd to let EFI bootstrap load amd64 kernel at any address
EFI bootstrap assumes it can copy the amd64 kernel to its ELF load
address (that is KERNTEXTOFF - KERNBASE = 0x200000), but it can
clash with previous UEFI memory allocation, as described here:
http://mail-index.netbsd.org/tech-kern/2023/04/07/msg028833.html

This change adds a reloc keyword for controling where the EFI
boostrap will copy the kernel image. Possible values are:
default - the default and prior behavior, copy at 0x200000.
none - do not copy and use the kernel image where it was loaded.
address - specify an explicit address where to copy the kernel.

This comes with an amd64 kernel patch that makes it self-relocatable.
It first discover where it was loaded in memory, and if this is
different than the expected 0x200000, hhe the kernel relocates
itself and start over at the right address.
2023-04-20 00:42:23 +00:00
mlelstv 2f2ca7363b Again allow multicast packets to be sent from unnumbered interfaces. 2023-04-19 22:00:18 +00:00
brook 44b53cb84a Install /boot/boot.cfg with EFI bootloaders.
On ARM ports, the EFI boot loader handles a boot.cfg file if it
exists, but one is not installed by default.  In contrast, both the
i386 and amd64 ports do install boot.cfg by default.  Bring these
ports into agreement by installing boot.cfg on ARM ports with EFI boot
loaders.
2023-04-19 18:39:18 +00:00
kre 960a3d1781 Another err message typo! (found this one myself!!) 2023-04-19 09:39:29 +00:00
kre 85eb242dbc Typo in an error message (pointed out by RVP; Thanks) 2023-04-19 07:40:49 +00:00
ozaki-r 60500579e3 Revert "Fix panic on packet sending via a route with rt_ifa of AF_LINK."
The fix is mistakenly upstreamed.
2023-04-19 02:43:40 +00:00
yamaguchi ed9b820bbb virtio(4): change variable name, nfc 2023-04-19 00:40:30 +00:00
yamaguchi 67c494c1d5 Fix not to allocate unnecessary descriptor
fixes PR/57358
2023-04-19 00:38:30 +00:00
yamaguchi c2646fd488 Use enumeration for state of a child driver instead of flags
and check its detaching by using sc->sc_child in virtio_softc

pointed out by riastradh, thanks.
fixes PR/57357
2023-04-19 00:23:45 +00:00
christos 7e2bdad6d9 Move date setting into cd9660_populate_iso_dir_record so there is no
path that leaves it unset.

From FreeBSD https://reviews.freebsd.org/D39258
2023-04-18 23:05:51 +00:00
christos 8399b2db93 We previously attempted to emit Rock Ridge NM records only when the name
represented by the Rock Ridge extensions would actually differ. We would
omit the record for an all-upper-case directory name, however Linux (and
perhaps other operating systems) map names with no NM record to
lowercase.

This affected only directories, as file names have an implicit ";1"
version number appended and thus always differ.  To solve, just emit NM
records for all entries other than DOT and DOTDOT .

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

From FreeBSD https://reviews.freebsd.org/D39258
2023-04-18 23:02:51 +00:00
christos 88133efe71 The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

Found by Coverity on FreeBSD
2023-04-18 23:00:02 +00:00
christos 4c1d366af2 See RRIP 4.1.4 Description of the "NM" System Use Entry for details.
From FreeBSD
2023-04-18 22:58:14 +00:00
christos 0941656289 The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) were
incorrect, and timestamps were written in the wrong order.

See RRIP 4.1.6 Description of the "TF" System Use Entry for details.

From: https://reviews.freebsd.org/D39221
2023-04-18 22:56:41 +00:00
christos 6d8ba4b8b8 Oops wrong mask. 2023-04-18 22:42:52 +00:00
christos e741ab826e switch everyone to openssl.old 2023-04-18 20:11:34 +00:00
christos f5e845b90d remove files from previous version 2023-04-18 20:10:43 +00:00
jkoshy c2d5d65bef mount_procfs(8): Document the format of the region descriptor
lines contained in the 'map' and 'maps' special files.
2023-04-18 18:42:20 +00:00
christos 5eb593004f The SysV ABI specifies that the symbol hash function should return only 32
bits of hash. Unfortunately due to an implementation bu and the fact that
the return type is unsigned long which is 64 bits in LP64, this can fail
in some cases: "\xff\x0f\x0f\x0f\x0f\x0f\x12". See:
    https://maskray.me/blog/2023-04-12-elf-hash-function
From Ed Maste @ FreeBSD:
    https://cgit.freebsd.org/src/commit/\
	?id=29e3a06510823edbb91667d21f530d3ec778116d
Need to write Unit Tests for this.
2023-04-18 16:48:45 +00:00
kre e92b04bbd5 Correct some unfortunate behaviour in extreme cases pointed out by RVP.
(Very long worms in a smallish window could result in the max number of
worms being 0...)

While here (also suggested by RVP) seed the random number generator,
also add a -S option to set the seed (note: while this is documented
in the updated man page, it does not appear in the usage message in
case of an error ... not likely to be used often enough to include there).

Also some minor improvements suggested by RVP:
	delete the prototype for main()
	exit curses mode before abort() (which should not happen, but...)
	no need to return (->exit) after abort() as modern abort() can
		never return.

In addition, check for extraneous (ignored) (non-option) args.
Check for absurdly small or big screens (the worm placement algorithm
doesn't work well for lines of columns < 3, and the abort() mentioned
above actually happens if one of those is == 1).

More flavours of worms added.

Some minor man page wording improvements.
2023-04-18 15:02:22 +00:00
christos df9c8da8fe merge conflicts 2023-04-18 14:24:25 +00:00
christos 4724848cf0 import the latest NetBSD OpenSSL to the old directory. 2023-04-18 14:19:03 +00:00
nikita a384b59408 lua: mention patches with commit IDs in README.import for now. 2023-04-18 14:07:03 +00:00
skrll e1fcbd8940 G/C unnecessary
extern paddr_t physical_start, physical_end;
2023-04-18 11:06:57 +00:00
nikita 925ef48c4a Mention applied bugfixes for Lua. 2023-04-18 09:56:57 +00:00
skrll aa588e7f73 G/C an outdated comment. 2023-04-18 07:53:31 +00:00
riastradh 4c0c4f7468 sb(4): Fix missing mutex initialization at isapnp and ofisa.
PR kern/57363

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-04-18 06:37:25 +00:00
gutteridge d9d44b7ea1 tprof.8: fix typo, s/speficied/specified/ 2023-04-18 00:21:23 +00:00
uwe f5a0cd5ede tprof(8): fix markup nits 2023-04-17 21:51:40 +00:00
gutteridge 63184ef432 tprof.8: new sentence, new line 2023-04-17 21:46:12 +00:00
nikita 79fd713a55 lua: apply upstream bugfix for "Loading a corrupted binary file can segfault." 2023-04-17 21:17:57 +00:00
nikita d08cb505c1 lua: apply upstream bugfix for "Wrong line in error message for arithmetic errors."
It also causes 'L->top' to be wrong when the error happens,
triggering an 'assert'.
2023-04-17 20:37:43 +00:00
mlelstv e98a040b1d Input and output codecs produce and consume internal audio data, so
don't byteswap it.
2023-04-17 20:33:45 +00:00
nikita cf02d049ea lua: apply ustream bugfix for "C-stack overflow with deep nesting of coroutine.close." 2023-04-17 20:33:12 +00:00
nikita d5cb192484 lua: apply upstream bugfix for "'utf8.codes' does not raise an error on spurious continuation bytes." 2023-04-17 20:27:40 +00:00
nikita 7ae600e361 lua: apply upstream bugfix for "GC not setting a proper target for next cycle after a full collection in generational mode." 2023-04-17 20:17:58 +00:00
nikita 29dfad4c22 lua: apply upstream bugfix for "'break' may not properly close variable in a 'for' loop."
Function 'leaveblock' was generating "break" label before removing
variables from the closing block. If 'createlabel' created a 'close'
instruction (which it did when matching a goto/break that exited
the scope of an upvalue), that instruction would use the wrong level.
2023-04-17 20:07:32 +00:00
nikita 6c647b8126 lua: aply upstream bugfix for "'lua_settop' may use a pointer to stack invalidated by 'luaF_close'." 2023-04-17 19:54:19 +00:00