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: <Y2eQd365DU6Zi9wr@hyeyoo>
Date:   Sun, 6 Nov 2022 19:46:15 +0900
From:   Hyeonggon Yoo <42.hyeyoo@...il.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     Vlastimil Babka <vbabka@...e.cz>, Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>, linux-mm@...ck.org,
        stable@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH] mm/slab_common: Restore passing "caller" for tracing

On Fri, Nov 04, 2022 at 11:35:34PM -0700, Kees Cook wrote:
> The "caller" argument was accidentally being ignored in a few places
> that were recently refactored. Restore these "caller" arguments, instead
> of _RET_IP_.
> 
> Cc: Hyeonggon Yoo <42.hyeyoo@...il.com>

Acked-by: Hyeonggon Yoo <42.hyeyoo@...il.com>

> Cc: Vlastimil Babka <vbabka@...e.cz>
> Cc: Christoph Lameter <cl@...ux.com>
> Cc: Pekka Enberg <penberg@...nel.org>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Roman Gushchin <roman.gushchin@...ux.dev>
> Cc: linux-mm@...ck.org
> Fixes: 11e9734bcb6a ("mm/slab_common: unify NUMA and UMA version of tracepoints")
> Cc: stable@...r.kernel.org


BTW I think it can be just sent to next release candidate.
The referred commit was merged in this development cycle.

> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
>  mm/slab_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 33b1886b06eb..0e614f9e7ed7 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -941,7 +941,7 @@ void *__do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller
>  
>  	if (unlikely(size > KMALLOC_MAX_CACHE_SIZE)) {
>  		ret = __kmalloc_large_node(size, flags, node);
> -		trace_kmalloc(_RET_IP_, ret, size,
> +		trace_kmalloc(caller, ret, size,
>  			      PAGE_SIZE << get_order(size), flags, node);
>  		return ret;
>  	}
> @@ -953,7 +953,7 @@ void *__do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller
>  
>  	ret = __kmem_cache_alloc_node(s, flags, node, size, caller);
>  	ret = kasan_kmalloc(s, ret, size, flags);
> -	trace_kmalloc(_RET_IP_, ret, size, s->size, flags, node);
> +	trace_kmalloc(caller, ret, size, s->size, flags, node);
>  	return ret;
>  }
>  
> -- 
> 2.34.1


Thanks for catching this!

-- 
Thanks,
Hyeonggon

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ