From: Andi Kleen <ak@muc.de>
To: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Juho Snellman <jsnell@iki.fi>, linux-kernel@vger.kernel.org
Subject: Re: x86-64: int3 no longer causes SIGTRAP in 2.6.10
Date: 19 Jan 2005 13:19:23 +0100
Date: Wed, 19 Jan 2005 13:19:23 +0100 [thread overview]
Message-ID: <20050119121923.GA2027@muc.de> (raw)
In-Reply-To: <20050119113636.GA1498@in.ibm.com>
On Wed, Jan 19, 2005 at 05:06:36PM +0530, Prasanna S Panchamukhi wrote:
> Hi Andi,
>
> > > > - set_intr_gate(3,&int3);
> > > > + set_system_gate(3,&int3);
> > > > set_system_gate(4,&overflow); /* int4-5 can be called from all */
> > > > set_system_gate(5,&bounds);
> > > > set_intr_gate(6,&invalid_op);
> > > > Index: linux/arch/x86_64/kernel/kprobes.c
>
> This looks good to me. Andi do you see any thing that will cause premption
> by moving int3 to system gate.
The only difference between an interrupt gate and a system gate is
that a system gate can be called directly from user space using "int".
I don't see how that would affect preemption.
>
> > > > ===================================================================
> > > > --- linux.orig/arch/x86_64/kernel/kprobes.c 2005-01-04 12:12:39.%N +0100
> > > > +++ linux/arch/x86_64/kernel/kprobes.c 2005-01-18 02:46:05.%N +0100
> > > > @@ -297,6 +297,8 @@
> > > > struct die_args *args = (struct die_args *)data;
> > > > switch (val) {
> > > > case DIE_INT3:
> > > > + if (args->regs->cs & 3)
> > > > + return NOTIFY_DONE;
>
> This will prevent handling of userspace probes (privilege level 3). The
> kprobe_exception handler will return from here and registered user space probe
> handler won't be called.
It's equivalent to the previous code - previously the CPU would reject
the int 3 call though and turn it into an GPF. If you prefer it I can
remove it. But were user space probes ever tested? It doesn't look like it.
If they're broken perhaps it would be better to disable it for now
to prevent any unintended security issues.
-Andi
prev parent reply other threads:[~2005-01-19 12:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-18 1:12 x86-64: int3 no longer causes SIGTRAP in 2.6.10 Juho Snellman
2005-01-18 1:47 ` Andi Kleen
2005-01-18 8:49 ` Prasanna S Panchamukhi
2005-01-18 8:52 ` Andi Kleen
2005-01-19 11:36 ` Prasanna S Panchamukhi
2005-01-19 12:19 ` Andi Kleen [this message]
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=20050119121923.GA2027@muc.de \
--to=ak@muc.de \
--cc=jsnell@iki.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=prasanna@in.ibm.com \
/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