Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-24 Thread Jann Horn
On Tue, Sep 24, 2024 at 7:15 PM Matthew Wilcox wrote: > On Fri, Sep 13, 2024 at 12:52:39AM +0200, Jann Horn wrote: > > FWIW, I would still feel happier if this was a 64-bit number, though I > > guess at least with uprobes the attack surface is not that large even > > if you can wrap that counter..

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-24 Thread Matthew Wilcox
On Fri, Sep 13, 2024 at 12:52:39AM +0200, Jann Horn wrote: > FWIW, I would still feel happier if this was a 64-bit number, though I > guess at least with uprobes the attack surface is not that large even > if you can wrap that counter... 2^31 counter increments are not all > that much, especially i

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Jann Horn
On Thu, Sep 12, 2024 at 11:02 PM Suren Baghdasaryan wrote: > Add helper functions to speculatively perform operations without > read-locking mmap_lock, expecting that mmap_lock will not be > write-locked and mm is not modified from under us. I think this is okay now, except for some comments that

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Suren Baghdasaryan
On Thu, Sep 12, 2024 at 3:20 PM Andrii Nakryiko wrote: > > On Thu, Sep 12, 2024 at 2:04 PM Suren Baghdasaryan wrote: > > > > On Thu, Sep 12, 2024 at 2:02 PM Suren Baghdasaryan > > wrote: > > > > > > Add helper functions to speculatively perform operations without > > > read-locking mmap_lock, e

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Andrii Nakryiko
On Thu, Sep 12, 2024 at 2:04 PM Suren Baghdasaryan wrote: > > On Thu, Sep 12, 2024 at 2:02 PM Suren Baghdasaryan wrote: > > > > Add helper functions to speculatively perform operations without > > read-locking mmap_lock, expecting that mmap_lock will not be > > write-locked and mm is not modified

Re: [PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Suren Baghdasaryan
On Thu, Sep 12, 2024 at 2:02 PM Suren Baghdasaryan wrote: > > Add helper functions to speculatively perform operations without > read-locking mmap_lock, expecting that mmap_lock will not be > write-locked and mm is not modified from under us. Here you go. I hope I got the ordering right this time

[PATCH v2 1/1] mm: introduce mmap_lock_speculation_{start|end}

2024-09-12 Thread Suren Baghdasaryan
Add helper functions to speculatively perform operations without read-locking mmap_lock, expecting that mmap_lock will not be write-locked and mm is not modified from under us. Suggested-by: Peter Zijlstra Signed-off-by: Suren Baghdasaryan Signed-off-by: Andrii Nakryiko --- Changes since v1 [1]