DragonFlyBSD/src fac5240lib/libfetch http.c

libfetch: Fix GCC 12.5's -Wstringop-overread.

Taken-from: FreeBSD (57fbafb8deac75b924faf1fa6c2222a7719fdfec)
DeltaFile
+3-2lib/libfetch/http.c
+3-21 files

DragonFlyBSD/src 7e7c534contrib/ncurses/ncurses/base lib_screen.c

Merge branch 'vendor/NCURSES'
DeltaFile
+1-1contrib/ncurses/ncurses/base/lib_screen.c
+1-11 files

DragonFlyBSD/src 333ea1fusr.sbin/installer/dfuibe_installer fn_install.c

installer: Fix GCC 12's -Waddress in world. cp_src[i] is never NULL.
DeltaFile
+3-3usr.sbin/installer/dfuibe_installer/fn_install.c
+3-31 files

DragonFlyBSD/src dc79421contrib/ncurses/ncurses/base lib_screen.c

vendor/ncurses: Add a trailing nul for magic-string in putwin.

This was flagged by GCC 12.5's -Wstringop-overread.

Patch is from upstream, therefore fixing on the vendor branch.
DeltaFile
+1-1contrib/ncurses/ncurses/base/lib_screen.c
+1-11 files

DragonFlyBSD/src f48dc6ainitrd mkinitrd.sh

initrd/mkinitrd.sh: Force strip the binaries to fix size exceeding

A user may set DEBUG_FLAGS in /etc/make.conf to retain debug symbols
during the installation phase, so the copied /rescue tools containing
the debug symbols would exceed the allowed maximum initrd image (current
15MB) and then break the installworld phase.

This issue was introduced by my commit 9d10863cc2df1e9077eb6405dd8572c243ba94d7
that removed the hardcoded 'strip' invocation from crunchgen(1)-
generated makefiles.

Now we force strip the binaries after copying them to the initrd build
directory.

Reported-by: swildner
Discussed-with: swildner
DeltaFile
+18-6initrd/mkinitrd.sh
+18-61 files

DragonFlyBSD/src cb392f0initrd/oinit Makefile oinit.c

initrd/oinit: Implement login_tty() to avoid depending on libutil

Copy the login_tty() from libutil and thus remove the dependency on
libutil.  However, this doesn't reduce the final binary size...

Meanwhile, remove unnecessary header inclusions.
DeltaFile
+18-14initrd/oinit/oinit.c
+0-7initrd/oinit/Makefile
+18-212 files

DragonFlyBSD/src fe73fd3. Makefile_upgrade.inc, initrd Makefile

initrd: Exclude 'oinit' from rescue tools

oinit is a stripped-down init(8), so it's only useful on an initrd
image.  Move it from ${RESCUE_SUBDIRS} to ${INITRD_SUBDIRS} and remove
the existing /rescue/oinit.  Adjust the makefiles to simplify the
installation logic.
DeltaFile
+3-4initrd/Makefile
+5-0initrd/oinit/Makefile
+5-0initrd/etc/Makefile
+1-0Makefile_upgrade.inc
+14-44 files

DragonFlyBSD/src 4cb09ffinitrd mkinitrd.sh

initrd/mkinitrd.sh: Actually use check_initrd() and small changes

* The check_initrd() was not used. Now use it before making the image.
* Simplify the awk command to be bc(1) to round up the image size.
* Shell syntax and style cleanups.
DeltaFile
+17-26initrd/mkinitrd.sh
+17-261 files

DragonFlyBSD/src 54c9212sys/conf bsd.kern.mk

kernel: Disable -Wzero-length-bounds for the kernel build.
DeltaFile
+3-0sys/conf/bsd.kern.mk
+3-01 files

DragonFlyBSD/src 66383c5stand/boot/pc32/boot2 Makefile

boot2: Lower minimum pagesize the compiler assumes for warnings to 1024.

This silences a few -Warray-bounds we were getting from GCC 12.5.
DeltaFile
+9-0stand/boot/pc32/boot2/Makefile
+9-01 files

DragonFlyBSD/src 634062alib/libc/sys mincore.2, sys/vm vm_mmap.c

mincore(2): Fix several bugs

* Return ENOMEN when the requested range is not fully mapped.
  (obtained from FreeBSD: 455dd7d4c79bc7bef5401721f617e64eca7ef422)

  This change should fix a crash in Mesa where it calls mincore() to
  determine whether a protocol field is a valid pointer in order to
  keep compatible with an old protocol version.

* Fix an off-by-one error in filling the skipped entries.  lastvecindex
  refers to the last valid byte, so the new bytes should come after it.
  (obtained from FreeBSD: 6a87d217e2da2a63d4431aeb871783e1dd7349ae)

* Fix the calculation of the 'end' boundary.
  (obtained from FreeBSD: d0c9294b810f8b42b7ac27a46db44b94ddca3160)

* Update the man page.

Reported-by: peeterm
DeltaFile
+46-14lib/libc/sys/mincore.2
+28-14sys/vm/vm_mmap.c
+74-282 files

DragonFlyBSD/src 49eae19lib/libc/sys mlock.2

mlock.2: Add a missing '.Pp' after list
DeltaFile
+1-0lib/libc/sys/mlock.2
+1-01 files

DragonFlyBSD/src 9c2637alib/libc/sys mincore.2, sys/vm vm_mmap.c

mincore(2): Add 'vm.mincore_mapped' sysctl to control reporting

Add the 'vm.mincore_mapped' (default ON!) to control whether to report
only the mapping status (if set to a non-zero value) or the physical
residency (if set to a zero value; the old behavior).

The idea of implementing this and enabling it by default is to help
mitigate page cache attacks [1].

[1] Page Cache Attacks: https://arxiv.org/abs/1901.01161

Obtain-from: FreeBSD (https://reviews.freebsd.org/D18764)
DeltaFile
+16-3lib/libc/sys/mincore.2
+7-3sys/vm/vm_mmap.c
+23-62 files

DragonFlyBSD/src e8a6211sys/conf kern.post.mk newvers.sh

kernel: Refactor newvers.sh script

* Require and directly use 'KERN_IDENT' from the environment.  This
  avoids the 'make -V KERN_IDENT' command and thus fix the following
  warning from bmake since the last upgrade to 20260619:
  ```
  make[3]: warning: Invalid internal option "-J" in "/usr/obj/usr/src/sys/ALY"; see the manual page
  ```

* Leverage the new tools/gencopyright.sh script to generate the
  copyright header.

* Simplify the awk command that extracts '__DragonFly_version' from
  <sys/param.h> (referred to FreeBSD).

* Clean up code and styles.
DeltaFile
+51-52sys/conf/newvers.sh
+2-1sys/conf/kern.post.mk
+53-532 files

DragonFlyBSD/src 18323e1include Makefile, tools gencopyright.sh

include: Rewrite generation of <osreldate.h>

* Add the new tools/gencopyright.sh script to generate the copyright
  header.  Prefer the copyright year extracted from top-level COPYRIGHT,
  similar to FreeBSD's.

* Directly extract the __DragonFly_version from <sys/param.h> as RELDATE
  instead of calling newvers.sh.  As a result, no need to clean up the
  extra-generated files: version, vers.c and vers.txt.

By the way, this also avoids a few bmake warnings appeared after the
recent bmake upgrade (to 20260619):
```
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[5]: warning: Invalid internal option "-J" in "/usr/obj/usr/src/world_x86_64/usr/src/include"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page

    [4 lines not shown]
DeltaFile
+26-0tools/gencopyright.sh
+12-12include/Makefile
+38-122 files

DragonFlyBSD/src f56704fshare/man/man9 kprintf.9

kprintf.9: Document the return value of ksnprintf()/kvsnprintf()
DeltaFile
+15-4share/man/man9/kprintf.9
+15-41 files

DragonFlyBSD/src 6303926sys/netinet6 icmp6.c nd6.c

kernel: Change ip6_sprintf() not to use static buffers

Now the caller must pass a buffer of size at least INET6_ADDRSTRLEN.

Derived-from: FreeBSD (commit 1d54aa3ba94f4d9883b0746ce45123d5b5be773b)
DeltaFile
+73-41sys/netinet6/ip6_mroute.c
+52-31sys/netinet6/nd6_rtr.c
+29-28sys/netinet6/in6.c
+36-21sys/netinet6/nd6_nbr.c
+32-18sys/netinet6/nd6.c
+23-10sys/netinet6/icmp6.c
+245-14912 files not shown
+307-19218 files

DragonFlyBSD/src fdf5103sys/kern kern_jail.c

jail: Fix potential buffer overflow in sysctl_jail_list()

sysctl_jail_list() allocates a buffer of size = count*1024, and then
uses ksnprintf() to format the jail information and advance the write
position. However, ksnprintf() returns the would-be length (i.e., the
number of bytes would be written if the buffer is big enough). So a jail
that has a very long path and/or many IPs would overflow the allocated
buffer.

Fix the bug by correctly handling the return value of ksnprintf().

GitHub-PR: #45
Reported-by: Nathan Sapwell (jewbird)
DeltaFile
+6-6sys/kern/kern_jail.c
+6-61 files

DragonFlyBSD/src 9257500sys/kern kern_jail.c

jail: Clean up sysctl_jail_list()

No functional changes.
DeltaFile
+23-31sys/kern/kern_jail.c
+23-311 files

DragonFlyBSD/src 23fad20sys/conf files, sys/dev/apple/fw Makefile

Fix LINT64 build (add smc_thermal.c).

While here, break too long lines in apple_{fw,ir,smc}'s Makefiles.
DeltaFile
+3-2sys/dev/apple/ir/Makefile
+3-1sys/dev/apple/smc/Makefile
+3-1sys/dev/apple/fw/Makefile
+1-0sys/conf/files
+10-44 files

DragonFlyBSD/src 896ad35share/man/man5 make.conf.5, sys/conf bsd.kern.mk

kernel: Add WARNS_AUDIT for the kernel.

Analogous to world. If specified, any warning options that we normally
disable in buildkernel using -Wno-* will be active.

While here, move -Wold-style-declaration from CFLAGS to CWARNFLAGS.
DeltaFile
+11-4sys/conf/bsd.kern.mk
+2-5share/man/man5/make.conf.5
+13-92 files

DragonFlyBSD/src b5eed50share/mk bsd.sys.mk, sys/conf bsd.kern.mk

Add -Wno-address-of-packed-member to both world and kernel builds.

Following FreeBSD in doing so.

Discussed-with: aly
DeltaFile
+3-0sys/conf/bsd.kern.mk
+3-0share/mk/bsd.sys.mk
+6-02 files

DragonFlyBSD/src 29f2402sys/conf bsd.kern.mk

bsd.kern.mk: Add an easier way to check GCC's version.

Like we have in bsd.sys.mk for world.
DeltaFile
+5-0sys/conf/bsd.kern.mk
+5-01 files

DragonFlyBSD/src d0c37f9sys/sys caps.h

<sys/caps.h>: Include <sys/types.h> for size_t.
DeltaFile
+2-0sys/sys/caps.h
+2-01 files

DragonFlyBSD/src 4f301d2lib/libc/sys syscap_get.2

syscap_get.2: Fix prototype.
DeltaFile
+1-1lib/libc/sys/syscap_get.2
+1-11 files

DragonFlyBSD/src d8b4bdfsys/kern subr_diskmbr.c subr_diskslice.c

kernel: Clean up subr_diskmbr.c and subr_diskslice.c

No functional changes.
DeltaFile
+77-82sys/kern/subr_diskslice.c
+8-14sys/kern/subr_diskmbr.c
+85-962 files

DragonFlyBSD/src 2b3ac52initrd/oinit oinit.c pathnames.h

initrd/oinit: Fold pathnames.h into oinit.c

Meanwhile, remove unused _PATH_RUNDOWN define.
DeltaFile
+0-39initrd/oinit/pathnames.h
+2-1initrd/oinit/oinit.c
+2-402 files

DragonFlyBSD/src 8eea1a0etc/rc.d routed route6d

rc.d: Clean up routed and route6d scripts

* Remove obsolete comments.
* Replace 'eval' with assignment to 'command_args' variable.
DeltaFile
+2-7etc/rc.d/route6d
+2-6etc/rc.d/routed
+4-132 files

DragonFlyBSD/src d0e023aetc/rc.d devfs

rc.d: Skip 'devfs' in jails

Obtained-from: FreeBSD
DeltaFile
+1-0etc/rc.d/devfs
+1-01 files

DragonFlyBSD/src 75a978dshare/man/man4 netintro.4

netintro.4: Fix whitespace and indentation for 'struct sockaddr'
DeltaFile
+3-3share/man/man4/netintro.4
+3-31 files