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: <57110FAF.8070401@virtuozzo.com>
Date:	Fri, 15 Apr 2016 18:58:39 +0300
From:	Andrey Ryabinin <aryabinin@...tuozzo.com>
To:	Alexander Potapenko <glider@...gle.com>, <adech.fo@...il.com>,
	<dvyukov@...gle.com>, <cl@...ux.com>, <akpm@...ux-foundation.org>,
	<kcc@...gle.com>
CC:	<kasan-dev@...glegroups.com>, <linux-kernel@...r.kernel.org>,
	<linux-mm@...ck.org>
Subject: Re: [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from
 ksize().



On 04/13/2016 02:20 PM, Alexander Potapenko wrote:
> Instead of calling kasan_krealloc(), which replaces the memory allocation
> stack ID (if stack depot is used), just unpoison the whole memory chunk.
> 
> Signed-off-by: Alexander Potapenko <glider@...gle.com>

Acked-by: Andrey Ryabinin <aryabinin@...tuozzo.com>

> ---
> v2: - splitted v1 into two patches
> ---
>  mm/slab.c | 2 +-
>  mm/slub.c | 5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 17e2848..de46319 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -4324,7 +4324,7 @@ size_t ksize(const void *objp)
>  	/* We assume that ksize callers could use the whole allocated area,
>  	 * so we need to unpoison this area.
>  	 */
> -	kasan_krealloc(objp, size, GFP_NOWAIT);
> +	kasan_unpoison_shadow(objp, size);
>  
>  	return size;
>  }
> diff --git a/mm/slub.c b/mm/slub.c
> index 4dbb109e..62194e2 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -3635,8 +3635,9 @@ size_t ksize(const void *object)
>  {
>  	size_t size = __ksize(object);
>  	/* We assume that ksize callers could use whole allocated area,
> -	   so we need unpoison this area. */
> -	kasan_krealloc(object, size, GFP_NOWAIT);
> +	 * so we need to unpoison this area.
> +	 */
> +	kasan_unpoison_shadow(object, size);
>  	return size;
>  }
>  EXPORT_SYMBOL(ksize);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ