From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>, X86 ML <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Oleg Nesterov <oleg@redhat.com>, Tony Luck <tony.luck@intel.com>,
Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH v2 2/2] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
Date: Fri, 14 Nov 2014 12:45:59 +0530 [thread overview]
Message-ID: <20141114071559.GC12682@linux.vnet.ibm.com> (raw)
In-Reply-To: <CALCETrWYCX28GwAw=D1F862zjyp_Srhc=Bb5E19m=VCo6VLnZA@mail.gmail.com>
* Andy Lutomirski <luto@amacapital.net> [2014-11-13 23:01:12]:
> On Thu, Nov 13, 2014 at 10:08 PM, Srikar Dronamraju
> <srikar@linux.vnet.ibm.com> wrote:
> > * Andy Lutomirski <luto@amacapital.net> [2014-11-13 14:31:21]:
> >
> >> x86 call do_notify_resume on paranoid returns if TIF_UPROBE is set
> >> but not on non-paranoid returns. I suspect that this is a mistake
> >> and that the code only works because int3 is paranoid.
> >>
> >> Setting _TIF_NOTIFY_RESUME in the uprobe code was probably a
> >> workaround for the x86 bug. With that bug fixed, we can remove
> >
> >> _TIF_NOTIFY_RESUME from the uprobes code.
> >>
> >> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> >> Reported-by: Oleg Nesterov <oleg@redhat.com>
> >> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> >> ---
> >> arch/x86/include/asm/thread_info.h | 2 +-
> >> kernel/events/uprobes.c | 1 -
> >> 2 files changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
> >> index 854053889d4d..547e344a6dc6 100644
> >> --- a/arch/x86/include/asm/thread_info.h
> >> +++ b/arch/x86/include/asm/thread_info.h
> >> @@ -141,7 +141,7 @@ struct thread_info {
> >> /* Only used for 64 bit */
> >> #define _TIF_DO_NOTIFY_MASK \
> >> (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \
> >> - _TIF_USER_RETURN_NOTIFY)
> >> + _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE)
> >
> >
> > The comment above says only for 64 bit. So would this still work for
> > i386?
> >
>
> i386 seems to look at _TIF_WORK_MASK (which includes _TIF_UPROBE) for
> everything except syscalls and at _TIF_WORK_SYSCALL_EXIT for syscall
> return (which does not include _TIF_UPROBE). Is that okay?
>
Ok.. That expains (please add my ack to your v3)
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> --Andy
>
> >>
> >> /* flags to check in __switch_to() */
> >> #define _TIF_WORK_CTXSW \
> >> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> >> index 1d0af8a2c646..ed8f2cde34c5 100644
> >> --- a/kernel/events/uprobes.c
> >> +++ b/kernel/events/uprobes.c
> >> @@ -1640,7 +1640,6 @@ bool uprobe_deny_signal(void)
> >> if (__fatal_signal_pending(t) || arch_uprobe_xol_was_trapped(t)) {
> >> utask->state = UTASK_SSTEP_TRAPPED;
> >> set_tsk_thread_flag(t, TIF_UPROBE);
> >> - set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
> >> }
> >> }
> >>
> >> --
> >> 1.9.3
> >>
> >
> > --
> > Thanks and Regards
> > Srikar Dronamraju
> >
>
>
>
> --
> Andy Lutomirski
> AMA Capital Management, LLC
>
--
Thanks and Regards
Srikar Dronamraju
next prev parent reply other threads:[~2014-11-14 7:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 22:31 [PATCH v2 0/2] Handle IST interrupts from userspace on the normal stack Andy Lutomirski
2014-11-13 22:31 ` [PATCH v2 1/2] x86, entry: Switch stacks on a paranoid entry from userspace Andy Lutomirski
2014-11-13 22:31 ` [PATCH v2 2/2] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME Andy Lutomirski
2014-11-14 6:08 ` Srikar Dronamraju
2014-11-14 7:01 ` Andy Lutomirski
2014-11-14 7:15 ` Srikar Dronamraju [this message]
2014-11-13 23:19 ` [PATCH v2 0/2] Handle IST interrupts from userspace on the normal stack Andy Lutomirski
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=20141114071559.GC12682@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=andi@firstfloor.org \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tony.luck@intel.com \
--cc=x86@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