All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Maninder Singh <maninder1.s@samsung.com>
Cc: linux@armlinux.org.uk, cl@linux.com, penberg@kernel.org,
	rientjes@google.com, iamjoonsoo.kim@lge.com,
	akpm@linux-foundation.org, vbabka@suse.cz, 0x7f454c46@gmail.com,
	viro@zeniv.linux.org.uk, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	a.sahrawat@samsung.com, Vaneet Narang <v.narang@samsung.com>
Subject: Re: [PATCH 1/3] mm/slub: fixing backtrace of objects because of redzone adjustment
Date: Tue, 16 Mar 2021 10:44:31 -0700	[thread overview]
Message-ID: <20210316174431.GX2696@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <1615891032-29160-1-git-send-email-maninder1.s@samsung.com>

On Tue, Mar 16, 2021 at 04:07:10PM +0530, Maninder Singh wrote:
> fixing commit 8e7f37f2aaa5 ("mm: Add mem_dump_obj() to print source
> of memory block")
> 
> with current code, Backtrace of allocated object is coming wrong:
> / # cat /proc/meminfo
> [   14.969843]  slab kmalloc-64 start c8ab0140 data offset 64 pointer offset 0 size 64 allocated at 0x6b6b6b6b
> [   14.970635]     0x6b6b6b6b
> [   14.970794]     0x6b6b6b6b
> [   14.970932]     0x6b6b6b6b
> [   14.971077]     0x6b6b6b6b
> [   14.971202]     0x6b6b6b6b
> [   14.971317]     0x6b6b6b6b
> [   14.971423]     0x6b6b6b6b
> [   14.971635]     0x6b6b6b6b
> [   14.971740]     0x6b6b6b6b
> [   14.971871]     0x6b6b6b6b
> [   14.972229]     0x6b6b6b6b
> [   14.972363]     0x6b6b6b6b
> [   14.972505]     0xa56b6b6b
> [   14.972631]     0xbbbbbbbb
> [   14.972734]     0xc8ab0400
> [   14.972891]     meminfo_proc_show+0x40/0x4fc
> 
> And reason is red zone was not adjusted from object address.
> after adding fixup for redzone, backtrace is coming correct:
> / # cat /proc/meminfo
> [   14.870782]  slab kmalloc-64 start c8ab0140 data offset 64 pointer offset 128 size 64 allocated at meminfo_proc_show+0x40/0x4f4
> [   14.871817]     meminfo_proc_show+0x40/0x4f4
> [   14.872035]     seq_read_iter+0x18c/0x4c4
> [   14.872229]     proc_reg_read_iter+0x84/0xac
> [   14.872433]     generic_file_splice_read+0xe8/0x17c
> [   14.872621]     splice_direct_to_actor+0xb8/0x290
> [   14.872747]     do_splice_direct+0xa0/0xe0
> [   14.872896]     do_sendfile+0x2d0/0x438
> [   14.873044]     sys_sendfile64+0x12c/0x140
> [   14.873229]     ret_fast_syscall+0x0/0x58
> [   14.873372]     0xbe861de4
> 
> Signed-off-by: Vaneet Narang <v.narang@samsung.com>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>

Good catch, thank you!  For the series:

Acked-by: Paul E. McKenney <paulmck@kernel.org>

On the other hand, if you would like me to take these, we need to get
a maintainer ack.

							Thanx, Paul

> ---
>  mm/slub.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 1912c4614248..9d13f0117ae6 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4052,6 +4052,7 @@ void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct page *page)
>  	    !(s->flags & SLAB_STORE_USER))
>  		return;
>  #ifdef CONFIG_SLUB_DEBUG
> +	objp = fixup_red_left(s, objp);
>  	trackp = get_track(s, objp, TRACK_ALLOC);
>  	kpp->kp_ret = (void *)trackp->addr;
>  #ifdef CONFIG_STACKTRACE
> -- 
> 2.17.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Maninder Singh <maninder1.s@samsung.com>
Cc: linux@armlinux.org.uk, cl@linux.com, penberg@kernel.org,
	rientjes@google.com, iamjoonsoo.kim@lge.com,
	akpm@linux-foundation.org, vbabka@suse.cz, 0x7f454c46@gmail.com,
	viro@zeniv.linux.org.uk, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	a.sahrawat@samsung.com, Vaneet Narang <v.narang@samsung.com>
Subject: Re: [PATCH 1/3] mm/slub: fixing backtrace of objects because of redzone adjustment
Date: Tue, 16 Mar 2021 10:44:31 -0700	[thread overview]
Message-ID: <20210316174431.GX2696@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <1615891032-29160-1-git-send-email-maninder1.s@samsung.com>

On Tue, Mar 16, 2021 at 04:07:10PM +0530, Maninder Singh wrote:
> fixing commit 8e7f37f2aaa5 ("mm: Add mem_dump_obj() to print source
> of memory block")
> 
> with current code, Backtrace of allocated object is coming wrong:
> / # cat /proc/meminfo
> [   14.969843]  slab kmalloc-64 start c8ab0140 data offset 64 pointer offset 0 size 64 allocated at 0x6b6b6b6b
> [   14.970635]     0x6b6b6b6b
> [   14.970794]     0x6b6b6b6b
> [   14.970932]     0x6b6b6b6b
> [   14.971077]     0x6b6b6b6b
> [   14.971202]     0x6b6b6b6b
> [   14.971317]     0x6b6b6b6b
> [   14.971423]     0x6b6b6b6b
> [   14.971635]     0x6b6b6b6b
> [   14.971740]     0x6b6b6b6b
> [   14.971871]     0x6b6b6b6b
> [   14.972229]     0x6b6b6b6b
> [   14.972363]     0x6b6b6b6b
> [   14.972505]     0xa56b6b6b
> [   14.972631]     0xbbbbbbbb
> [   14.972734]     0xc8ab0400
> [   14.972891]     meminfo_proc_show+0x40/0x4fc
> 
> And reason is red zone was not adjusted from object address.
> after adding fixup for redzone, backtrace is coming correct:
> / # cat /proc/meminfo
> [   14.870782]  slab kmalloc-64 start c8ab0140 data offset 64 pointer offset 128 size 64 allocated at meminfo_proc_show+0x40/0x4f4
> [   14.871817]     meminfo_proc_show+0x40/0x4f4
> [   14.872035]     seq_read_iter+0x18c/0x4c4
> [   14.872229]     proc_reg_read_iter+0x84/0xac
> [   14.872433]     generic_file_splice_read+0xe8/0x17c
> [   14.872621]     splice_direct_to_actor+0xb8/0x290
> [   14.872747]     do_splice_direct+0xa0/0xe0
> [   14.872896]     do_sendfile+0x2d0/0x438
> [   14.873044]     sys_sendfile64+0x12c/0x140
> [   14.873229]     ret_fast_syscall+0x0/0x58
> [   14.873372]     0xbe861de4
> 
> Signed-off-by: Vaneet Narang <v.narang@samsung.com>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>

Good catch, thank you!  For the series:

Acked-by: Paul E. McKenney <paulmck@kernel.org>

On the other hand, if you would like me to take these, we need to get
a maintainer ack.

							Thanx, Paul

> ---
>  mm/slub.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 1912c4614248..9d13f0117ae6 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4052,6 +4052,7 @@ void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct page *page)
>  	    !(s->flags & SLAB_STORE_USER))
>  		return;
>  #ifdef CONFIG_SLUB_DEBUG
> +	objp = fixup_red_left(s, objp);
>  	trackp = get_track(s, objp, TRACK_ALLOC);
>  	kpp->kp_ret = (void *)trackp->addr;
>  #ifdef CONFIG_STACKTRACE
> -- 
> 2.17.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-03-16 17:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210316103723epcas5p1f750d5cfe029fa69aea8d88f0bd408f3@epcas5p1.samsung.com>
2021-03-16 10:37 ` [PATCH 1/3] mm/slub: fixing backtrace of objects because of redzone adjustment Maninder Singh
2021-03-16 10:37   ` Maninder Singh
     [not found]   ` <CGME20210316103736epcas5p3758de57b57c732074acc0989e563cc2e@epcas5p3.samsung.com>
2021-03-16 10:37     ` [PATCH 2/3] mm/slub: Add Support for free path information of an object Maninder Singh
2021-03-16 10:37       ` Maninder Singh
2021-03-18 12:35       ` Vlastimil Babka
2021-03-18 12:35         ` Vlastimil Babka
2021-03-19 23:23         ` Paul E. McKenney
2021-03-19 23:23           ` Paul E. McKenney
     [not found]   ` <CGME20210316103745epcas5p3994f29958b7f14aec8cbd90fa518761f@epcas5p3.samsung.com>
2021-03-16 10:37     ` [PATCH 3/3] arm: print alloc free paths for address in registers Maninder Singh
2021-03-16 10:37       ` Maninder Singh
2021-03-16 17:44   ` Paul E. McKenney [this message]
2021-03-16 17:44     ` [PATCH 1/3] mm/slub: fixing backtrace of objects because of redzone adjustment Paul E. McKenney
2021-03-18 12:33   ` Vlastimil Babka
2021-03-18 12:33     ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210316174431.GX2696@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=a.sahrawat@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@armlinux.org.uk \
    --cc=maninder1.s@samsung.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=v.narang@samsung.com \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.