mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Maninder Singh <maninder1.s@samsung.com>,
	akpm@linux-foundation.org, dvyukov@google.com,
	chris@chris-wilson.co.uk, kasan-dev@googlegroups.com,
	mark.rutland@arm.com
Cc: linux-kernel@vger.kernel.org, pankaj.m@samsung.com,
	a.sahrawat@samsung.com, Vaneet Narang <v.narang@samsung.com>
Subject: Re: [PATCH v2] stackdepot: ignore junk last entry in case of switch from user mode.
Date: Fri, 13 Oct 2017 18:19:21 +0300	[thread overview]
Message-ID: <2bd4d082-a62a-f956-0764-9962d8c05d89@virtuozzo.com> (raw)
In-Reply-To: <1507725802-44574-1-git-send-email-maninder1.s@samsung.com>

On 10/11/2017 03:43 PM, Maninder Singh wrote:
> Issue observed on ARM.
> 
> Whenever there is switch from user mode, we end up with invalid last entry
> with some user space address as below:-
> 
>  save_stack+0x40/0xec
>  __set_page_owner+0x2c/0x64
> ....
> ....
>  __handle_domain_irq+0x9c/0x130
>  gic_handle_irq+0x40/0x80
>  __irq_usr+0x4c/0x60
>  0xb6507818
> 

Sounds like an ARM issue to me.

...
 
> diff --git a/lib/stackdepot.c b/lib/stackdepot.c
> index f87d138..a045748 100644
> --- a/lib/stackdepot.c
> +++ b/lib/stackdepot.c
> @@ -214,6 +214,13 @@ depot_stack_handle_t depot_save_stack(struct stack_trace *trace,
>  	if (unlikely(trace->nr_entries == 0))
>  		goto fast_exit;
>  
> +	/* 
> +	 * Ignore last entry if it belongs to user space

And if it belongs to module too. NACK.


> +	 * in case of switch from user mode.
> +	 */
> +	if (!kernel_text_address(trace->entries[trace->nr_entries - 1]))
> +		trace->nr_entries--;
> +
>  	hash = hash_stack(trace->entries, trace->nr_entries);
>  	bucket = &stack_table[hash & STACK_HASH_MASK];
>  
> 

      parent reply	other threads:[~2017-10-13 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171011124443epcas5p23a0d74a4628baa3a1b424cb363fc5c81@epcas5p2.samsung.com>
2017-10-11 12:43 ` Maninder Singh
     [not found]   ` <CGME20171011124443epcas5p23a0d74a4628baa3a1b424cb363fc5c81@epcms5p3>
2017-10-12 11:10     ` Vaneet Narang
2017-10-12 13:59       ` Dmitry Vyukov
2017-10-13 15:19   ` Andrey Ryabinin [this message]

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=2bd4d082-a62a-f956-0764-9962d8c05d89@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=a.sahrawat@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=dvyukov@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=pankaj.m@samsung.com \
    --cc=v.narang@samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®