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: <20250325195221.ipqmtc36vof4vycb@pengutronix.de>
Date: Tue, 25 Mar 2025 20:52:21 +0100
From: Marco Felsch <m.felsch@...gutronix.de>
To: jens.wiklander@...aro.org, sumit.garg@...nel.org,
	akpm@...ux-foundation.org, vbabka@...e.cz, willy@...radead.org
Cc: op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org,
	kernel@...gutronix.de
Subject: Re: [PATCH] tee: shm: fix slab page refcounting

On 25-03-25, Marco Felsch wrote:
> Skip manipulating the refcount in case of slab pages according commit
> b9c0e49abfca ("mm: decline to manipulate the refcount on a slab page").
> 
> Fixes: b9c0e49abfca ("mm: decline to manipulate the refcount on a slab page")
> Signed-off-by: Marco Felsch <m.felsch@...gutronix.de>
> ---
>  drivers/tee/tee_shm.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c
> index daf6e5cfd59a..3d6a3077b6f2 100644
> --- a/drivers/tee/tee_shm.c
> +++ b/drivers/tee/tee_shm.c
> @@ -19,16 +19,24 @@ static void shm_put_kernel_pages(struct page **pages, size_t page_count)
>  {
>  	size_t n;
>  
> -	for (n = 0; n < page_count; n++)
> -		put_page(pages[n]);
> +	for (n = 0; n < page_count; n++) {
> +		struct page *page = pages[n];
> +
> +		if (!PageSlab(page))
> +			put_page(pages[n]);
				  ^
I forgot to change this to page, therefore please ignore this patch.

Regards,
  Marco


> +	}
>  }
>  
>  static void shm_get_kernel_pages(struct page **pages, size_t page_count)
>  {
>  	size_t n;
>  
> -	for (n = 0; n < page_count; n++)
> -		get_page(pages[n]);
> +	for (n = 0; n < page_count; n++) {
> +		struct page *page = pages[n];
> +
> +		if (!PageSlab(page))
> +			get_page(pages[n]);
> +	}
>  }
>  
>  static void release_registered_pages(struct tee_shm *shm)
> -- 
> 2.39.5
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ