[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y21e7vvP54JrtkAp@x1n>
Date: Thu, 10 Nov 2022 15:28:30 -0500
From: Peter Xu <peterx@...hat.com>
To: Nadav Amit <nadav.amit@...il.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Ives van Hoorne <ives@...esandbox.io>
Subject: Re: [PATCH 2/2] mm/uffd: Sanity check write bit for uffd-wp
protected ptes
On Thu, Nov 10, 2022 at 10:43:25AM -0800, Nadav Amit wrote:
> On Nov 10, 2022, at 7:17 AM, Peter Xu <peterx@...hat.com> wrote:
>
> > +#ifdef CONFIG_DEBUG_VM
> > + /*
> > + * Having write bit for wr-protect-marked present ptes is fatal,
> > + * because it means the uffd-wp bit will be ignored and write will
> > + * just go through.
> > + *
> > + * Use any chance of pgtable walking to verify this (e.g., when
> > + * page swapped out or being migrated for all purposes). It means
> > + * something is already wrong. Tell the admin even before the
> > + * process crashes. We also nail it with wrong pgtable setup.
> > + */
> > + WARN_ON_ONCE(wp && pte_write(pte));
>
> How about VM_WARN_ON_ONCE() and no ifdef?
Oops.. Will quickly respin, thanks.
--
Peter Xu
Powered by blists - more mailing lists