summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-11-10xxxjustus/la-merge-0Justus Winter
2016-11-10ext2fs: Fix potential block leak.Justus Winter
* 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.
2016-11-10ext2fs: Fix block allocation.Justus Winter
* ext2fs/xattr.c (ext2_set_xattr): Check returned block number before mapping it.
2016-11-10ext2fs: Require users to opt-in for xattr-based translator records.Justus Winter
* 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.
2016-11-10ext2fs: Do not read translator record on Linux filesystems.Justus Winter
* 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.
2016-11-10ext2fs: Fix block leak in xattr code.Justus Winter
* 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.
2016-11-10ext2fs: Use correct type for sizes.Justus Winter
* 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.
2016-11-10ext2fs: Fix typo.Justus Winter
2016-11-10ext2fs: Use xattr to store passive translatorShengyu Zhang
* 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.
2016-11-10ext2fs: Add support for xattrShengyu Zhang
* 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.
2016-11-06mach-defpager: Fix daemonization.HEADmasterJustus Winter
* mach-defpager/main.c (main): Do not hang if the child dies.
2016-11-05boot: Improve device pass-through.Justus Winter
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.
2016-11-05eth-multiplexer: Generate stable ethernet addresses.Justus Winter
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.
2016-11-05eth-multiplexer: Avoid local definitions.Justus Winter
* 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.
2016-11-05eth-multiplexer: Fix retrieving status of virtual interfaces.Justus Winter
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.
2016-11-05eth-multiplexer: Fix packet delivery.Justus Winter
* 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.
2016-11-04eth-multiplexer: Merge the eth-multiplexer.Zheng Da
* 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.
2016-11-04libbpf: Merge the Berkeley Packet Filter library.Zheng Da
* 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.
2016-11-01Adjust to the fixed new task notifications.Justus Winter
* 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.
2016-11-01boot: Tidy up the argument parser.Justus Winter
* 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.
2016-11-01boot: Add a default boot script.Justus Winter
* 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.
2016-11-01boot: Allow unprivileged users to boot Subhurds.Justus Winter
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.
2016-11-01boot: restore terminal state on exitJustus Winter
* boot/boot.c (host_exit): Make it a function and restore the terminal state.
2016-11-01boot: Move bootscript callbacks.Justus Winter
* boot/boot.c (useropen, load_image, boot_script_exec_cmd): Move... * boot/userland-boot.c: ... here.
2016-11-01boot: Quote arguments containing spaces.Justus Winter
* boot/boot.c (boot_script_exec_cmd): Quote arguments containing spaces.
2016-11-01boot: Use the smallest possible name when inserting rights.Justus Winter
* boot/userland-boot.c (boot_script_insert_right): Use the smallest possible name instead of the local name.
2016-11-01startup: Dump processes if we cannot find the kernel.Justus Winter
* startup/startup.c (dump_processes): New function. (frob_kerne_process): Use the new function.
2016-11-01Add missing spinlock initializersSamuel Thibault
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.
2016-11-01boot: Remove hacks for running boot on UX.Justus Winter
* 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.
2016-11-01proc: Fix new task notifications.Justus Winter
* proc/mgt.c (S_mach_notify_new_task): Fix receiver handling, fix port leak. * proc/mig-mutate.h: Mutate the task notification protocol.
2016-10-31libdiskfs: Factorize code for last hard reference being releasedSamuel Thibault
* 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.
2016-10-31libdiskfs: fix removal of socket nodesSamuel Thibault
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.
2016-10-30Mark library stubs as weakSamuel Thibault
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.
2016-10-30wire console display pagesSamuel Thibault
to work around improper handling of getting paged out. * console/display.c (user_create): Call vm_wire() on the created user data.
2016-10-29Fix typoBrent W. Baccala
* utils/rpctrace.c: Fix typo.
2016-10-27libdiskfs: Make utimes RPC flush pending timestamp updatesSamuel Thibault
Thanks Kalle Olavi Niemitalo for the notice. * libdiskfs/file-utimes.c (diskfs_S_file_utimes): Call diskfs_set_node_times before setting node timestamps.
2016-10-27libdiskfs: Fix timestamp update on file closeSamuel Thibault
* libdiskfs/node-nrele.c (diskfs_nrele): Call diskfs_set_node_times when there are no hard refs any more, like diskfs_nput does.
2016-10-15boot: Ignore EINTR.Justus Winter
* boot/boot.c (main): Ignore EINTR in the loop processing stdin.
2016-10-15Avoid warnings if increasing a threads priority fails.Justus Winter
* 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.
2016-10-15procfs: Gracefully degrade meminfo.Justus Winter
* procfs/rootdir.c (rootdir_gc_meminfo): Just omit the swap information if the default pager is unreachable.
2016-10-10Fix some RPC request headers #ifdef guardsSamuel Thibault
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.
2016-10-09fshelp: Fix fetching the control port.Justus Winter
* 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.
2016-10-09console-client: Remove unused variable.Justus Winter
* console-client/trans.c (console_setup_node): Remove 'bootstrap'.
2016-10-09ext2fs: Poison pointers into dereferenced cache pages.Justus Winter
* 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.
2016-10-08ext2fs: Rename parameter.Justus Winter
* ext2fs/ext2fs.h (sync_global_pointer): Rename 'bptr' so that it doesn't collide with the macro 'bptr'.
2016-10-05trans/crash: Fix setting core file template at runtime.Justus Winter
* 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'.
2016-10-05trans/crash: Use empty core file templates to disable the feature.Justus Winter
* trans/crash.c (parse_opt): Use empty core file templates to disable the feature.
2016-10-05Avoid fatal error handling in option parsers.Justus Winter
* 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.
2016-10-03ext2fs: Disable option to specify alternate superblock.Justus Winter
* ext2fs/ext2fs.c (options): Disable '--sblock', this has never been implemented. (parse_opt): Likewise.
2016-10-03libdiskfs: Fix short-circuiting translators.Justus Winter
* 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.