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] [day] [month] [year] [list]
Message-ID: <ZvRPfiS9KTi7NPV4@casper.infradead.org>
Date: Wed, 25 Sep 2024 18:59:26 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Leesoo Ahn <lsahn@...eel.net>
Cc: lsahn@...akecorp.com, Andrew Morton <akpm@...ux-foundation.org>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmzone: remove redundant exception handler on pfn_valid()

On Thu, Sep 26, 2024 at 12:55:28AM +0900, Leesoo Ahn wrote:
> 1). It can ensure the upper PAGE_SHIFT'ed bits of PHYS_PFN(..) are clear
> by the C11 standard:

I don't think you understand the purpose of the code you're removing.

> +++ b/include/linux/mmzone.h
> @@ -2028,15 +2028,6 @@ static inline int pfn_valid(unsigned long pfn)
>  	struct mem_section *ms;
>  	int ret;
>  
> -	/*
> -	 * Ensure the upper PAGE_SHIFT bits are clear in the
> -	 * pfn. Else it might lead to false positives when
> -	 * some of the upper bits are set, but the lower bits
> -	 * match a valid pfn.
> -	 */
> -	if (PHYS_PFN(PFN_PHYS(pfn)) != pfn)
> -		return 0;

Let's assume that the pfn being asked about is 0x8000'0000'0000'1234.
The actually valid PFNs are only 0-0x1000'0000.  This function should
return false.  With your change, it will retrun true because it'll
only check the bottom 52 bits, and ignore that some of the top 12 bits
are set.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ