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: <678137f2106fd_167faf29436@iweiny-mobl.notmuch>
Date: Fri, 10 Jan 2025 09:08:34 -0600
From: Ira Weiny <ira.weiny@...el.com>
To: David Reaver <me@...idreaver.com>, Song Liu <song@...nel.org>, Yu Kuai
	<yukuai3@...wei.com>
CC: David Reaver <me@...idreaver.com>, <linux-raid@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, Krister Johansen <kjlx@...pleofstupid.com>,
	Ira Weiny <ira.weiny@...el.com>, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] md: Replace deprecated kmap_atomic() with
 kmap_local_page()

David Reaver wrote:
> kmap_atomic() is deprecated and should be replaced with kmap_local_page()
> [1][2]. kmap_local_page() is faster in kernels with HIGHMEM enabled, can
> take page faults, and allows preemption.
> 
> According to [2], this is safe as long as the code between kmap_atomic()
> and kunmap_atomic() does not implicitly depend on disabling page faults or
> preemption. It appears to me that none of the call sites in this patch
> depend on disabling page faults or preemption; they are all mapping a page
> to simply extract some information from it or print some debug info.
> 
> [1] https://lwn.net/Articles/836144/
> [2] https://docs.kernel.org/mm/highmem.html#temporary-virtual-mappings
> 
> Signed-off-by: David Reaver <me@...idreaver.com>
> ---
> 

[snip]

> @@ -1387,9 +1387,9 @@ static int md_bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
>  			 * If the bitmap is out of date, dirty the whole page
>  			 * and write it out
>  			 */
> -			paddr = kmap_atomic(page);
> +			paddr = kmap_local_page(page);
>  			memset(paddr + offset, 0xff, PAGE_SIZE - offset);
> -			kunmap_atomic(paddr);
> +			kunmap_local(paddr);

For these we defined memset_page()

With that change:

Reviewed-by: Ira Weiny <ira.weiny@...el.com>

[snip]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ