public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anurag Aggarwal <a.anurag@samsung.com>
To: Dave Martin <Dave.Martin@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Naveen Kumar <naveen.sel@samsung.com>,
	Narendra Meher <narendra.m1@samsung.com>,
	"nico@linaro.org" <nico@linaro.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ashish Kalra <ashish.kalra@samsung.com>,
	"cpgs ." <cpgs@samsung.com>,
	"anurag19aggarwal@gmail.com" <anurag19aggarwal@gmail.com>,
	"naveenkrishna.ch@gmail.com" <naveenkrishna.ch@gmail.com>,
	Rajat Suri <rajat.suri@samsung.com>,
	Poorva Srivastava <poorva.s@samsung.com>,
	Mohammad Irfan Ansari <mohammad.a2@samsung.com>
Subject: Re: [PATCH V6] ARM : unwinder : Prevent data abort due to stack overflow
Date: Wed, 11 Dec 2013 09:40:34 +0000 (GMT)	[thread overview]
Message-ID: <2150956.98751386754831696.JavaMail.weblogic@epml23> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 1539 bytes --]

>You could try adding some debug printks to see how the backtrace fails.
>You could also try adding a few hand-crafted assembler functions
>with appropriate code and unwind directives to trigger different kinds
>of backtrace failure.  You might have to add a way to artificially limit
>sp_high to check the cases where you run out of stack in the middle of
>popping multiple registers.

I added a a printk statement 
+               if (*vsp >= (unsigned long *)ctrl->sp_high) {
+                       printk(KERN_ERR "Stack Overflow Detected, vsp = %lx",
+                               (unsigned long)*vsp);
+                       return -URC_FAILURE;
+               }

I ran a many test cases to try and get the above print in the dmesg log.

I tried the following things :

1) Calling unwind_backtrace from diffrenet locations in the kernel, I added the unwind call 
in some irq, fork, exit and some sysfs entries call.
2) I limited the value of sp_high in unwind_frame() itself, I tried many values of sp_high, 
varrying from (low + sizeof(ctrl.vrs)/4) to (low + 4*sizeof(ctrl.vrs)).

When running the above cases I was able to see the above printk quiet a few times in dmesg log.

So, the error condition is being handled.

If you have some test cases for verifying the unwinder, please share the same. They might help 
in thorough testing of unwinder.



Regards
Anuragÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

             reply	other threads:[~2013-12-11  9:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  9:40 Anurag Aggarwal [this message]
2013-12-14 10:17 ` [PATCH V6] ARM : unwinder : Prevent data abort due to stack overflow Anurag Aggarwal
  -- strict thread matches above, loose matches on Subject: below --
2014-01-07 13:53 Dave Martin
2013-12-10 17:31 Dave Martin
2013-12-10  3:54 Anurag Aggarwal
2013-12-10 16:19 ` Anurag Aggarwal
2013-12-09 10:47 Anurag Aggarwal
2013-12-09 17:56 ` Dave Martin

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=2150956.98751386754831696.JavaMail.weblogic@epml23 \
    --to=a.anurag@samsung.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=anurag19aggarwal@gmail.com \
    --cc=ashish.kalra@samsung.com \
    --cc=cpgs@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mohammad.a2@samsung.com \
    --cc=narendra.m1@samsung.com \
    --cc=naveen.sel@samsung.com \
    --cc=naveenkrishna.ch@gmail.com \
    --cc=nico@linaro.org \
    --cc=poorva.s@samsung.com \
    --cc=rajat.suri@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