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: <CAJF2gTTEaTnUCJhyU-bw=em_fo9ZW6bK=eaahUVsHcXuwaM8rw@mail.gmail.com>
Date: Fri, 23 Feb 2024 19:26:09 +0800
From: Guo Ren <guoren@...nel.org>
To: Yan Zhao <yan.y.zhao@...el.com>
Cc: arnd@...db.de, linus.walleij@...aro.org, bcain@...cinc.com, 
	jonas@...thpole.se, stefan.kristiansson@...nalahti.fi, shorne@...il.com, 
	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-csky@...r.kernel.org, linux-hexagon@...r.kernel.org, 
	linux-openrisc@...r.kernel.org
Subject: Re: [PATCH 1/4] asm-generic/page.h: apply page shift to PFN instead
 of VA in pfn_to_virt

On Wed, Jan 31, 2024 at 2:27 PM Yan Zhao <yan.y.zhao@...el.com> wrote:
>
> Apply the page shift to PFN to get physical address for final VA.
> The macro __va should take physical address instead of PFN as input.
>
> Fixes: 2d78057f0dd4 ("asm-generic/page.h: Make pfn accessors static inlines")
> Signed-off-by: Yan Zhao <yan.y.zhao@...el.com>
> ---
>  include/asm-generic/page.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
> index 9773582fd96e..4f1265207b9a 100644
> --- a/include/asm-generic/page.h
> +++ b/include/asm-generic/page.h
> @@ -81,7 +81,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr)
>  #define virt_to_pfn virt_to_pfn
>  static inline void *pfn_to_virt(unsigned long pfn)
>  {
> -       return __va(pfn) << PAGE_SHIFT;
> +       return __va(pfn << PAGE_SHIFT);
Oh, that's a terrible bug; Thx for fixing it.

Reviewed-by: Guo Ren <guoren@...nel.org>

>  }
>  #define pfn_to_virt pfn_to_virt
>
> --
> 2.17.1
>


-- 
Best Regards
 Guo Ren

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ