Expand description
Signal producers whose signal Linux sends at a moment host timing decides, which an in-guest run refuses (A5 step 3c slice 0b; design sections 16.30, D25, D28 and D28a of https://github.com/rrnewton/hermit/issues/4485).
While the in-guest runtime runs its own code, ordinary signals are blocked,
and Linux keeps a blocked signal pending even when the guest ignores it, so
a signal the kernel sends at a host-timed moment could become pending
whatever the guest’s action and mask. So on the in-guest backends’ default
route (Config::in_guest_refuses_host_timed_producers) Detcore refuses the
one operation that completes such a producer, and Hermit refuses a launch
whose guest would inherit one already complete.
A descriptor’s SIGIO and SIGURG producers (Linux v6.12):
- SIGIO reaches a descriptor’s owner only through the descriptor’s fasync
list (
kill_fasync_rcu,fs/fcntl.c:1116-1142, sends it withsend_sigio), which settingO_ASYNCpopulates:F_SETFLcalls the file’s->fasyncwhenO_ASYNCchanges (setfl,fs/fcntl.c:76-82), and so doesFIOASYNC(ioctl_fioasync,fs/ioctl.c:365-385).open(O_ASYNC)keeps the flag but never calls->fasync(do_dentry_open,fs/open.c:974), and a laterF_SETFLthat leaves the flag set calls nothing either. A descriptor whose status flags showO_ASYNCis treated as armed here anyway, which can only refuse more. - A socket’s owner gets SIGURG for out-of-band data without
O_ASYNC(sk_send_sigurg,net/core/sock.c:3503-3508, callssend_sigurg,fs/fcntl.c:941-978, which reads only the owner). F_SETLEASEwith a read or write lease, andF_NOTIFYwith a nonzero mask, make the caller the owner themselves (lease_setup,fs/locks.c:563-577;fcntl_dirnotify,fs/notify/dnotify/dnotify.c:372) and are refused outright.
An owner is named by F_SETOWN (f_setown, fs/fcntl.c:154-189),
F_SETOWN_EX (f_setown_ex, fs/fcntl.c:217-259), and on a socket
FIOSETOWN and SIOCSPGRP (sock_ioctl, net/socket.c:1284-1289); an
owner of 0 (a pid of 0 for F_SETOWN_EX) removes it.
Structs§
- Owner
Lookup - The owner an owner-setting call names, as the kernel looks it up:
who, a pid number, and whether it names a process group (group): a negativeF_SETOWN,FIOSETOWNorSIOCSPGRPowner, orF_OWNER_PGRP. - Producer
State - What a descriptor already arms toward a host-timed signal producer.
Enums§
- Producer
Arming - An operation on a descriptor that can complete a host-timed signal
producer (D28).
callnames the call and command, as the WARN does.
Constants§
- F_
GETOWN_ EX fcntl’s command that reads a descriptor’s owner and its type (Linux’sinclude/uapi/asm-generic/fcntl.h; the pinned libc lacks it).- F_
OWNER_ PGRP - See
F_OWNER_TID. - F_
OWNER_ PID - See
F_OWNER_TID. - F_
OWNER_ TID F_SETOWN_EX’s owner types (Linux’sinclude/uapi/asm-generic/fcntl.h; the pinned libc lacks them).
Functions§
- defer_
run_ end_ log - Keeps
logto run once at the end of this process’s run (emit_run_end_log): after the scheduler shuts down on the ordinary path, and just before any of the scheduler’s stopping refusals exits the process, so the line is logged on every exit path, at the same point of each path in every run. A later call replaces an earlier one. - emit_
run_ end_ log - Runs the line
defer_run_end_logkept, if any, once. - host_
descriptor_ state - The state of descriptor
fdof the calling process, read from the host, with whether it holds a lease (F_GETLEASE): what Hermit checks before an in-guest launch in each descriptor the guest would inherit (D25). AnO_PATHdescriptor arms nothing (check_fcntl_cmdrefuses every arming command on one), so it reads as arming nothing. A directory notification cannot be read back (there is noF_GETNOTIFY, and fdinfo does not show dnotify), so it is not reported. - names_
an_ owner - Whether
F_GETOWN_EX’s answer, owner typekindand pidpid, names an owner the guest could receive a signal from.