Re: [PATCH 2/2] mm/uffd: Sanity check write bit for uffd-wp protected ptes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 10, 2022, at 7:17 AM, Peter Xu <peterx@xxxxxxxxxx> 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?




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux