summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-29Use mach_msg_type_number_t whenever required to avoid warningsFlavio Cruz
Message-ID: <20231229212105.858759-3-flaviocruz@gmail.com>
2023-12-29Cast bootinfo to struct diskfs_control * to silence warningFlavio Cruz
Message-ID: <20231229212105.858759-2-flaviocruz@gmail.com>
2023-12-29Initialize a few error variables to avoid GCC warningsFlavio Cruz
Message-ID: <20231229212105.858759-1-flaviocruz@gmail.com>
2023-12-29Mark msg_thread as noreturnFlavio Cruz
Message-ID: <20231229161211.312389-3-flaviocruz@gmail.com>
2023-12-29Replace deprecated sigmask with sigset_t callsFlavio Cruz
Message-ID: <20231229161211.312389-2-flaviocruz@gmail.com>
2023-12-29pfinet and pci-arbiter: update server handlers to return kern_return_t to ↵Flavio Cruz
fix -Werror=enum-int-mismatch warnings Message-ID: <20231229161211.312389-1-flaviocruz@gmail.com>
2023-12-17Update server handlers to return kern_return_error to fix ↵v0.9.git20231217Flavio Cruz
-Werror=enum-int-mismatch warnings MiG expects those to return kern_return_t. Message-ID: <ZXqbbXpVqQAwd2qv@jupiter.tail36e24.ts.net>
2023-12-17Update hurd code to handle the new ABI for sending inlined port rights.Flavio Cruz
2023-12-03Revert "Update hurd code to handle the new ABI for sending inlined port rights."Samuel Thibault
This reverts commit 33c30b4ff76ca22bdedce4aa41d05736a546d86b.
2023-12-03Update hurd code to handle the new ABI for sending inlined port rights.Flavio Cruz
Message-ID: <20231124213041.952886-3-flaviocruz@gmail.com>
2023-12-02lwip: Allocate the loopback netif by defaultJoan Lledó
The translator received a null `netif_list` during initialization, this caused a few bugs. When started without parameters, the translator didn't add any new interface to `netif_list`, and that broke any subsequent fsysopts over the translator, as the stack was being initialized again instead of being reconfigured. DHCP was broken because the translator is usually installed without parameters, which are supposed to be added by the DHCP client through fsysopts. The absence of an allocated `netif_list` also prevented configuring a loopback interface. After these changes, starting the translator always allocates one interface and configures it as loopback. Message-ID: <20231202101401.11542-2-jlledom@mailfence.com>
2023-11-26libports: Make sure we don't leak current RPCs listsSamuel Thibault
2023-11-26libports: Force threads to wake up periodicallySamuel Thibault
Quiescence support in port-deref-deferred.c assumes that all threads will sooner or later go through a quiescent state (because it finished processing a message). But that is not true: proc doesn't set a thread timeout, and thus some threads can stay indefinitely stuck in receiving messages. And thus the deferred dereferencing used by ports_destroy_right never gets achieved. This accumulation can be seen by running: while true ; do echo $(echo -n $(echo a)) > /dev/null ; done while running vminfo 4 | wc -l in parallel. Making threads get out of mach_msg at least periodically allows unstucking quiescence generations.
2023-11-26libports: Add more assertionSamuel Thibault
flip_generations needs to make sure it is not throwing away a list of objects to be released.
2023-11-20exec: TODO note about implementing interruptSamuel Thibault
2023-11-19libfshelp: type check messages using the full mach_msg_type_t so that it ↵Flavio Cruz
works on x86_64. Message-ID: <ZVlHm2xuVaS8SItY@jupiter.tail36e24.ts.net>
2023-11-12server_verify_make_auth: mig now uses constSamuel Thibault
2023-11-12pci.defs: Fix making glibc catch EINTRSamuel Thibault
INTR_INTERFACE needs to be always called for glibc to redirect mach_msg into _hurd_intr_rpc_mach_msg.
2023-11-06x86_64: Drop -AT386 part in uname machineSamuel Thibault
We don't really have plans to have anything else than "AT386" there, and other OSes do not include it, so it brings us more harm than good to include it.
2023-11-02MAKEDEV: Add pseudo-root targetSamuel Thibault
2023-11-01proc: Fix missing freeSamuel Thibault
On MACH_SEND_TIMED_OUT we defer sending the message to just-created thread, we allocate a copy of the message to that end. We need to free that once the message is indeed sent.
2023-11-01proc: proc_get{pgrp,session}p{,g}ids do have dealloc flagSamuel Thibault
This was added by 7487dda5f
2023-09-13rumpdisk: Fix dependencies computationSamuel Thibault
2023-09-04pflocal: Remove unused write_addr fieldv0.9.git20230912Samuel Thibault
It was never set, and re-connecting a socket to another address would try to deref the port, thus crashing.
2023-09-02S_dir_lookup: Handle O_DIRECTORYSamuel Thibault
When e.g. looking up a socket with O_DIRECTORY, we should return ENOTDIR rather than EACCESS.
2023-09-02Revert "S_dir_lookup: Handle O_DIRECTORY"Samuel Thibault
This reverts commit 8b5b59c704e9edbb0784697ada1df9112fc3e18b. This actually breaks various posix behaviors.
2023-09-02S_dir_lookup: Handle O_DIRECTORYSamuel Thibault
When e.g. looking up a socket with O_DIRECTORY, we should return ENOTDIR rather than EACCESS.
2023-08-31pfinet: Also accept MSG_NOSIGNAL in udpv6_sendmsgSamuel Thibault
The implementation is shared with IPv4
2023-08-12file-syncfs: Avoid deadlockSamuel Thibault
This is a four-player problem (here for diskfs): - One runs sync, which calls diskfs_S_file_syncfs, which triggers fsys_syncfs on all active translators, while keeping the translator_ihash_lock lock. - One of the active translators is hung, for some reason - Another ext2fs thread is trying to call fshelp_set_active_translator from dir_lookup. It is stuck on trying to acquire translator_ihash_lock, and it holds the np. - The ext2fs thread running diskfs_sync_everything tries to lock that np, while holding the nodecache_lock. In the end everything is locked. While diskfs_S_file_syncfs can as well just atomically get the list of active translators, and then call fsys_syncfs without keeping translator_ihash_lock held.
2023-08-08libbpf: Fix long / int confusionSamuel Thibault
In network terms, long is 32bit, i.e. an int for us.
2023-08-08Get rid of u_int in RPCsSamuel Thibault
To get mach_msg_type_number_t everywhere
2023-08-08exec: Get rid of u_intSamuel Thibault
2023-08-08pfinet: Get rid of u_intSamuel Thibault
2023-08-08ext2fs: Fix shift in find_next_zero_bitSamuel Thibault
Shifting unsigned 32bit right by 32 bits is undefined, so avoid this.
2023-08-08ext2fs: Fix shift in ext2_new_blockSamuel Thibault
Shifting signed integers left by 31 bits is not representable, so better make sure to use unsigned integers.
2023-08-08Homogeneize [gs]et_translator and get_dire[nc]ts into mach_msg_type_number_tSamuel Thibault
This makes netfs_[gs]et_translator use mach_msg_type_number_t like the RPC and diskfs. This also makes the fshelp_fetch_root_callback1_t for fshelp_fetch_root use mach_msg_type_number_t. This also makes procfs_get_translator and the get_translator proc method use mach_msg_type_number_t. This makes diskfs_get_directs use mach_msg_type_number_t like the dir_readdir RPC Also get rid of u_int. This notably fixes _diskfs_translator_callback1_fn's bogus cast of size_t *argz_len into (u_int *).
2023-07-05pci-arbiter: Prevent mapping IO regionsJoan Lledó
* pci-arbiter/netfs_impl.c: * get_filemap_region(): Return MACH_PORT_NULL and set errno to EOPNOTSUPP when the client tries to map a IO region file. Message-Id: <20230705193812.6384-2-jlledom@mailfence.com>
2023-07-03exec: Properly preallocate address spaceSergey Bugaev
The existing code mapped the first PT_LOAD segment using anywhere=1, letting Mach pick an arbitrary location, and then uses anywhere=0 for all the remaining segments to place them next to the first one, as expected by the program. This, however, runs into many issues, primarily because of conflicts between interpreter and executable mappings. Some of those the existing code tried to work around. Instead, do it the way it's implemented in glibc: calculate upfront how much space the overall mapping will need, and ask Mach to preallocate this much address space. Then we deallocate it back, and instead map the program segments onto this very same place. Message-Id: <20230625231137.403096-4-bugaevc@gmail.com>
2023-07-03rumpusbdisk: Add USB mass storage translatorDamien Zammit
This adds a second binary target to compile in the rump USB stack instead of SATA/IDE using conditional ifdefs to mostly share the code between the two translators. This can be tested by running qemu with a USB3 controller as follows: -drive if=none,id=usbstick,format=raw,file=/path/to/disk.img \ -device qemu-xhci \ -device usb-storage,drive=usbstick \ NB: /path/to/disk.img can be a block device on the host. Then call grub module rumpusbdisk.static instead of rumpdisk.static and pass ' root=part:X:device:sd0 noide' as gnumach parameters, where X is the partition number of / within the disk/image. Caveats: netdde seems to exhibit a bug when running 'ifdown /dev/eth0' simultaneously to running the rumpusbdisk translator, due to the two devices sharing the same IRQ. Message-Id: <20230703101815.925760-1-damien@zamaudio.com>
2023-07-03exec: On 64-bit, map lower 4 GB inaccessible for PIEsSergey Bugaev
We want to map the whole lower 4 GB of address space inaccessible to catch accidental pointer truncation. We can only do this when the executable (as well as the interpreter, if any) is compiled as PIC/PIE, since otherwise we would violate the ABI requirement. Fortunately most distributions have already switched to using PIE by default, so this should not be an issue. Message-Id: <20230625231137.403096-3-bugaevc@gmail.com>
2023-07-03libdiskfs: Don't warn if requesting shutdown notification fails with EPERMSergey Bugaev
The code already ignores proc_mark_important failing with EPERM; do the same for opening /servers/startup and startup_request_notification. All of these calls will fail for unprivileged mounts. Also plug a port leak: we want to deallocate the "init" port whether the RPC succeeds or not. Message-Id: <20230625231137.403096-1-bugaevc@gmail.com>
2023-06-29configure.ac: Make test for acpica more robustDamien Zammit
AC_CHECK_LIB does not work when -lpciaccess is also required. Message-Id: <20230629105620.809091-1-damien@zamaudio.com>
2023-06-25acpi: Link against libpciaccessSamuel Thibault
acpica will need it to access PCI configurations.
2023-06-21proc: Fix pointer truncation in get_string_arraySergey Bugaev
Due to little-endianness of x86, this resulted in a 64-bit pointers that pointed to the lower 4 GB of the address space being treated as a 32-bit pointer followed by NULL, which manifested as only the first program arg (the argv[0]) being visible in ps output. When a pointer pointed outside of the lower 4 GB, this resulted in both halves being treated as invalid pointers, causing proc_getprocargs () to fail with KERN_INVALID_ADDRESS, which manifested as ps displaying COMMAND for the affected process as ?. Found by placing all memory above the 4 GB limit, which made it apparent that something about fetching process command lines is seriously broken. Before: USER PID PPID TTY TIME COMMAND 0 1 1 - 0:00.00 /hurd/init 0 2 1 - 0:00.05 /hurd/startup 0 3 2 ? 0:02.80 ? 0 4 2 ? 0:00.00 /hurd/proc 0 5 2 - 0:00.08 ? 0 6 5 - 0:00.02 ? 0 7 2 - 0:00.00 /hurd/auth 0 9 1 - 0:00.01 /hurd/term 0 13 1 - 0:00.11 /hurd/mach-defpager 0 15 1 - 0:00.00 /bin/bash 0 16 5 - 0:00.00 /hurd/pflocal 0 18 15 - 0:00.00 /bin/sh 0 20 18 - 0:00.00 ps-hurd After: USER PID PPID TTY TIME COMMAND 0 1 1 - 0:00.01 /hurd/init -a 0 2 1 - 0:00.03 /hurd/startup --kernel-task=1 console=com0 0 3 2 ? 0:01.36 gnumach --kernel-task=1 console=com0 0 4 2 ? 0:00.00 /hurd/proc --kernel-task=1 0 5 2 - 0:00.06 ext2fs --multiboot-command-line=console=com0 0 6 5 - 0:00.00 /hurd/exec --device-master-port=1 0 7 2 - 0:00.02 /hurd/auth 0 9 1 - 0:00.00 /hurd/term /dev/console device console 0 13 1 - 0:00.09 /hurd/mach-defpager 0 15 1 - 0:00.00 /bin/bash /usr/libexec/runsystem.hurd 0 16 5 - 0:00.00 /hurd/pflocal 0 18 15 - 0:00.00 /bin/sh 0 19 18 - 0:00.01 ps-hurd -ef Message-Id: <20230621105638.1045306-1-bugaevc@gmail.com>
2023-06-21Drop mention of non-existing check targetSamuel Thibault
2023-06-14Replace msgh_kind with msgh_seqnoFlavio Cruz
msgh_kind is deprecated and is an alias to msgh_seqno. Message-Id: <ZIfy1sJwuhEtKSPH@jupiter.lan>
2023-06-14Check for file_utimens since that's the correct RPC for changing ↵Flavio Cruz
access/modification times libtrivfs/nfsd/fakeroot can now make the call to the underlying translators. Message-Id: <ZIlK1ow9VFolIbga@jupiter.lan>
2023-06-11pfinet: Fix x86_64 prototypesSamuel Thibault
2023-05-29Revert "Disable Linux-based pfinet on x86_64"Samuel Thibault
This reverts commit 19558c940e81d405dbda0ea1dd29549f34b5aa2a. It now builds fine.
2023-05-29pfinet: Add x86_64 checksum supportSamuel Thibault