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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YvqnPRmBDgUwKpzg@casper.infradead.org>
Date:   Mon, 15 Aug 2022 21:06:21 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Uladzislau Rezki <urezki@...il.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Joe Perches <joe@...ches.com>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Kees Cook <keescook@...omium.org>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.19 0246/1157] usercopy: use unsigned long instead of
 uintptr_t

On Mon, Aug 15, 2022 at 07:53:22PM +0200, Greg Kroah-Hartman wrote:
> From: Jason A. Donenfeld <Jason@...c4.com>
> 
> [ Upstream commit 170b2c350cfcb6f74074e44dd9f916787546db0d ]
> 
> A recent commit factored out a series of annoying (unsigned long) casts
> into a single variable declaration, but made the pointer type a
> `uintptr_t` rather than the usual `unsigned long`. This patch changes it
> to be the integer type more typically used by the kernel to represent
> addresses.
> 
> Fixes: 35fb9ae4aa2e ("usercopy: Cast pointer to an integer once")

Not sure why this needs to be backported?

> Cc: Matthew Wilcox <willy@...radead.org>
> Cc: Uladzislau Rezki <urezki@...il.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Joe Perches <joe@...ches.com>
> Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> Link: https://lore.kernel.org/r/20220616143617.449094-1-Jason@zx2c4.com
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
>  mm/usercopy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/usercopy.c b/mm/usercopy.c
> index 4e1da708699b..c1ee15a98633 100644
> --- a/mm/usercopy.c
> +++ b/mm/usercopy.c
> @@ -161,7 +161,7 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n,
>  static inline void check_heap_object(const void *ptr, unsigned long n,
>  				     bool to_user)
>  {
> -	uintptr_t addr = (uintptr_t)ptr;
> +	unsigned long addr = (unsigned long)ptr;
>  	unsigned long offset;
>  	struct folio *folio;
>  
> -- 
> 2.35.1
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ