public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: "Jan Beulich" <jbeulich@novell.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] more sanity checks in Dwarf2 unwinder
Date: Wed, 29 Nov 2006 14:14:55 +0100	[thread overview]
Message-ID: <200611291414.56268.ak@suse.de> (raw)
In-Reply-To: <456D7985.76E4.0078.0@novell.com>

On Wednesday 29 November 2006 12:13, Jan Beulich wrote:
> Tighten the requirements on both input to and output from the Dwarf2
> unwinder.

Thanks for doing this.

>  	while (unwind(info) == 0 && UNW_PC(info)) {
>  		n++;
>  		oad->ops->address(oad->data, UNW_PC(info));
>  		if (arch_unw_user_mode(info))
>  			break;
> +		if ((sp & ~(PAGE_SIZE - 1)) == (UNW_SP(info) & ~(PAGE_SIZE - 1))
> +		    && sp > UNW_SP(info))
> +			break;

Hmm, but that wouldn't catch the case when the SP is completely
corrupted for some reason.
Maybe it would be better to just run a brute force check here like 
the old in_exception_stack(). Similar on x86-64.

> +	if (UNW_PC(frame) % state.codeAlign
> +	    || UNW_SP(frame) % sleb128abs(state.dataAlign)
> +	    || (pc == UNW_PC(frame) && sp == UNW_SP(frame)))
> +		return -EIO;

Would it be possible to add printks for the EIOs? We want to know 
when dwarf2 is corrupted.

-Andi

  reply	other threads:[~2006-11-29 13:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 11:13 [PATCH] more sanity checks in Dwarf2 unwinder Jan Beulich
2006-11-29 13:14 ` Andi Kleen [this message]
2006-11-29 14:00   ` Jan Beulich
2006-12-04 16:20   ` Jan Beulich
2006-12-06 16:41     ` Andi Kleen

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=200611291414.56268.ak@suse.de \
    --to=ak@suse.de \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    /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