public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling•org>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: linuxppc-dev@lists•ozlabs.org, Matt Evans <matt@ozlabs•org>
Subject: Re: [PATCH 2/5] powerpc/tm: Fix 32 bit non-rt signals
Date: Sun, 09 Jun 2013 20:12:29 +1000	[thread overview]
Message-ID: <24241.1370772749@ale.ozlabs.ibm.com> (raw)
In-Reply-To: <1370762745.14883.11.camel@pasglop>

Benjamin Herrenschmidt <benh@kernel•crashing.org> wrote:

> On Fri, 2013-06-07 at 20:36 +1000, Michael Neuling wrote:
> > Currently sys_sigreturn() is TM unaware.  Therefore, if we take a 32 bit signal
> > without SIGINFO (non RT) inside a transaction, on signal return we don't
> > restore the signal frame correctly.
> > 
> > This checks if the signal frame being restoring is an active transaction, and
> > if so, it copies the additional state to ptregs so it can be restored.
> > 
> > Signed-off-by: Michael Neuling <mikey@neuling•org>
> > ---
> 
>  .../...
> 
> > +#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> > +	mcp = (struct mcontext __user *)&sf->mctx;
> > +	tm_mcp = (struct mcontext __user *)&sf->mctx_transact;
> > +	if (__get_user(msr_hi, &tm_mcp->mc_gregs[PT_MSR]))
> >  		goto badframe;
> > +	if MSR_TM_ACTIVE(msr_hi<<32) {
> 
> Mising ( and ). I'll apply that fix locally.
> 
> Appart from that, I suppose it's ok. I don't see any exposure
> coming from users "cooking" the tm_frame and calling sigreturn,
> so as long as we are confident userspace generally only uses
> sigreturn with frames it got from an actual signal, and doesn't
> try to "generate" frames by hand, we should be ok.

We should add a has_cpu_feature(TM) here also in case someone cooks up
an sig frame with MSR TM active, but on a non TM CPU.  This could possibly
result in a trecheckpoint on a non TM CPU hence an illegal in the
kernel.  

I'll repost.

Thanks,
Mikey

  reply	other threads:[~2013-06-09 10:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 10:36 [PATCH 1/5] powerpc/tm: Fix writing top half of MSR on 32 bit signals Michael Neuling
2013-06-07 10:36 ` [PATCH 2/5] powerpc/tm: Fix 32 bit non-rt signals Michael Neuling
2013-06-09  7:25   ` Benjamin Herrenschmidt
2013-06-09 10:12     ` Michael Neuling [this message]
2013-06-07 10:36 ` [PATCH 3/5] powerpc/tm: Fix restoration of MSR on 32bit signal return Michael Neuling
2013-06-09  7:27   ` Benjamin Herrenschmidt
2013-06-09  9:56     ` Michael Neuling
2013-06-07 10:36 ` [PATCH 4/5] powerpc/tm: Fix return of 32bit rt signals to active transactions Michael Neuling
2013-06-07 10:36 ` [PATCH 5/5] powerpc/tm: Fix return of active 64bit signals Michael Neuling

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=24241.1370772749@ale.ozlabs.ibm.com \
    --to=mikey@neuling$(echo .)org \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=matt@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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