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: <657fbdb5db945_126a129483@iweiny-mobl.notmuch>
Date: Sun, 17 Dec 2023 19:34:13 -0800
From: Ira Weiny <ira.weiny@...el.com>
To: "Fabio M. De Francesco" <fabio.maria.de.francesco@...ux.intel.com>, Andrew
 Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
	<linux-kernel@...r.kernel.org>
CC: "Fabio M. De Francesco" <fabio.maria.de.francesco@...ux.intel.com>, "Ira
 Weiny" <ira.weiny@...el.com>
Subject: Re: [PATCH] mm/memory: Replace kmap() with kmap_local_page()

Fabio M. De Francesco wrote:

[snip]

> 
> Cc: Ira Weiny <ira.weiny@...el.com>
> Signed-off-by: Fabio M. De Francesco <fabio.maria.de.francesco@...ux.intel.com>
> ---
>  mm/memory.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index 7d9f6b685032..88377a107fbe 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -5852,7 +5852,7 @@ static int __access_remote_vm(struct mm_struct *mm, unsigned long addr,
>  			if (bytes > PAGE_SIZE-offset)
>  				bytes = PAGE_SIZE-offset;
>  
> -			maddr = kmap(page);
> +			maddr = kmap_local_page(page);
>  			if (write) {
>  				copy_to_user_page(vma, page, addr,
>  						  maddr + offset, buf, bytes);
> @@ -5861,8 +5861,7 @@ static int __access_remote_vm(struct mm_struct *mm, unsigned long addr,
>  				copy_from_user_page(vma, page, addr,
>  						    buf, maddr + offset, bytes);
>  			}
> -			kunmap(page);
> -			put_page(page);
> +			unmap_and_put_page(page, maddr);

Does this really have the same functionality?

Ira

Powered by blists - more mailing lists