summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-20libdiskfs: improve asserts and remove a sign compare warningEtienne Brateau
Message-Id: <20220119192945.36654-4-etienne.brateau@gmail.com>
2022-01-20libstore: fix type of a counterEtienne Brateau
Message-Id: <20220119192945.36654-3-etienne.brateau@gmail.com>
2022-01-20libpager: fix assertion unsigned against 0Etienne Brateau
Comparing an unsigned to be superior or equals to 0 is always true, instead move the assert before the substraction and compare it to the value to substract. Message-Id: <20220119192945.36654-2-etienne.brateau@gmail.com>
2022-01-20libpager: fix a comparison between signed and unsignedSamuel Thibault
Reported-by: Etienne Brateau <etienne.brateau@gmail.com>
2022-01-18ext2fs: fix invalid checkEtienne Brateau
log2_dev_block_per_fs_block is unsigned so it won’t never be less than 0 and the check is then always false. Instead check the two values directly before doing the substraction. Message-Id: <20220118211140.8837-1-etienne.brateau@gmail.com>
2022-01-17Pass mach_task_self when deallocating INIT_PORT_CWDIRFlavio Cruz
Message-Id: <YeXBjT8t777b8+AF@viriathus>
2022-01-17Fix const warningsSamuel Thibault
Now that the RPCs have const, this forces us cleaning our const-meant functions.
2022-01-16Make RPC input array parameters constSamuel Thibault
This follows mig's cf4bcc3f1435 ("Also add const qualifiers on server side")
2022-01-09pci-arbiter: Pave the way for installing the bootstrap pci-arbiter on ↵Samuel Thibault
/servers/bus/pci
2022-01-08pci-arbiter: Stop using deprecated region memory pointerJoan Lledó
Use a internal array of pointers instead * pci-arbiter/device_map.h: * Update device_map_region() prototype * Now it receives an output address as parameter * pci-arbiter/device_map.c: * Update device_map_region() definition to match the new prototype * Support for legacy mappings * When the base address is lower than 1 mb * pci-arbiter/func_files.c: * pci-arbiter/netfs_impl.c: * Update calls to device_map_region to match the new prototype * Use the internal array of pointers instead of region->memory * pci-arbiter/pcifs.h: * struct pcifs_dirent: Declare the internal array of pointers Message-Id: <20220108121537.6277-2-jlledom@mailfence.com>
2022-01-07term: Make sure to have ttydefchars use the proper _POSIX_VDISABLESamuel Thibault
For <sys/ttydefaults.h> to catch the proper value of _POSIX_VDISABLE, <unistd.h> has to be included before it. <termios.h> happens to be including it so we have to include <unistd.h> before that.
2022-01-04portinfo: Do not compare port to anything when it is MACH_PORT_DEADSamuel Thibault
Otherwise it would successfully compare to any port that happens to be MACH_PORT_DEAD, e.g. the bootstrap port.
2022-01-04portinfo: Use benign RPCs to discover what ports are all aboutSamuel Thibault
Most servers have at least one RPC which is benign enough to be used to identify whether a port supports the server and provides some useful information to identify what the port is about. This adds support for most of these, allowing to identify auth ports, file descriptors, sockets, etc.
2022-01-04login: More port leaks fixesSamuel Thibault
ports[INIT_PORT_CRDIR] and [INIT_PORT_CWDIR] were obtained from getcrdir() and getcwdir(), so a referenced needs to be released when replacing them.
2022-01-04Fix leaking auth portsSamuel Thibault
We need to be extremely careful with auth ports since leaking them into subprocesses may expose a root-auth port to non-root processes. Notably, get_nonsugid_ids was caching it, thus preventing glibc's exec implementation from dropping it. Login is also reimplementing hurdexec but without all the cloexec logic. This commit fixes various auth leaks.
2022-01-01Fix build warningsSamuel Thibault
No actual behavior change.
2022-01-01pfinet: Fix IPV6 option valuesSamuel Thibault
pfinet is providing the RFC2292 IPv6 options interface, not the RFC3542 interface, so we have to use the old option numbers here.
2022-01-01random: export __trivfs_server_nameSamuel Thibault
Making glibc access trivfs_server_name would violate namespace constraints, so we need to use a out-of-standard name.
2021-12-31random: try opening time from gnumach before from /dev/timeSamuel Thibault
The system-wide random translator can access time from gnumach, while /dev/time comes from storeio, and its libc initialization (starting from glibc 2.34) uses /dev/random, which was thus bringing an initialization loop.
2021-12-30random: Add a trivfs_server_nameSamuel Thibault
glibc uses /dev/urandom for getrandom(), and from version 2.34 malloc initialization uses it. We need to be able to know whether we are running the random translator itself, in which case we can't read ourself.
2021-12-30exec: only constraint loading the ELF interpreterSamuel Thibault
PIE programs do not need bitmask constraints, only the ELF interpreter needs to leave room for a non-PIE program.
2021-12-30libtrivfs: Fix static link of the random translatorv0.9.git20211230Samuel Thibault
It needs to override trivfs_S_io_select.
2021-12-30wire_task_self: Use in various translatorsSamuel Thibault
wire_task_self() was duplicating mach-defpager's wire_all_memory(), we can just make mach-defpager now use the former (and not mlockall either). Also pci-arbiter and rumpdisk can use it.
2021-12-30wire_task_self: Simplify implementationSamuel Thibault
In the dynamic case, loaded() doesn't actually manage to get maps, and in the static case the _start, _etext, __data_start, _edata symbols are not actually precise, and miss some pages. So let's just call wire_segment_internal on the whole addressing space, vm_region tells us which parts are actually mapped to make it efficient enough.
2021-12-29libshouldbeinlibc: Add backtrace_stderr and backtrace_machSamuel Thibault
as convenience for printing a backtrace without erroring out.
2021-12-28rumpdisk: Link with rumpvfs_nofifofs if presentDamien Zammit
Message-Id: <20211228055114.173039-1-damien@zamaudio.com>
2021-12-27rumpdisk: Use raw uncached character device rwdXdDamien Zammit
This disables the rump buffer cache and avoids any magic translation that rump would do. * rumpdisk/block-rump.c (translate_name): Use `/dev/r%sd' format instead of `/dev/%sd'. Message-Id: <20211226113857.150525-4-damien@zamaudio.com>
2021-12-27rumpdisk: Fault-in the memory pagesDamien Zammit
This ensures memory pages are allocated before written to. Message-Id: <20211226113857.150525-6-damien@zamaudio.com>
2021-12-27pci-arbiter,rumpdisk: Lock all memory for swappingDamien Zammit
This locks all memory in bootstrap processes so that disk driver dependencies don't get swapped out. Message-Id: <20211226113857.150525-5-damien@zamaudio.com>
2021-12-27rumpdisk: define _STANDALONE to avoid register_tDamien Zammit
This works around a faulty HAVE_REGISTER_T in rump so the rump.h header can be included without errors. Message-Id: <20211226113857.150525-2-damien@zamaudio.com>
2021-12-25pci-arbiter: Implement memory mapping over region filesJoan Lledó
* pci-arbiter/Makefile: * Add device_map.c to sources * pci-arbiter/device_map.c: * pci-arbiter/device_map.h: * New module for device mapping * Relies on libpciaccess mapping methods * pci-arbiter/func_files.c: * io_region_file(): Use the new device mapping module * pci-arbiter/netfs_impl.c: * Implements netfs_get_filemap(): * Uses the device mapping module to map the region to the arbiter space * Calls the kernel RPC vm_region_create_proxy() to obtain the memory object proxy * Only region files are mapped for now Message-Id: <20211219112647.11512-4-jlledom@mailfence.com>
2021-12-25libnetfs: Implement RPC: io_mapMarcus Brinkmann
* libnetfs/iostubs.c: implement io_map Message-Id: <20211219112647.11512-3-jlledom@mailfence.com>
2021-12-25libnetfs: new user callback: netfs_get_filemap()Joan Lledó
Provide the user with a new callback so they can implement file mapping over file system nodes. * libnetfs/netfs.h: Add prototype for netfs_get_filemap * libnetfs/file-map.c: netfs_get_filemap definition * libnetfs/Makefile: add file-map.c to sources Message-Id: <20211224172132.15058-2-jlledom@mailfence.com>
2021-12-08Add "comm" as a format spec to psAndrea Monaco
comm was not recognized by Hurd's ps as a format spec, but is required by POSIX to display the command name (like "exe", but without the full path).
2021-11-21acpi: Factorize codeAndrea Monaco
* acpi/acpi.c (acpi_get_tables): Factorize code.
2021-11-21acpi: Unignore some mmap failureAndrea Monaco
* acpi/acpi.c (acpi_get_num_tables): Do not ignore mmap failure.
2021-11-21acpi: Fix spurious munmap callAndrea Monaco
* acpi/acpi.c (acpi_get_num_tables, acpi_get_tables): Munmap is not needed, because when mmap_phys_acpi_header returns non-zero, no mmap is performed.
2021-11-18acpi: remove useless code in acpi.cAndrea Monaco
These were writing to an array and then never using it. Maybe they were useful for debugging. Message-Id: <87sfvtmn6r.fsf@autistici.org>
2021-11-11console: fix listing of directory in netfs_get_direntsAndrea Monaco
Listing /dev/vcs which is translated by /hurd/console gives the following: $ ls /dev/vcs ls: reading directory '/dev/vcs': Invalid argument 1 2 3 4 5 6 That error is probably harmless but annoying. It is caused by netfs_get_dirents the last time it is called during listing, because it calls mmap with size = 0. * console/console.c (netfs_get_dirents): Do not call mmap when size is 0.
2021-10-30libnetfs: document return value of netfs_startupAndrea Monaco
* libnetfs/netfs.h: Ditto.
2021-10-16libdirmgt: remove empty librarySamuel Thibault
* libdirmgt: Remove directory.
2021-10-13libtreefs: remove unfinished and unused codeSamuel Thibault
* libtreefs: Remove directory.
2021-08-24configure: Allow libtirpc to be missingSamuel Thibault
The dependency on libtirpc is already optional in the Makefiles, we do not need to fail configure when it is missing. * configure.ac: Do not fail when libtirpc is not available.
2021-08-24Revert "rumpdisk: Use raw uncached character device rwdXd"Samuel Thibault
This reverts commit 517edb7fe7c614a683e18671afc52de8cabe8fdf. It seems to be actually breaking access to the disk.
2021-08-24rumpdisk: Ensure physical allocation of memory for DMA readsDamien Zammit
* rumpdisk/block-rump.c (rumpdisk_device_read): Memset the buffer after allocating it.
2021-08-24rumpdisk: Use raw uncached character device rwdXdDamien Zammit
This disables the rump buffer cache and avoids any magic translation that rump would do. * rumpdisk/block-rump.c (translate_name): Use `/dev/r%sd' format instead of `/dev/%sd'.
2021-08-22nfs/nfsd: Use libtirpcSamuel Thibault
Sun RPC is being phased out from glibc. * configure.ac: Detect libtirpc.pc, subst libtirpc_CFLAGS and libtirpc_LIBS. * config.make.in: Subst libtirpc_CFLAGS and libtirpc_LIBS. * nfs/Makefile, nfsd/Makefile: Include libtirpc_CFLAGS and libtirpc_LIBS * nfs/mount.c: Include <rpc/xdr.h> * nfsd/main.c: Likewise. * nfsd/ops.c: Likewise. * nfsd/cache.c: Undef TRUE/FALSE after including rpc/ headers. * nfsd/loop.c: Likewise.
2021-08-22rumpdisk: Simplify allocating data for device_readSamuel Thibault
* rumpdisk/block-rump.c (rumpdisk_device_read): Use vm_allocate/vm_deallocate instead of mmap/munmap.
2021-08-22rumpdisk: Add missing deallocation in device_writeSamuel Thibault
* rumpdisk/block-rump.c (rumpdisk_device_write): Call vm_deallocate after writing the data.
2021-08-22mach-defpager: Fix error reportingSamuel Thibault
* mach-defpager/main.c (main): After mlockall, report error from errno, not the value returned by mlockall.