Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-14 Thread Vineet Gupta
On Friday 15 February 2013 12:53 PM, Jonas Bonn wrote: > On 11 February 2013 15:07, Al Viro wrote: > >> I'd suggest asking itanic folks; they do *not* put callee-saved stuff into >> sigcontext. AFAICS, they don't have setcontext() implemented as a syscall >> at all - it's done as sigprocmask() +

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-14 Thread Jonas Bonn
On 11 February 2013 15:07, Al Viro wrote: > I'd suggest asking itanic folks; they do *not* put callee-saved stuff into > sigcontext. AFAICS, they don't have setcontext() implemented as a syscall > at all - it's done as sigprocmask() + doing to callee-saved registers what > longjmp() does.

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-14 Thread Jonas Bonn
On 11 February 2013 15:07, Al Viro v...@zeniv.linux.org.uk wrote: I'd suggest asking itanic folks; they do *not* put callee-saved stuff into sigcontext. AFAICS, they don't have setcontext() implemented as a syscall at all - it's done as sigprocmask() + doing to callee-saved registers what

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-14 Thread Vineet Gupta
On Friday 15 February 2013 12:53 PM, Jonas Bonn wrote: On 11 February 2013 15:07, Al Viro v...@zeniv.linux.org.uk wrote: I'd suggest asking itanic folks; they do *not* put callee-saved stuff into sigcontext. AFAICS, they don't have setcontext() implemented as a syscall at all - it's done as

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Al Viro
On Mon, Feb 11, 2013 at 11:30:50AM +0100, Jonas Bonn wrote: > >> Is this really true? Don't setcontext and friends require that _all_ > >> the registers be part of sigcontext? > > > > But for an ABI - callee saved regs will anyhow be saved/restored even in > > setcontext case ! So collecting it

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 06:32 PM, Jonas Bonn wrote: > On 11 February 2013 13:37, Vineet Gupta wrote: >> Anyhow going back to my orig patch - if we park the >> callee-regs-in-sigcontext-or-not, other bits look OK ? >> > Aside from the callee-regs question (which I hope somebody more >

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 13:37, Vineet Gupta wrote: > > Anyhow going back to my orig patch - if we park the > callee-regs-in-sigcontext-or-not, other bits look OK ? > Aside from the callee-regs question (which I hope somebody more knowledgeable can chime in on): Acked-by: Jonas Bonn -- To

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 05:42 PM, Jonas Bonn wrote: > On 11 February 2013 12:22, Vineet Gupta wrote: >> On Monday 11 February 2013 04:23 PM, Jonas Bonn wrote: >>> On 11 February 2013 11:28, James Hogan wrote: On 11/02/13 10:13, Vineet Gupta wrote: > On Monday 11 February 2013 03:06

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 12:22, Vineet Gupta wrote: > On Monday 11 February 2013 04:23 PM, Jonas Bonn wrote: >> On 11 February 2013 11:28, James Hogan wrote: >>> On 11/02/13 10:13, Vineet Gupta wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: > On 11 February 2013 08:26, Vineet

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 04:23 PM, Jonas Bonn wrote: > On 11 February 2013 11:28, James Hogan wrote: >> On 11/02/13 10:13, Vineet Gupta wrote: >>> On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta wrote: > The only downside of this

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread James Hogan
Hi Jonas, On 11/02/13 10:53, Jonas Bonn wrote: > And now that I think about it some more, I think this is done > incorrectly in the openrisc arch, too, as the fast-path for > rt_sigreturn probably only restores the call-clobbered regs. > sigreturn probably needs to be special-cased to _always_

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread James Hogan
On 11/02/13 10:53, Jonas Bonn wrote: > On 11 February 2013 11:28, James Hogan wrote: >> On 11/02/13 10:13, Vineet Gupta wrote: >>> On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta wrote: > The only downside of this patch is that

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 11:28, James Hogan wrote: > On 11/02/13 10:13, Vineet Gupta wrote: >> On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: >>> On 11 February 2013 08:26, Vineet Gupta wrote: >>> The only downside of this patch is that userspace signal stack grows in size,

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 11:13, Vineet Gupta wrote: > On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: >> On 11 February 2013 08:26, Vineet Gupta wrote: >> >>> The only downside of this patch is that userspace signal stack grows in >>> size, >>> since signal frame only cares about scratch regs

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread James Hogan
On 11/02/13 10:13, Vineet Gupta wrote: > On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: >> On 11 February 2013 08:26, Vineet Gupta wrote: >> >>> The only downside of this patch is that userspace signal stack grows in >>> size, >>> since signal frame only cares about scratch regs

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: > On 11 February 2013 08:26, Vineet Gupta wrote: > >> The only downside of this patch is that userspace signal stack grows in size, >> since signal frame only cares about scratch regs (pt_regs), but has to >> accommodate >> unused

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 08:26, Vineet Gupta wrote: > > The only downside of this patch is that userspace signal stack grows in size, > since signal frame only cares about scratch regs (pt_regs), but has to > accommodate > unused placeholder for callee regs too by virtue of using user_regs_struct.

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote: The only downside of this patch is that userspace signal stack grows in size, since signal frame only cares about scratch regs (pt_regs), but has to accommodate unused placeholder for callee regs too by virtue of

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote: The only downside of this patch is that userspace signal stack grows in size, since signal frame only cares about scratch regs (pt_regs), but has to accommodate

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread James Hogan
On 11/02/13 10:13, Vineet Gupta wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote: The only downside of this patch is that userspace signal stack grows in size, since signal frame only cares about scratch

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 11:13, Vineet Gupta vineet.gup...@synopsys.com wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote: The only downside of this patch is that userspace signal stack grows in size, since

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 11:28, James Hogan james.ho...@imgtec.com wrote: On 11/02/13 10:13, Vineet Gupta wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote: The only downside of this patch is that userspace signal

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread James Hogan
On 11/02/13 10:53, Jonas Bonn wrote: On 11 February 2013 11:28, James Hogan james.ho...@imgtec.com wrote: On 11/02/13 10:13, Vineet Gupta wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote: The only downside

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread James Hogan
Hi Jonas, On 11/02/13 10:53, Jonas Bonn wrote: And now that I think about it some more, I think this is done incorrectly in the openrisc arch, too, as the fast-path for rt_sigreturn probably only restores the call-clobbered regs. sigreturn probably needs to be special-cased to _always_

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 04:23 PM, Jonas Bonn wrote: On 11 February 2013 11:28, James Hogan james.ho...@imgtec.com wrote: On 11/02/13 10:13, Vineet Gupta wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote: On 11 February 2013 08:26, Vineet Gupta vineet.gup...@synopsys.com wrote:

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 12:22, Vineet Gupta vineet.gup...@synopsys.com wrote: On Monday 11 February 2013 04:23 PM, Jonas Bonn wrote: On 11 February 2013 11:28, James Hogan james.ho...@imgtec.com wrote: On 11/02/13 10:13, Vineet Gupta wrote: On Monday 11 February 2013 03:06 PM, Jonas Bonn wrote:

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 05:42 PM, Jonas Bonn wrote: On 11 February 2013 12:22, Vineet Gupta vineet.gup...@synopsys.com wrote: On Monday 11 February 2013 04:23 PM, Jonas Bonn wrote: On 11 February 2013 11:28, James Hogan james.ho...@imgtec.com wrote: On 11/02/13 10:13, Vineet Gupta wrote:

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Jonas Bonn
On 11 February 2013 13:37, Vineet Gupta vineet.gup...@synopsys.com wrote: Anyhow going back to my orig patch - if we park the callee-regs-in-sigcontext-or-not, other bits look OK ? Aside from the callee-regs question (which I hope somebody more knowledgeable can chime in on): Acked-by: Jonas

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Vineet Gupta
On Monday 11 February 2013 06:32 PM, Jonas Bonn wrote: On 11 February 2013 13:37, Vineet Gupta vineet.gup...@synopsys.com wrote: Anyhow going back to my orig patch - if we park the callee-regs-in-sigcontext-or-not, other bits look OK ? Aside from the callee-regs question (which I hope

Re: pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-11 Thread Al Viro
On Mon, Feb 11, 2013 at 11:30:50AM +0100, Jonas Bonn wrote: Is this really true? Don't setcontext and friends require that _all_ the registers be part of sigcontext? But for an ABI - callee saved regs will anyhow be saved/restored even in setcontext case ! So collecting it for that

pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-10 Thread Vineet Gupta
Hi Arnd, On Thursday 24 January 2013 04:20 PM, Vineet Gupta wrote: > Includes following fixes courtesy review by Al-Viro > > * Tracer poke to Callee-regs were lost > > Before going off into do_signal( ) we save the user-mode callee regs > (as they are not saved by default as part of

pt_regs leak into userspace (was Re: [PATCH v3 20/71] ARC: Signal handling)

2013-02-10 Thread Vineet Gupta
Hi Arnd, On Thursday 24 January 2013 04:20 PM, Vineet Gupta wrote: Includes following fixes courtesy review by Al-Viro * Tracer poke to Callee-regs were lost Before going off into do_signal( ) we save the user-mode callee regs (as they are not saved by default as part of pt_regs).