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]
Message-ID: <CAKha_soMjczpY3HTpPVuw-fKTq0ZATdCnaPKPrsnTj_5ROepmA@mail.gmail.com>
Date: Sat, 7 Jun 2025 12:21:14 -0400
From: Tal Zussman <tz2294@...umbia.edu>
To: David Hildenbrand <david@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/debug: Use BUILD_BUG_ON_INVALID() for VIRTUAL_BUG_ON()

On Sat, Jun 7, 2025 at 3:59 AM David Hildenbrand <david@...hat.com> wrote:
> On 07.06.25 09:09, Tal Zussman wrote:
> > This allows the compiler to validate the condition even with
> > CONFIG_DEBUG_VIRTUAL disabled, and aligns VIRTUAL_BUG_ON() with the
> > other macros in mmdebug.h.
> >
>
> In the light of recent discussions, I think we should get rid of
> VIRTUAL_BUG_ON completely.
>
> There are only a hand full of callers, and I am preety sure for most of
> them VM_WARN_ON is a suitable replacement.

Makes sense. However, all of the callers (except for vmalloc) are already
gated by CONFIG_DEBUG_VIRTUAL, which doesn't depend on CONFIG_DEBUG_VM, so
using VM_WARN_ON_ONCE() would break DEBUG_VIRTUAL on its own.

Perhaps it makes sense to convert the non-vmalloc callers to WARN_ON_ONCE()
instead so DEBUG_VIRTUAL still works. The vmalloc caller would then become

        if (IS_ENABLED(CONFIG_DEBUG_VIRTUAL))
                WARN_ON_ONCE(...);

as opposed to VM_WARN_ON_ONCE(), in order to maintain the existing
DEBUG_VIRTUAL behavior.

Alternatively, DEBUG_VIRTUAL could be folded into DEBUG_VM, but that seems
like a slightly more invasive change...

Thanks,
Tal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ