aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* trans: New random translator.Justus Winter2017-06-0314-1922/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the Hurd included a translator providing /dev/random and /dev/urandom based on a source copy of the random number generator found in classic GnuPG. The new random translator is using the SHAKE128 algorithm from the SHA-3 family as the underlying cryptographic primitive. Being a sponge construction, it allows the extraction of arbitrary amounts of pseudorandom data. It is continuously fed entropy by hashing system state that is hard to predict. * Makefile (prog-subdirs): Remove 'random'. * NEWS: Update. * random/Makefile: Delete file. * random/TODO: Likewise. * random/gnupg-bithelp.h: Likewise. * random/gnupg-glue.h: Likewise. * random/gnupg-random.c: Likewise. * random/gnupg-random.h: Likewise. * random/gnupg-rmd.h: Likewise. * random/gnupg-rmd160.c: Likewise. * random/random.h: Likewise. * sutils/MAKEDEV.sh (random): Create node. (urandom): The new translator is both secure and non-blocking. Create a link from urandom to random for compatibility with Linux. * trans/Makefile (targets): Add 'random'. * trans/random.c: Move the skeleton of the old random translator here, but replace the PRNG with SHAKE128. Remove all dubious attempts of accounting for entropy. Do not block ever.
* procfs: Remove superfluous calls.Justus Winter2017-06-031-8/+0
| | | | | * procfs/rootdir.c (rootdir_gc_vmstat): Remove superfluous 'host_info' calls.
* ext2fs: Reduce verbosity of missing xattr support on the FSSamuel Thibault2017-05-071-2/+2
| | | | | * ext2fs/xattr.c (ext2_list_xattr, ext2_get_xattr): Only warn about missing ext2fs support in debugging mode.
* eth-multiplexer: Fix iohelp missing dependency.Manolis Ragkousis2017-04-081-1/+1
| | | | * eth-multiplexer/Makefile (HURDLIBS): Add iohelp.
* Pass the kernel's task port to proc.Justus Winter2017-03-126-27/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the early server bootstrap relied upon a specific task layout to determine the kernels task port. Explicitly pass it from the kernel instead. * boot/boot.c (default_boot_script): Add '--kernel-task' parameter to ext2fs. (main): New bootscript variable 'kernel-task'. * libdiskfs/boot-start.c (diskfs_kernel_task): Declaration variable. (diskfs_start_bootstrap): If '--kernel-task' was given to us, pass it along to startup. * libdiskfs/opts-std-startup.c (diskfs_kernel_task): New variable. (startup_options): Add '--kernel-task' option. (parse_startup_opt): Handle option. * proc/main.c (kernel_task): New variable. (OPT_KERNEL_TASK): New macro. (options): New variable. (parse_opt): New function. (main): Parse options. Use 'kernel_task' if provided. * release/servers.boot: Add '--kernel-task' parameter to ext2fs. * startup/startup.c (OPT_KERNEL_TASK): New macro. (options): Add '--kernel-task' option. (kernel_task): New variable. (insert_ports_fnc_t): New declaration. (run): Add argument for a function that inserts rights into the newly created task and adds arguments to the argument vector. (argz_task_insert_right): New function. (proc_insert_ports): Likewise. (parse_opt): New function. (main): Pass the kernel's task port to proc. (frob_kernel_process): Use the kernel's task port.
* startup: Simplify reference handling.Justus Winter2017-03-121-9/+3
| | | | | | * startup/startup.c (launch_core_servers): Instead of copying a send right and then deallocating it, move it. (init_stdarrays): Likewise.
* proc: Hierarchical proc servers.Justus Winter2017-03-117-2/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a Subhurd's tasks were shown as weird processes in the Motherhurd. This change connects the proc server in the Motherhurd with the proc server in the Subhurd, embedding the Subhurd's process hierarchy. Subhurd's processes can now be inspected and debugged like any other process. * NEWS: Update. * boot/boot.c (mach_msg_forward): New function. (boot_demuxer): Forward messages arriving on the new task notification port from the proc server, and forward them to the proc server inside the Subhurd via the notification port. * proc/info.c (S_proc_task2proc): Relay request for processes in a task namespace to the Subhurd's proc server. (S_proc_pid2proc): Likewise. (S_proc_getprocargs): Likewise. (S_proc_getprocenv): Likewise. (S_proc_getprocinfo): Likewise. Translate PIDs. (S_proc_getloginid): Likewise. (S_proc_getloginpids): Likewise. * proc/mgt.c (namespace_is_subprocess): New function. (namespace_translate_pids): Likewise. * proc/msg.c (S_proc_getmsgport): Relay request for processes in a task namespace to the Subhurd's proc server. * proc/pgrp.c (S_proc_getsid): Likewise. Translate PIDs. (S_proc_getsessionpids): Likewise. (S_proc_getsessionpgids): Likewise. (S_proc_getpgrppids): Likewise. * proc/proc.h (namespace_is_subprocess): New prototype. (namespace_translate_pids): Likewise.
* hurd: Use polymorphic port types to return some rights.Justus Winter2017-03-104-10/+16
| | | | | | | | | | | | | | | | | | | | | Currently, the RPC definitions of two procedures of the process subsystem assume that the rights are created from a receive right. Similarly, 'proc_getmsgport' assumes that the right is to be copied. This needlessly limits the ability to relay the RPC in server code. This fixes this. The protocol is unchanged, only the generated server stubs assume an additional parameter for the type. * hurd/process.defs (proc_getmsgport): Make 'msgport' parameter polymorphic. (proc_task2proc): Make 'proc' parameter polymorphic. (proc_pid2proc): Likewise. * hurd/process_reply.defs (proc_getmsgport): Likewise. (proc_task2proc_reply): Likewise. (proc_pid2proc_reply): Likewise. * proc/info.c (S_proc_task2proc): Adapt server function. (S_proc_pid2proc): Likewise. * proc/msg.c (S_proc_getmsgport): Likewise.
* proc: Refactor.Justus Winter2017-03-092-8/+18
| | | | | | * proc/mgt.c (namespace_find_root): New function. (process_has_exited): Use new function. * proc/proc.h (namespace_find_root): New declaration.
* proc: Remove erroneous process entry.Justus Winter2017-03-091-0/+31
| | | | | | | | | | | | | Previously, there was a spurious copy of PID 1 in the process table, usually PID 8. PID 1, usually a sysvinit compatible process, needs to be PID 1 even though it is not actually the first process on the Hurd. To this end, PID 1 is reserved, and the task is later supplied to proc via proc_set_init_task once startup starts sysvinit. Fixes 8d16db0cc28b2d911aee918d5c3582ad29ddfeed. * proc/mgt.c (S_proc_set_init_task): Check if sysvinit's task already made it into the process table, and remove it if so.
* boot: Move declaration.Justus Winter2017-03-091-2/+4
| | | | | * boot/boot.c (new_task_notification): Move declaration to the top, add comment.
* proc: Receive new-task notifications on kernel's process port.Justus Winter2017-03-093-2/+14
| | | | | | | * proc/main.c (main): Initialize 'kernel_proc' and use it to register for new-task notifications. * proc/mgt.c (S_mach_notify_new_task): Adapt receiver check. * proc/proc.h (kernel_proc): New variable.
* proc: Open console earlier.Justus Winter2017-03-061-11/+28
| | | | | | | | This way, we can print diagnostics earlier. * proc/main.c (open_console): New function. (main): Call the new function as soon as we have the master device port.
* Avoid ports_interrupt_rpcs cancel itselfSamuel Thibault2017-03-041-2/+6
| | | | | | | | While this does not hurt immediately, callers of ports_interrupt_rpcs would themselves get canceled at the next cancelation point. * libports/interrupt-rpcs.c (ports_interrupt_rpcs): Do not call cancel ourself.
* boot: Make the halt message nicer.Justus Winter2017-03-031-1/+1
| | | | * boot/boot.c (S_host_reboot): Emit a carriage return.
* boot: Fix failing device lookups in unprivileged mode.Justus Winter2017-03-031-0/+3
| | | | | | | | | | | Previously, EMACH_SEND_INVALID_DEST was returned. This had devastating consequences on the translator linkage of storeio translators. When accessed, the parent translator tried to start the translator over and over again, spawning tasks until the system runs out of resources. * boot/boot.c (ds_device_open): Return the correct error when trying to open a non-existent device in unprivileged mode.
* boot: Add a verbose option.Justus Winter2017-02-283-2/+57
| | | | | | | | | | | | * boot/boot.c (verbose): New variable. (options): New option. (parse_opt): Handle new option. (ds_device_open): Be verbose if so desired. (task_died): Likewise. (S_mach_notify_new_task): Likewise. * boot/userland-boot.c (boot_script_task_create): Likewise. (boot_script_task_resume): Likewise. * boot/private.h: New file.
* boot: Cleanup Makefile.Justus Winter2017-02-281-2/+1
| | | | * boot/Makefile (SRCS): Drop removed sources.
* libshouldbeinlibc: Fix NDEBUG build.Justus Winter2017-02-281-1/+1
| | | | | * libshouldbeinlibc/assert-backtrace.h (assert_perror_backtrace): Fix variant for NDEBUG.
* Fix mig URLSamuel Thibault2017-02-141-3/+3
| | | | | | Thanks deathsbreed for the report. configure.ac: Fix mig URL
* Merge remote-tracking branch 'remotes/darnassus/ext2fs-xattrs'Richard Braun2017-01-288-65/+1163
|\
| * ext2fs: downgrade warnings about old translator records to debug messagesRichard Braun2017-01-081-2/+2
| | | | | | | | | | | | ext2fs/inode.c (diskfs_set_translator): Replace call to ext2_warning with ext2_debug. (diskfs_get_translator): Likewise.
| * ext2fs: fix extended attribute retrievalRichard Braun2017-01-061-2/+1
| | | | | | | | | | * ext2fs/xattr.c (ext2_get_xattr): Reset buffer size before each call to xattr_entry_get.
| * ext2fs: minor cleanupRichard Braun2017-01-062-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix some typos, types, add a few checks against integer overflows. ext2fs/inode.c (diskfs_user_read_node): Initialize datalen to 0. (diskfs_set_translator): Fix typo. (diskfs_get_translator): Change datalen type to size_t. * ext2fs/xattr.c (xattr_entry_get): Change type of block parameter to void *. (xattr_entry_create): Guard against integer overflows. (xattr_entry_replace): Likewise. (ext2_set_xattr): Fix typo.
| * ext2fs: fix block referenceRichard Braun2017-01-061-5/+4
| | | | | | | | | | ext2fs/xattr.c (ext2_get_xattr): Keep the inode reference until the block reference is done.
| * ext2fs: Fix potential block leak.Justus Winter2017-01-061-0/+4
| | | | | | | | | | | | * ext2fs/xattr.c (ext2_set_xattr): We allocate a block, but only register it as the inodes acl block on success. Make sure to deallocate the block otherwise.
| * ext2fs: Fix block allocation.Justus Winter2017-01-061-1/+1
| | | | | | | | | | * ext2fs/xattr.c (ext2_set_xattr): Check returned block number before mapping it.
| * ext2fs: Require users to opt-in for xattr-based translator records.Justus Winter2017-01-063-2/+28
| | | | | | | | | | | | | | | | | | | | * ext2fs/ext2fs.c (use_xattr_translator_records): New variable. (X_XATTR_TRANSLATOR_RECORDS): New macro. (options): New option '--x-xattr-translator-records'. (parse_opt): Handle new option. * ext2fs/ext2fs.h (use_xattr_translator_records): New declaration. * ext2fs/inode.c (diskfs_set_translator): Use new variable. (diskfs_get_translator): Likewise.
| * ext2fs: Do not read translator record on Linux filesystems.Justus Winter2017-01-061-4/+0
| | | | | | | | | | | | | | * ext2fs/inode.c (diskfs_user_read_node): Do not read translator record on filesystems using Linux on-disk format. We pondered to use this to introduce the feature, implementing it merely for Linux filesystem.
| * ext2fs: Fix block leak in xattr code.Justus Winter2017-01-061-0/+8
| | | | | | | | | | | | * ext2fs/xattr.c (ext2_set_xattr): Avoid allocating and leaking a block if the caller tries to delete an extended attribute from a node that has no extended attribute in the first place.
| * ext2fs: Use correct type for sizes.Justus Winter2017-01-062-22/+22
| | | | | | | | | | | | | | * ext2fs/ext2fs.h (ext2_{list,get,set}_xattr): Use 'size_t'. * ext2fs/xattr.c (xattr_entry_{list,get,create): Use 'size_t' where appropriate. (ext2_{list,get,set}_xattr): Likewise.
| * ext2fs: Fix typo.Justus Winter2017-01-061-1/+1
| |
| * ext2fs: Use xattr to store passive translatorShengyu Zhang2017-01-061-63/+161
| | | | | | | | | | | | | | * ext2fs/inode.c (diskfs_set_translator): Use xattr to store passive translator if xattr is supported by filesystem. (diskfs_get_translator): Read value of xattr key "gnu.translator" if it exists. (diskfs_user_read_node): Set translator flag on reading.
| * ext2fs: Add support for xattrShengyu Zhang2017-01-066-2/+970
| | | | | | | | | | | | | | | | | | * ext2fs/Makefile (SRCS): Add xattr.c. * ext2fs/ext2_fs.h: Define EXT2_FEATURE_COMPAT_EXT_ATTR. * ext2fs/ext2fs.h: Add xattr functions. * ext2fs/ialloc.c (diskfs_free_node): Free xattr block. * ext2fs/xattr.c: xattr implement. * ext2fs/xattr.h: Likewise.
* | startup: insert the kernel name in its commande lineRichard Braun2017-01-091-0/+2
|/ | | | | | | | This cosmetic change sets argv[0] to "gnumach", making it easier to identify the kernel process. * startup/startup.c (frob_kernel_process): Insert "gnumach" at the start of the kernel command line arguments.
* Disable strict aliasing optimizationsRichard Braun2017-01-061-1/+1
| | | | | | | The code base largely predates strict aliasing rules, and lots of potential violations can be found. Makeconf (CFLAGS): Add -fno-strict-aliasing option.
* Fix indentationSamuel Thibault2017-01-021-23/+23
|
* Fix libports dependenciesSamuel Thibault2017-01-021-1/+1
| | | | | | Due to refcount.h usage. * libports/Makefile (HURDLIBS): Add shouldbeinlibc.
* Revert "libnetfs: remove unused fields."Samuel Thibault2017-01-021-0/+2
| | | | | | This reverts commit 0788437e0953cdd6c8c4cdf25379d8704beb021c. This is actually used by e.g. gopherfs.
* mach-defpager: fix pager leakRichard Braun2016-12-261-12/+20
| | | | | | | | | | | | The server code for no-senders notifications wasn't updated to expect protected payloads. * mach-defpager/default_pager.c (default_pager_no_senders): Accept the pager structure directly instead of its port name and update body accordingly. (default_pager_no_senders): Accept protected payloads in addition to send-once rights and fetch the pager structure according to the message type.
* mach-defpager: make the default pager use vm_wire_allRichard Braun2016-12-244-59/+13
| | | | | | | | | | | | | | | The vm_wire_all call was recently added to GNU Mach so that the default pager doesn't depend on glibc malloc hooks any more. * mach-defpager/default_pager.c (start_default_pager_thread): Remove call to wire_memory. * mach-defpager/kalloc.c (kget_space): Likewise. * mach-defpager/wiring.c: Include mach/gnumach.h. (wire_memory): Remove function. (wire_all_memory): Replace call to wire_memory with a direct call to vm_wire, call vm_wire_all after the fixup loop. (vm_allocate, __vm_allocate): Remove functions. * mach-defpager/wiring.h (wire_memory): Remove function.
* libps: Fix time comparisonSamuel Thibault2016-12-191-1/+1
| | | | | * libps/spec.c (ps_cmp_times): Actually compare tv_usec fields of tv1 and tv2.
* procfs: provide magic retry response for /proc/selfJustus Winter2016-12-195-44/+8
| | | | | | | | | * hurd/hurd_types.h: Document the magic retry string `pid'. * hurd/paths.h (_HURD_MAGIC): New macro. * procfs/main.c: Remove all code related to faking /proc/self. * procfs/main.h: Likewise. * procfs/rootdir.c: Likewise. Instead, return the magic retry response `pid' for the `self' node.
* GNU Hurd 0.9Thomas Schwinge2016-12-182-5/+10
| | | | | * configure.ac (AC_INIT): Set version to 0.9. * NEWS: Finalize for 0.9.
* Fix "random" ChangeLog handlingThomas Schwinge2016-12-172-2/+42
| | | | | | | | | ..., so that the correct things get done for "make dist". * ChangeLog: Elaborate on "random". * Makefile (gitlog-to-changelog_rev, ChangeLog_specs): Add entries for "random". (gen-ChangeLog): Handle that.
* Fix "procfs" ChangeLog handlingThomas Schwinge2016-12-173-63/+93
| | | | | | | | | | | | | ..., so that the correct things get done for "make dist". * procfs/ChangeLog: Merge file into... * ChangeLog: ... this one, and elaborate some more. * Makefile (gen_start_commit, ChangeLog_files): Merge into... (ChangeLog_specs): ... this new variable. (ChangeLog_files): Rewrite in terms of that one. (gitlog-to-changelog_rev, ChangeLog_specs): Add entries for "procfs". (gen-ChangeLog): Handle that.
* * Makefile (gen-ChangeLog): Remove ChangeLog files first.Thomas Schwinge2016-12-171-4/+3
|
* * Makefile (gen-ChangeLog): Remove incomplete "distdir" support.Thomas Schwinge2016-12-171-5/+4
|
* Update NEWS fileJustus Winter2016-12-101-2/+7
|
* Remove support for the deprecated external memory interface.Justus Winter2016-12-102-40/+10
| | | | | | * libpager/stubs.c (_pager_S_memory_object_data_write): Drop stub. * mach-defpager/default_pager.c (seqnos_memory_object_data_write): Drop function.