Add usr.sbin/rvn
This is the Ravenports bootstrap stub program.
if /raven/sbin/rvn is already installed, it is exec'd with
original arguments. Otherwise, with the user's confirmation,
rvn is downloaded and installed in place.
Add usr.sbin/rvn
This is the Ravenports bootstrap stub program.
if /raven/sbin/rvn is already installed, it is exec'd with
original arguments. Otherwise, with the user's confirmation,
rvn is downloaded and installed in place.
syscons: hold syscons_mtx when scclose() finishes a pending VT switch
A vty in VT_PROCESS mode that has not released the screen leaves
SWITCH_WAIT_REL set on sc->old_scp. If the process controlling that vty
then dies, scclose() calls finish_vt_rel(scp, TRUE) before it takes
syscons_mtx. With SWITCH_WAIT_REL set, finish_vt_rel() goes on to
switch to the new screen, and exchange_scr() calls update_kbd_state()
(and, for a K_XLATE vty, save_kbd_state()) with unlock != 0, which drop
and re-acquire syscons_mtx around kbd_ioctl(). Unlocking a mutex that
was never taken panics in _mtx_unlock().
Take syscons_mtx before finish_vt_rel() and keep the existing locked
section. Clearing SWITCH_WAIT_ACQ and switch_in_progress is then
serialised against the other syscons_mtx holders as well.
Bug: https://bugs.dragonflybsd.org/issues/3496
Reported-by: vjkarbo
rc.subr: Update load_rc_config() to make the argument optional
Make the argument optional, so only try to load the per-service config
file (i.e., /etc/rc.conf.d/${service}) when specified.
Remove the 'XXX' dummy mark from scripts that has no service name to
call load_rc_config().
Derived-from: FreeBSD
service(8): Enable jail detection to skip "nojail"
DragonFly has implemented the "jail.jailed" sysctl in commit
4e558034a6febf3a5bba02db3c73eca402cd4d98, so use it to enable the jail
handling in service(8).
In addition, clean up the code to reduce duplicate.
<sys/cdefs.h>: Simplify __GLOBL() and move to <sys/linker_set.h>
Simplify __GLOBL() by removing __GLOBL1() (obtained-from: FreeBSD).
Move the __GLOBL() macro to its only user: <sys/liner_set.h>.
While there, also remove the obsolete and disabled __MAKE_SET() macro.
<sys/cdefs.h>: Tweak __cachealign macro
Don't check __GNUC__ and always define the __cachealign macro with
__aligned(). The __aligned__ attribute is supported by all current
compilers and it affects the ABI, so it's better to always define it.
<sys/cdefs.h>: Remove __ARRAY_ZERO compat for flexible array member
It was added in commit 18ba5b61aa74313775925e79837259d0e0ea913b to
satisfy GCC 2.x when the flexible array member was not well supported.
Now this macro is obsolete and so remove it.
<sys/cdefs.h>: Remove unused and obsolete '__usereg'
This macro was added in commit f754816e98c48671805f81055cf309543b3add1e
from 2003 and seems never used in the source tree. It might be useful
in the 32-bit era decades ago, but doesn't make sense nowadays,
specially with much more advanced compilers.
<machine/cpufunc.h>: Remove unused includes to avoid thread dependency
* Clean up cpufunc.h to remove unused includes, struct forward
declerations, and outdated comment. The main intention is to remove
the thread dependency so this header can be used in lib/libc/thread.
* Update smp.h to include <sys/cpumask.h> for cpumask_t, which was
included via <sys/thread.h>.
* Include <sys/cpumask.h> in globaldata.h to be more self-contained.
kernel: FAST uptime clocks from the kpmap in clock_gettime(2)
The system call answered CLOCK_MONOTONIC_FAST and CLOCK_UPTIME_FAST
with getnanouptime(), which counts from gd_hardclock.time, the next
tick, and so runs up to a tick ahead. After ten calls libc reads
ts_uptime from the kpmap instead, the time of the last tick, so both
clocks stepped back by up to a tick in every process. Zig's
std.time.Instant panics when that happens.
Read the kpmap in the system call as well, with the upticks protocol
from sys/upmap.h. CLOCK_REALTIME_FAST is not affected.
Reviewed-by: @dillon
Bug: https://bugs.dragonflybsd.org/issues/3493
drm: zero pages in alloc_page() and alloc_pages() for __GFP_ZERO
alloc_page() and alloc_pages() ignore __GFP_ZERO. alloc_page() calls
vm_page_alloczwq() without VM_ALLOC_ZERO, which hands out the page with
whatever it last held, and vm_page_alloc_contig() does not zero either.
TTM asks for zeroed pages for every buffer a client creates
(TTM_PAGE_FLAG_ZERO_ALLOC) and only clears the pages it reuses from its
own pools. Cached buffers get their pages from alloc_page(), and new
pages for the write-combined and uncached pools come from
alloc_pages(), so a client can map a new buffer and read what the page
held before: freed memory of other processes or the kernel. i915 asks
for zeroed scratch and status pages, and TTM for a zeroed dummy read
page, the same way.
Pass VM_ALLOC_ZERO for __GFP_ZERO in alloc_page(), and zero the pages
in alloc_pages().
Reviewed-by: @dillon
net: Announce IFAN_DEPARTURE message after route/address deletions
The if_detach() function previously announced IFAN_DEPARTURE before
deleting the routes/addresses, so a userland program could receive a
RTM_DELADDR message after the interface had gone and thus cause
confusion. For example, bringing down a wg(4) interface would cause
dhcpcd(8) to emit the following warnings:
```
dhcpcd_handlelink: No such process
dhcpcd_handlelink: No such process
```
Fix this bug by moving the IFAN_DEPARTURE annoucement after the
route/address deletions.
This is a regression introduced in commit b4051e2552 (ifnet: Make ifnet
and ifindex2ifnet MPSAFE).
etc: Switch the default dhcp_client to dhcpcd
The dhcpcd(8) has been in base for many years and it supports both IPv4
and IPv6, replacing both dhclient(8) and rtsold(8). Now switch the
default dhcp_client in defaults/rc.conf to dhcpcd.
However, the recommended way of using dhcpcd(8) is to simply run it as a
master daemon by setting "dhcpcd_enable=YES" in rc.conf, without the
need to configure individual interfaces with "ifconfig_<ifname>=DHCP".
The man pages are updated to document the new default and the
recommendation.
contrib/dhcpcd: Patch common.h to fix timespec* redefinition errors
common.h defines timespec* macros when they're not defined yet. However,
another header (e.g., dhcpcd.h) that's included after common.h may
include <net/if.h> to pull in <sys/time.h>, which always defines
timespec* macros, and thus cause redefinition errors.
Fix it by including <sys/time.h> in common.h.
Merge branch 'vendor/DHCPCD'
Upgrade from 10.0.7 to 10.5.3
In addition, revert the unnecessary local modifications to:
- compat/strtoi.c
- compat/strtou.c
As a result, there is no local modifications now.
nvmm: fix os_vmobj_map_user() to use a hint to map into process space
This fixes a real bug that the function previously could map an object
at the address 0; for example, a mapped comm page could have a zero
address, breaking the '!= NULL' condition.
Fix the bug by using a hint from vm_map_hint() when mapping into the
current process space. This is the similar behavior used in kern_mmap()
for a mmap(2).
By the way, this extra hint code exists in the NetBSD's implementation,
so it was my mistake when porting this function to DragonFly.
vm: refuse mmap() of files on msdosfs and ntfs with small clusters
msdosfs and ntfs with clusters smaller than a page read a file through
separate cluster buffers, so one page covers several clusters that
cannot back a coherent mapping of the file.
Add the internal mount flag MNTK_NOMMAP, set it at mount time when the
cluster size is below PAGE_SIZE (it cannot change on a remount), and
fail mmap() of a regular file on a flagged mount with EOPNOTSUPP.
The check sits in vm_mmap(), which both mmap(2) (via kern_mmap()) and
fp_mmap() call. Image activation is not covered: imgact_elf inserts
the vnode object directly, so a binary stored on a flagged mount is
still mapped while it runs.
Side effects on such mounts: tail(1) and md5(1) with offsets use mmap()
and thus fail with "Operation not supported". cat(1), cp(1), cmp(1) and
md5(1) of whole files work. A shared library stored there cannot be
loaded by rtld(1).
[3 lines not shown]