public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Anurag Aggarwal <anurag19aggarwal@gmail.com>
Cc: "naveen.sel@samsung.com" <naveen.sel@samsung.com>,
	"narendra.m1@samsung.com" <narendra.m1@samsung.com>,
	"nico@linaro.org" <nico@linaro.org>,
	Anurag Aggarwal <a.anurag@samsung.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ashish.kalra@samsung.com" <ashish.kalra@samsung.com>,
	"cpgs@samsung.com" <cpgs@samsung.com>,
	"naveenkrishna.ch@gmail.com" <naveenkrishna.ch@gmail.com>,
	"rajat.suri@samsung.com" <rajat.suri@samsung.com>,
	"poorva.s@samsung.com" <poorva.s@samsung.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"mohammad.a2@samsung.com" <mohammad.a2@samsung.com>
Subject: Re: [PATCH] ARM : unwinder : Prevent data abort due to stack overflow
Date: Mon, 9 Dec 2013 14:22:17 +0000	[thread overview]
Message-ID: <20131209142212.GA4281@e103592.cambridge.arm.com> (raw)
In-Reply-To: <CAPoNrtsHOXJMUsgUE_MET298n_H2sC2P+RbfUoG=kqK9chTTHw@mail.gmail.com>

On Sat, Dec 07, 2013 at 01:43:21PM +0530, Anurag Aggarwal wrote:
> >>
> >> +     /* we are just starting, initialize last register set as 0 */
> >> +     ctrl.last_register_set = 0;
> >> +
> >>       while (ctrl.entries > 0) {
> >> -             int urc = unwind_exec_insn(&ctrl);
> >> +             int urc;
> >> +             if ((ctrl.sp_high - ctrl.vrs[SP]) < TOTAL_REGISTERS)
> >> +                     ctrl.last_register_set = 1;
> >
> >If this is done once per unwind_exec_insn(), I think it would be better
> >to put the check at the start of unwind_exec_insn() instead of outside.
> 
> I think it is better to do the above check here only because this check
> is strictly not a part of decoder and execution cycle.
> 
> I think uniwnd_exec_insn(), should only be used for decoding and
> execution of instruction, as you have suggested earlier. So, it makes
> sense to keep it in unwind_frame only().

It's debatable, since the stack checking is an intrinsic part of insn
execution.  But since there is only one call site for unwind_exec_insn
and it is unlikely than another will appear in the future, I am happy
for it to remain in your current form.

Cheers
---Dave

      reply	other threads:[~2013-12-09 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06  6:09 [PATCH] ARM : unwinder : Prevent data abort due to stack overflow Anurag Aggarwal
2013-12-06 12:11 ` Dave Martin
2013-12-07  8:13   ` Anurag Aggarwal
2013-12-09 14:22     ` Dave Martin [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=20131209142212.GA4281@e103592.cambridge.arm.com \
    --to=dave.martin@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=a.anurag@samsung.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