All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: discuss@x86-64.org
Cc: Ingo Molnar <mingo@elte.hu>, Jan Beulich <jbeulich@novell.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [discuss] Re: [PATCH 3/3] reliable stack trace support (i386)
Date: Tue, 16 May 2006 17:20:41 +0200	[thread overview]
Message-ID: <200605161720.42128.ak@suse.de> (raw)
In-Reply-To: <20060516151422.GD10760@elte.hu>


> > +static inline void
> > +arch_unw_init_blocked(struct unwind_frame_info *info)
> > +{
> > +	memset(&info->regs, 0, sizeof(info->regs));
> > +	info->regs.eip = info->task->thread.eip;
> > +	info->regs.xcs = __KERNEL_CS;
> > +	__get_user(info->regs.ebp, (long *)info->task->thread.esp);
> > +	info->regs.esp = info->task->thread.esp;
> > +	info->regs.xss = __KERNEL_DS;
> > +	info->regs.xds = __USER_DS;
> > +	info->regs.xes = __USER_DS;
> 
> hm, arent you using this from within show_trace()? In that case we 
> shouldnt do a __get_user() i think, we might be in an arbitrary context 

Should be ok. We already do this in some parts of oopsing and the page fault handler 
can handle it as long as there is an exception entry (which is there for this case)

> ...
> 
> > +static inline int
> > +arch_unw_user_mode(const struct unwind_frame_info *info)
> > +{
> > +#if 0 /* This can only work when selector register and EFLAGS saves/restores
> > +         are properly annotated (and tracked in UNW_REGISTER_INFO). */
> > +	return user_mode_vm(&info->regs);
> > +#else
> > +	return info->regs.eip < PAGE_OFFSET;
> > +#endif
> 
> same here as for x86_64: is this condition safe? Userspace can provoke 
> an EIP of >= PAGE_OFFSET by for example jumping to the vsyscall page.

Good point, it's probably not. Especially since we already have a user_mode() macro

-Andi

  reply	other threads:[~2006-05-16 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-16 14:22 [PATCH 3/3] reliable stack trace support (i386) Jan Beulich
2006-05-16 15:14 ` Ingo Molnar
2006-05-16 15:20   ` Andi Kleen [this message]
2006-05-16 15:15 ` Andi Kleen
2006-05-16 16:07   ` Jan Beulich

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=200605161720.42128.ak@suse.de \
    --to=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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.