lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Sep 2022 16:21:47 -0700
From:   Suren Baghdasaryan <surenb@...gle.com>
To:     Liam Howlett <liam.howlett@...cle.com>
Cc:     Kent Overstreet <kent.overstreet@...ux.dev>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "michel@...pinasse.org" <michel@...pinasse.org>,
        "jglisse@...gle.com" <jglisse@...gle.com>,
        "mhocko@...e.com" <mhocko@...e.com>,
        "vbabka@...e.cz" <vbabka@...e.cz>,
        "hannes@...xchg.org" <hannes@...xchg.org>,
        "mgorman@...e.de" <mgorman@...e.de>,
        "dave@...olabs.net" <dave@...olabs.net>,
        "willy@...radead.org" <willy@...radead.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "ldufour@...ux.ibm.com" <ldufour@...ux.ibm.com>,
        "laurent.dufour@...ibm.com" <laurent.dufour@...ibm.com>,
        "paulmck@...nel.org" <paulmck@...nel.org>,
        "luto@...nel.org" <luto@...nel.org>,
        "songliubraving@...com" <songliubraving@...com>,
        "peterx@...hat.com" <peterx@...hat.com>,
        "david@...hat.com" <david@...hat.com>,
        "dhowells@...hat.com" <dhowells@...hat.com>,
        "hughd@...gle.com" <hughd@...gle.com>,
        "bigeasy@...utronix.de" <bigeasy@...utronix.de>,
        "rientjes@...gle.com" <rientjes@...gle.com>,
        "axelrasmussen@...gle.com" <axelrasmussen@...gle.com>,
        "joelaf@...gle.com" <joelaf@...gle.com>,
        "minchan@...gle.com" <minchan@...gle.com>,
        "kernel-team@...roid.com" <kernel-team@...roid.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH RESEND 04/28] mm: move mmap_lock assert function definitions

On Thu, Sep 1, 2022 at 1:51 PM Liam Howlett <liam.howlett@...cle.com> wrote:
>
> * Kent Overstreet <kent.overstreet@...ux.dev> [220901 16:24]:
> > On Thu, Sep 01, 2022 at 10:34:52AM -0700, Suren Baghdasaryan wrote:
> > > Move mmap_lock assert function definitions up so that they can be used
> > > by other mmap_lock routines.
> > >
> > > Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
> > > ---
> > >  include/linux/mmap_lock.h | 24 ++++++++++++------------
> > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
> > > index 96e113e23d04..e49ba91bb1f0 100644
> > > --- a/include/linux/mmap_lock.h
> > > +++ b/include/linux/mmap_lock.h
> > > @@ -60,6 +60,18 @@ static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write)
> > >
> > >  #endif /* CONFIG_TRACING */
> > >
> > > +static inline void mmap_assert_locked(struct mm_struct *mm)
> > > +{
> > > +   lockdep_assert_held(&mm->mmap_lock);
> > > +   VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm);
> >
> > These look redundant to me - maybe there's a reason the VM developers want both,
> > but I would drop the VM_BUG_ON() and just keep the lockdep_assert_held(), since
> > that's the standard way to write that assertion.
>
> I think this is because the VM_BUG_ON_MM() will give you a lot more
> information and BUG_ON().
>
> lockdep_assert_held() does not return a value and is a WARN_ON().
>
> So they are partially redundant.

Yeah and I do not intend to change the existing functionality in this
patchset. If needed we can post a separate patch removing the
redundancy but from my experience debugging this code, VM_BUG_ON_MM
reports were very useful.

>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@...roid.com.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ