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:   Fri, 21 Sep 2018 13:07:24 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     x86@...nel.org, Peter Zijlstra <peterz@...radead.org>,
        Bin Yang <bin.yang@...el.com>,
        Mark Gross <mark.gross@...el.com>
Subject: Re: [patch V3 08/11] x86/mm/cpa: Add sanity check for existing
 mappings

On 09/17/2018 07:29 AM, Thomas Gleixner wrote:
> +	/*
> +	 * If this is splitting a PMD, fix it up. PUD splits cannot be
> +	 * fixed trivially as that would require to rescan the newly
> +	 * installed PMD mappings after returning from split_large_page()
> +	 * so an eventual further split can allocate the necessary PTE
> +	 * pages. Warn for now and revisit it in case this actually
> +	 * happens.
> +	 */
> +	if (size == PAGE_SIZE)
> +		ref_prot = prot;
> +	else
> +		pr_warn_once("CPA: Cannot fixup static protections for PUD split\n");
> +set:
> +	set_pte(pte, pfn_pte(pfn, ref_prot));
> +}

This looked a _little_ bit funky to me.  It talks about splitting up
PMDs and PUDs, but it wasn't immediately obvious why it never looks for
PMD or PUD sizes.

It's because split_set_pte()'s "size" is the size we are splitting *to*.
 IOW, a PMD split gets PAGE_SIZE and a PUD split gets PMD_SIZE.  It's
obvious with a bit more context, so it might be handy to include a blurb
in the comment about what 'size' is *of*.

Reviewed-by: Dave Hansen <dave.hansen@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ