aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* libports: fix using ports.h in C++Samuel Thibault2016-11-271-12/+16
| | | | | | | | | | | | | | class is a reserved keyword, event when imported inside extern "C" { } * libports/ports.h (port_info) [__cplusplus]: Rename `class' field to `port_class'. (ports_create_port, ports_create_port_noinstall, ports_import_port, ports_lookup_port, ports_lookup_payload, ports_count_class, ports_enable_class, ports_class_iterate, _ports_bucket_class_iterate, ports_inhibit_class_rpcs, ports_resume_class_rpcs): Rename `class' parameter to `port_class'. [!__cplusplus] (ports_lookup_payload, ports_payload_get_name): Do not define extern inlines.
* refcount: Fix usage in c++Samuel Thibault2016-11-271-7/+11
| | | | | | | | | | g++ still doens't support non-trivial named initializers (sigh) * libshouldbeinlibc/refcount.h (REFCOUNT_REFERENCES): New macro. (refcounts_init, refcounts_unsafe_ref, refcounts_deref, refcounts_promote, refcounts_demote, refcounts_unsafe_ref_weak, refcounts_deref_weak): Use REFCOUNT_REFERENCES instead of explicit initializer.
* Fix boot startupSamuel Thibault2016-11-201-2/+4
| | | | * boot/boot.c (S_processor_set_tasks): Do not always return 0.
* Fix buildSamuel Thibault2016-11-202-2/+2
| | | | | | * libpager/pager-memcpy.c (pager_memcpy): Pass 1 as second parameter to sigsetjmp. * libstore/memobj.c (memobj_memcpy): Likewise.
* boot: fix crash when S_processor_set_tasks is called earlySamuel Thibault2016-11-201-0/+4
| | | | | * boot/boot.c (S_processor_set_tasks): Return empty array when task_ihash.nr_items is still 0.
* ext2fs: Use more POSIXish error codeSamuel Thibault2016-11-201-0/+2
| | | | | * ext2fs/dir.c (diskfs_direnter_hard): On missing room to extend directory, return ENOSPC.
* ext2fs: Do not talk about crashing on ENOSPCSamuel Thibault2016-11-201-1/+1
| | | | | * ext2fs/pager.c (pager_unlock_page): Do not say that ext2fs will crash because of ENOSPC.
* libpager, libstore: Fix crash on ENOSPC while writing dataSamuel Thibault2016-11-202-4/+6
| | | | | | | | | | | | | We need to save blocked signals, otherwise longjmp will not unblock SIGSEGV/SIGBUS, and thus next exception will kill us. Also, we need to make sure that the preemptor is set at the right window in main memory before letting a handler see it. * libpager/pager-memcpy.c (do_memcpy): Call __sync_synchronize() between aligning the fault preemptor and actually accessing data. (fault): Use siglongjmp instead of longjmp. (pager_memcpy): Use sigsetjmp instead of setjmp. * libstore/memobj.c (copy, fault, memobj_memcpy): Likewise.
* ext2fs: Fix crash on ENOSPC while extending a directorySamuel Thibault2016-11-201-0/+8
| | | | | * ext2fs/dir.c (diskfs_direnter_hard): Call hurd_safe_memset on directory extension before using it, to actually reserve room.
* libpager: fix returning error on data_unlockBrent W. Baccala2016-11-141-1/+1
| | | | | | | | | | | The _pager_lock_object call needs to be asynchronous because libpager is single threaded, at least in the sense that individual memory objects only process one request at a time.  In this case, we're processing a data_unlock request, and would have to handle a lock_completed message before lock_object would return (synchronously). * libpager/data-unlock.c (_pager_S_memory_object_data_unlock): Pass 0 to sync parameter of _pager_lock_object() call.
* mach-defpager: Fix daemonization.Justus Winter2016-11-061-1/+3
| | | | * mach-defpager/main.c (main): Do not hang if the child dies.
* boot: Improve device pass-through.Justus Winter2016-11-051-14/+36
| | | | | | | | | | | | | Previously, the device file was opened once at startup time. This is fragile, as the remote server might die. Open it at device open time instead. * boot/boot.c (options): Improve documentation. (struct dev_map): Rename fields, document, store the name of the device file instead of a port. (add_dev_map): Update accordingly. (lookup_dev): Likewise. (ds_device_open): Open the device file here instead.
* eth-multiplexer: Generate stable ethernet addresses.Justus Winter2016-11-054-3/+39
| | | | | | | | | | | | | | | | Previously, the ethernet multiplexer generated ethernet addresses for the virtual interfaces using a pseudo-random number generator. This has the downside of generating a new address every time. Generate stable pseudo-random addresses instead. * eth-multiplexer/Makefile (HURDLIBS): Link to libihash. * eth-multiplexer/ethernet.c (ether_address): New variable. (get_ethernet_address): New function. (ethernet_open): Get the ethernet address of the real interface. * eth-multiplexer/ethernet.h (ether_address): New declaration. * eth-multiplexer/vdev.c (add_vdev): Compute the ethernet address by hashing the address of the real interface with the name of the virtual interface.
* eth-multiplexer: Avoid local definitions.Justus Winter2016-11-052-10/+2
| | | | | | | | * eth-multiplexer/util.h: Include 'net/if_ether.h'. (ETH_ALEN): Drop. (struct ethhdr): Likewise. * eth-multiplexer/vdev.c: Include 'net/if_ether.h'. (ETH_HLEN): Drop.
* eth-multiplexer: Fix retrieving status of virtual interfaces.Justus Winter2016-11-052-8/+7
| | | | | | | | | | Previously, the ethernet multiplexer returned the status of the real network device if one was configured. This had the unfortunate consequence that all virtual devices shared the same ethernet address. * eth-multiplexer/device_impl.c (ds_device_get_status): Always return the information for the virtual device. * eth-multiplexer/vdev.h (dev_getstat): Add prototype.
* eth-multiplexer: Fix packet delivery.Justus Winter2016-11-051-1/+0
| | | | | | | * eth-multiplexer/vdev.c (deliver_msg): Do not return an error if delivering a message fails. Doing so prevents all other filters from being executed, and more importantly aborts the iteration over all virtual devices.
* eth-multiplexer: Merge the eth-multiplexer.Zheng Da2016-11-0420-2/+2408
| | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile (prog-subdirs): Add the new program. * NEWS: Update. * eth-multiplexer/ChangeLog: New file. * eth-multiplexer/Makefile: Likewise. * eth-multiplexer/README: Likewise. * eth-multiplexer/demuxer.c: Likewise. * eth-multiplexer/dev_stat.c: Likewise. * eth-multiplexer/device_impl.c: Likewise. * eth-multiplexer/ethernet.c: Likewise. * eth-multiplexer/ethernet.h: Likewise. * eth-multiplexer/mig-decls.h: Likewise. * eth-multiplexer/mig-mutate.h: Likewise. * eth-multiplexer/multiplexer.c: Likewise. * eth-multiplexer/netfs_impl.c: Likewise. * eth-multiplexer/netfs_impl.h: Likewise. * eth-multiplexer/notify_impl.c: Likewise. * eth-multiplexer/test.c: Likewise. * eth-multiplexer/util.h: Likewise. * eth-multiplexer/vdev.c: Likewise. * eth-multiplexer/vdev.h: Likewise. The eth-multiplexer has been written by Zheng Da. This merges his work into the main repository.
* libbpf: Merge the Berkeley Packet Filter library.Zheng Da2016-11-048-1/+1618
| | | | | | | | | | | | | | | * Makefile (lib-subdirs): Add new library. * NEWS: Update. * libbpf/Makefile: New file. * libbpf/bpf_impl.c: Likewise. * libbpf/bpf_impl.h: Likewise. * libbpf/queue.c: Likewise. * libbpf/queue.h: Likewise. * libbpf/util.h: Likewise. The Berkeley Packet Filter implementation has been extracted from the Mach kernel by Zheng Da. This merges his work into the main repository.
* Adjust to the fixed new task notifications.Justus Winter2016-11-012-4/+6
| | | | | | * boot/boot.c (S_mach_notify_new_task): The send rights are now indeed moved to the target task, adjust accordingly. * proc/mgt.c (S_mach_notify_new_task): Likewise.
* boot: Tidy up the argument parser.Justus Winter2016-11-011-5/+6
| | | | | | | * boot/boot.c (options): Group options together. Do not end help texts with a colon. (args_doc): Remove variable. (main): Group the store options together.
* boot: Add a default boot script.Justus Winter2016-11-011-48/+90
| | | | | | | | | | | | | * boot/boot.c (OPT_BOOT_SCRIPT): New macro. (options): Add flag '--boot-script'. (args_doc): Do not expect the script as positional argument. (parse_opt): Handle new flag, do not expect the script as positional argument. (read_boot_script): New function. (default_boot_script): New variable containing a boot script capable of booting contemporary Hurd systems. (main): Use the new function to read the boot script, or fall back to using the builtin one.
* boot: Allow unprivileged users to boot Subhurds.Justus Winter2016-11-015-12/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, boot handed privileged kernel ports to Subhurds. This made boot unusable for unprivileged users, and allowed Subhurds to wreak havoc on the whole system. Fix this by handing out pseudo ports instead of the privileged ports. * NEWS: Update. * boot/Makefile (MIGSTUBS): Build stubs for the new kernel interfaces. (MIGSFLAGS): Include mutation file. (HURDLIBS): Link against libihash. * boot/boot.c (privileged, want_privileged): New variables. (pseudo_privileged_host_port): New variable. (pseudo_pset, pseudo_kernel): Likewise. (task_notification_port): Likewise. (dead_task_notification_port): Likewise. (boot_demuxer): Handle new protocols. (OPT_PRIVILEGED): New macro. (options): Add flag '--privileged' to enable the old mode. (parse_opt): Handle new flag. (allocate_pseudo_ports): New function. (main): Handle new flag. If not running privileged, allocate more pseudo ports to hand out in place of privileged kernel ports, create a task namespace, and a task that the Subhurd can frob instead of the real kernel task. (do_mach_notify_dead_name): Handle dying tasks. (S_vm_set_default_memory_manager): New function. (S_host_reboot): Likewise. (S_host_processor_set_priv): Likewise. (S_register_new_task_notification): Likewise. (task_ihash_cleanup): Likewise. (task_ihash): New variable. (task_died): New function. (S_mach_notify_new_task): Likewise. (S_processor_set_tasks): Likewise. * boot/mig-decls.h: New file. * boot/mig-mutate.h: Likewise.
* boot: restore terminal state on exitJustus Winter2016-11-011-1/+7
| | | | * boot/boot.c (host_exit): Make it a function and restore the terminal state.
* boot: Move bootscript callbacks.Justus Winter2016-11-012-207/+212
| | | | | * boot/boot.c (useropen, load_image, boot_script_exec_cmd): Move... * boot/userland-boot.c: ... here.
* boot: Quote arguments containing spaces.Justus Winter2016-11-011-0/+5
| | | | | * boot/boot.c (boot_script_exec_cmd): Quote arguments containing spaces.
* boot: Use the smallest possible name when inserting rights.Justus Winter2016-11-011-3/+12
| | | | | * boot/userland-boot.c (boot_script_insert_right): Use the smallest possible name instead of the local name.
* startup: Dump processes if we cannot find the kernel.Justus Winter2016-11-011-1/+21
| | | | | * startup/startup.c (dump_processes): New function. (frob_kerne_process): Use the new function.
* Add missing spinlock initializersSamuel Thibault2016-11-013-2/+7
| | | | | | | | | | Thanks Agustina Arzille for the report * ext2fs/ext2fs.h (global_lock, modified_global_blocks_lock): Declare extern * ext2fs/ext2fs.c (global_lock, modified_global_blocks_lock): Define and initialize to PTHREAD_SPINLOCK_INITIALIZER. * libtreefs/xinl.c (treefs_node_refcnt_lock): Likewise.
* boot: Remove hacks for running boot on UX.Justus Winter2016-11-019-867/+1
| | | | | | | | | | | | | | * boot/Makefile (COMMON-OBJS): Do not build server stubs for the bootstrap protocol. Remove all UX-related variables and targets. * boot/boot.c: Remove all UX-related definitions and includes. * boot/frank1.ld: Delete file. * boot/frankemul.ld: Likewise. * boot/mach-crt0.c: Likewise. * boot/sigvec.S: Likewise. * boot/syscall.S: Likewise. * boot/ux.c: Likewise. * boot/ux.h: Likewise.
* proc: Fix new task notifications.Justus Winter2016-11-012-5/+16
| | | | | | * proc/mgt.c (S_mach_notify_new_task): Fix receiver handling, fix port leak. * proc/mig-mutate.h: Mutate the task notification protocol.
* libdiskfs: Factorize code for last hard reference being releasedSamuel Thibault2016-10-315-46/+57
| | | | | | | | * libdiskfs/node-lastref.c: New file * libdiskfs/Makefile (OTHERSRCS): Add node-lastref.c * libdiskfs/libdiskfs/node-nput.c (diskfs_nput): Replace last hard reference code with a call to _diskfs_lastref. * libdiskfs/node-nrele.c (diskfs_nrele): Likewise.
* libdiskfs: fix removal of socket nodesSamuel Thibault2016-10-311-0/+6
| | | | | | | | Follow-up on 5ab5d98fa515cd19a64e8d5868fcbae85eec9dc5 ('libdiskfs: fix removal of socket nodes'), for diskfs_nrele. * libdiskfs/node-nrele.c (diskfs_nrele): Deallocate right to socket address when cleaning light references.
* Mark library stubs as weakSamuel Thibault2016-10-307-38/+38
| | | | | | | | | | | | | | | | | | | | | So that static linking of e.g. console.static can work. * libdiskfs/io-stubs.c (diskfs_S_io_readsleep, diskfs_S_io_eofnotify, diskfs_S_io_postnotify, diskfs_S_io_readnotify): Mark weak. * libnetfs/fsstubs.c (netfs_S_file_notice_changes, netfs_S_file_getfh, netfs_S_ifsock_getsockaddr): Likewise. * libnetfs/fsysstubs.c (netfs_S_fsys_getfile: netfs_S_fsys_getpriv, netfs_S_fsys_init, netfs_S_fsys_forward, netfs_S_fsys_startup): Likewise. * libpager/stubs.c (_pager_S_memory_object_copy, _pager_S_memory_object_data_write, _pager_S_memory_object_supply_completed): Likewise. * libtrivfs/fsys-stubs.c (trivfs_S_fsys_startup, trivfs_S_fsys_getpriv, trivfs_S_fsys_init, trivfs_S_fsys_getfile): Likewise. * libtrivfs/io-stubs.c (trivfs_S_io_map_cntl, trivfs_S_io_get_conch, trivfs_S_io_release_conch, trivfs_S_io_eofnotify, trivfs_S_io_prenotify, trivfs_S_io_postnotify, trivfs_S_io_readsleep, trivfs_S_io_sigio, trivfs_S_io_readnotify): Likewise.
* wire console display pagesSamuel Thibault2016-10-301-0/+15
| | | | | | to work around improper handling of getting paged out. * console/display.c (user_create): Call vm_wire() on the created user data.
* Fix typoBrent W. Baccala2016-10-291-1/+1
| | | | * utils/rpctrace.c: Fix typo.
* libdiskfs: Make utimes RPC flush pending timestamp updatesSamuel Thibault2016-10-271-0/+3
| | | | | | | Thanks Kalle Olavi Niemitalo for the notice. * libdiskfs/file-utimes.c (diskfs_S_file_utimes): Call diskfs_set_node_times before setting node timestamps.
* libdiskfs: Fix timestamp update on file closeSamuel Thibault2016-10-271-0/+4
| | | | | * libdiskfs/node-nrele.c (diskfs_nrele): Call diskfs_set_node_times when there are no hard refs any more, like diskfs_nput does.
* boot: Ignore EINTR.Justus Winter2016-10-151-1/+2
| | | | * boot/boot.c (main): Ignore EINTR in the loop processing stdin.
* Avoid warnings if increasing a threads priority fails.Justus Winter2016-10-152-1/+11
| | | | | | | * libports/manage-multithread.c (adjust_priorities): Avoid displaying error messages if we do not have the privileged processor set port by treating this error condition like EPERM. * proc/main.c (increase_priority, main): Likewise.
* procfs: Gracefully degrade meminfo.Justus Winter2016-10-151-12/+32
| | | | | * procfs/rootdir.c (rootdir_gc_meminfo): Just omit the swap information if the default pager is unreachable.
* Fix some RPC request headers #ifdef guardsSamuel Thibault2016-10-103-3/+3
| | | | | | | | by fixing the subsystem name into containing _request. * hurd/auth_request.defs: Set subsystem name to auth_request. * hurd/io_request.defs: Set subsystem name to io_request. * hurd/process_request.defs: Set subsystem name to process_request.
* fshelp: Fix fetching the control port.Justus Winter2016-10-091-2/+13
| | | | | | * libfshelp/fetch-control.c (fshelp_fetch_control): Check if the control port is still alive, or deallocate the dead name, record the fact in the transbox, and return MACH_PORT_NULL.
* console-client: Remove unused variable.Justus Winter2016-10-091-3/+1
| | | | * console-client/trans.c (console_setup_node): Remove 'bootstrap'.
* ext2fs: Poison pointers into dereferenced cache pages.Justus Winter2016-10-093-6/+10
| | | | | | | | | * ext2fs/ext2fs.h (disk_cache_block_deref): Replace with a macro that NULLs the given pointer. (dino_deref): Likewise. * ext2fs/pager.c (disk_cache_block_deref): Rename. * ext2fs/pokel.c (pokel_add): Adapt. (pokel_exec): Likewise.
* ext2fs: Rename parameter.Justus Winter2016-10-081-3/+3
| | | | | * ext2fs/ext2fs.h (sync_global_pointer): Rename 'bptr' so that it doesn't collide with the macro 'bptr'.
* trans/crash: Fix setting core file template at runtime.Justus Winter2016-10-051-1/+21
| | | | | | | * trans/crash.c (corefile_template_lock): New variable. (S_crash_dump_task): Serialize access to 'corefile_template'. (parse_opt): Likewise. Also strdup the template. (trivfs_append_args): Serialize access to 'corefile_template'.
* trans/crash: Use empty core file templates to disable the feature.Justus Winter2016-10-051-1/+4
| | | | | * trans/crash.c (parse_opt): Use empty core file templates to disable the feature.
* Avoid fatal error handling in option parsers.Justus Winter2016-10-053-3/+13
| | | | | | | * trans/crash.c (parse_opt): Avoid 'error' in favor of the appropriate argp error reporting mechanism. * trans/remap.c (parse_opt): Likewise. * utils/msgids.c (parse_opt): Likewise.
* ext2fs: Disable option to specify alternate superblock.Justus Winter2016-10-031-0/+9
| | | | | | * ext2fs/ext2fs.c (options): Disable '--sblock', this has never been implemented. (parse_opt): Likewise.
* libdiskfs: Fix short-circuiting translators.Justus Winter2016-10-031-1/+14
| | | | | | | | | * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): When setting a short-circuited translator, clear the translator record first. Improve error handling. This notably fixes a crash in ext2fs when setting a symlink on a node with an existing translator record.