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: <6499f37e43ec9_75179294c3@iweiny-mobl.notmuch>
Date:   Mon, 26 Jun 2023 13:22:22 -0700
From:   Ira Weiny <ira.weiny@...el.com>
To:     Sumitra Sharma <sumitraartsy@...il.com>,
        Forest Bond <forest@...ttletooquiet.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        <linux-staging@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
CC:     Ira Weiny <ira.weiny@...el.com>, Fabio <fmdefrancesco@...il.com>,
        "Deepak R Varma" <drv@...lo.com>,
        Sumitra Sharma <sumitraartsy@...il.com>
Subject: Re: [PATCH] drivers/target: Call page_address() on page acquired
 with GFP_KERNEL flag

Sumitra Sharma wrote:
> rd_allocate_sgl_table() acquires a page with alloc_pages(GFP_KERNEL, 0).
> Pages allocated with GFP_KERNEL cannot come from Highmem. This is why
> there is no need to call kmap() on them.
> 
> Therefore, use a plain page_address() on that page.
> 
> Signed-off-by: Sumitra Sharma <sumitraartsy@...il.com>

LGTM:

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

> ---
>  drivers/target/target_core_rd.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
> index 6648c1c90e19..d8ea6aff39a2 100644
> --- a/drivers/target/target_core_rd.c
> +++ b/drivers/target/target_core_rd.c
> @@ -159,9 +159,8 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table *
>  			sg_assign_page(&sg[j], pg);
>  			sg[j].length = PAGE_SIZE;
>  
> -			p = kmap(pg);
> +			p = page_address(pg);
>  			memset(p, init_payload, PAGE_SIZE);
> -			kunmap(pg);
>  		}
>  
>  		page_offset += sg_per_table;
> -- 
> 2.25.1
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ