Re: [RFC PATCH 5/7] vm: Eagerly release deallocated pages

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 14:26:54 +0300, a ecrit: > If a deallocated VM map entry refers to an object that only has a single > reference and doesn't have a pager port, we can eagerly release any > physical pages that were contained in the deallocated range. > > This is

Re: [RFC PATCH 4/7] vm: Allow coalescing entries forward

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 14:26:53 +0300, a ecrit: > When entering an object into a map, try to extend the next entry > backward, in addition to the previously existing attempt to extend the > previous entry forward. > --- > vm/vm_map.c | 39

Re: [RFC PATCH 3/7] vm: Allow coalescing null object with an internal object

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 14:26:52 +0300, a ecrit: > Previously, vm_object_coalesce would only succeed with next_object being > VM_OBJECT_NULL (and with the previous patch, with the two object > references pointing to the same object). This patch additionally allows > th

Re: [RFC PATCH 2/7] vm: Allow coalescing a VM object with itself

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 14:26:51 +0300, a ecrit: > If a mapping of an object is made right next to another mapping of the > same object have the same properties (protection, inheritance, etc.), > Mach will now expand the previous VM map entry to cover the new address >

Re: [RFC PATCH 1/7] Shrink struct vm_page size

2023-07-02 Thread Samuel Thibault
Hello, I applied this, *but* I see: * Fields in this structure are locked either by the lock on the * object that the page belongs to (O) or by the lock on the page * queues (P). [Some fields require that both locks be held to * change that field; holding either lock is s

Re: [PATCH 4/4] exec: Properly preallocate address space

2023-07-02 Thread Samuel Thibault
Hello, Sergey Bugaev, le lun. 26 juin 2023 02:11:37 +0300, a ecrit: > @@ -1297,17 +1274,6 @@ do_exec (file_t file, >finish (&interp, 1); > } > > - > - /* Leave room for mmaps etc. before PIE binaries. > - * Could add address randomization here. */ > - anywhere_start += 128 << 2

Re: [PATCH 3/4] exec: On 64-bit, map lower 4 GB inaccessible for PIEs

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 02:11:36 +0300, a ecrit: > 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

Re: [PATCH 1/4] libdiskfs: Don't warn if requesting shutdown notification fails with EPERM

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 02:11:34 +0300, a ecrit: > 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 por

Re: [PATCH 5/5] hurd: Implement MAP_EXCL

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev via Libc-alpha, le lun. 26 juin 2023 02:17:51 +0300, a ecrit: > MAP_FIXED is defined to silently replace any existing mappings at the > address range being mapped over. This, however, is a dangerous, and only > rarely desired behavior. > > Various Unix systems provi

Re: [PATCH 4/5] hurd: Fix mapping at address 0 with MAP_FIXED

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 02:17:50 +0300, a ecrit: > Zero address passed to mmap () typically means the caller doesn't have > any specific preferred address. Not so if MAP_FIXED is passed: in this > case 0 means literal 0. Fix this case to pass anywhere = 0 into vm_map.

Re: [PATCH 3/5] hurd: Fix calling vm_deallocate (NULL)

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 02:17:49 +0300, a ecrit: > Only call vm_deallocate when we do have the old buffer, and check for > unexpected errors. > > Spotted while debugging a msgids/readdir issue on x86_64-gnu. > > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hur

Re: [PATCH 2/5] hurd: Map brk non-executable

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev via Libc-alpha, le lun. 26 juin 2023 02:17:48 +0300, a ecrit: > The rest of the heap (backed by individual pages) is already mapped RW. > Mapping these pages RWX presents a security hazard. > > Also, in another branch memory gets allocated using vm_allocate, which >

Re: [PATCH 1/5] htl: Let Mach place thread stacks

2023-07-02 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le lun. 26 juin 2023 02:17:47 +0300, a ecrit: > Instead of trying to allocate a thread stack at a specific address, > looping over the address space, just set the ANYWHERE flag in > vm_allocate (). The previous behavior: > > - defeats ASLR (for Mach versions that s

Re: [PATCH v2 hurd] rumpusbdisk: Add USB mass storage translator

2023-07-02 Thread Samuel Thibault
Hello, Damien Zammit, le mer. 28 juin 2023 10:52:10 +, a ecrit: > diff --git a/rumpdisk/Makefile b/rumpdisk/Makefile > index b59aaf9a..ab763570 100644 > --- a/rumpdisk/Makefile > +++ b/rumpdisk/Makefile > @@ -15,7 +15,9 @@ Nice, thanks for the factorization! > HURDLIBS = machdev ports trivf

Re: [PATCH v3 0/2]: libirqhelp + libddekit

2023-07-02 Thread Samuel Thibault
Hello, Damien Zammit, le ven. 30 juin 2023 23:52:27 +, a ecrit: > Bumping for review of patchset v3 The mails for these two patches didn't get through, apparently? > > RE: libirqhelp > > > RE: libddekit Samuel