From: Prasanna S Panchamukhi <prasanna@in.ibm.com>
To: Zachary Amsden <zach@vmware.com>
Cc: Andi Kleen <ak@suse.de>,
virtualization@lists.osdl.org, Andrew Morton <akpm@osdl.org>,
Chris Wright <chrisw@osdl.org>,
Linus Torvalds <torvalds@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
Martin Bligh <mbligh@mbligh.org>,
Pratap Subrahmanyam <pratap@vmware.com>,
Christopher Li <chrisl@vmware.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 19/21] i386 Kprobes semaphore fix
Date: Thu, 10 Nov 2005 22:03:00 +0530 [thread overview]
Message-ID: <20051110163300.GA8514@in.ibm.com> (raw)
In-Reply-To: <20051109093755.GA10361@in.ibm.com>
resending this mail, since my earlier email did not reach lkml.
On Wed, Nov 09, 2005 at 03:07:55PM +0530, Prasanna S Panchamukhi wrote:
> Zach,
>
> Thanks for doing this.
>
> On Tue, Nov 08, 2005 at 05:36:53AM -0800, Zachary Amsden wrote:
> > Andi Kleen wrote:
> >
> > >On Tuesday 08 November 2005 05:39, Zachary Amsden wrote:
> > >
> > >
> > >>IA-32 linear address translation is loads of fun.
> > >>
> > >>
> > >
> > >Thanks for doing that audit work. Can you please double check x86-64 code
> > >is
> > >ok?
> > >
> > >Actually giving all that complexity maybe it would be better to just
> > >stop handling the case and remove all that. I'm not sure what kprobes
> > >needs it for - it doesn't even handle user space yet and even if it ever
> > >does it is unlikely that handling 16bit code makes much sense. And the
>
>
> The code was added to address the problem related to stealing of interrupts from
> VM86. Please see the discussion thread for more details from the URL below
> http://lkml.org/lkml/2004/11/9/214
>
> > But were kprobes even inteneded for userspace? There are races here
> > that are difficult to close without some heavy machinery, and I would
> > rather not put the machinery in place if simplifying the code is the
> > right answer.
>
> Presently kprobes supports only kernel space probes. Work is in progress
> for user space probes support.
>
> >+ addr = (kprobe_opcode_t *)convert_eip_to_linear(regs,
> >+ regs->eip -
> >sizeof(kprobe_opcode_t),
> >+ ¤t->mm->context, &limit);
> >+
>
> Instead you can check if it is in kernel mode and calculate the address directly
> first, since it is in the fast path.
> addr = regs->eip - sizeof(kprobe_opcode_t);
> else
> addr = convert_eip_to_linear(..);
>
> there by avoiding calling convert_eip_to_linear () in case of every kernel probes.
>
>
> >+ /* Don't let userspace races re-address into kernel space */
> >+ if ((unsigned long)addr > limit)
> >+ return 0;
>
> there is no need for this check here in the fast path, because kprobes handles this
> case by checking if the address is on the kprobes hash list and later returning
> from that point.
>
> Please make sure it pass the test case discussed in the thread, URL is below.
> http://lkml.org/lkml/2004/11/9/214
>
> Thanks
> -Prasanna
> --
> Prasanna S Panchamukhi
> Linux Technology Center
> India Software Labs, IBM Bangalore
> Ph: 91-80-25044636
> <prasanna@in.ibm.com>
--
Have a Nice Day!
Thanks & Regards
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<prasanna@in.ibm.com>
next prev parent reply other threads:[~2005-11-10 5:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-08 4:39 [PATCH 19/21] i386 Kprobes semaphore fix Zachary Amsden
2005-11-08 13:12 ` Andi Kleen
2005-11-08 13:36 ` Zachary Amsden
2005-11-09 13:38 ` Andi Kleen
2005-11-09 16:46 ` Zachary Amsden
2005-11-09 16:58 ` Ingo Molnar
2005-11-09 17:52 ` Zachary Amsden
2005-11-10 18:09 ` Prasanna S Panchamukhi
2005-11-10 14:58 ` Zachary Amsden
2005-11-10 16:16 ` H. Peter Anvin
2005-11-11 15:27 ` Andi Kleen
2005-11-11 15:25 ` Andi Kleen
2005-11-14 5:54 ` Prasanna S Panchamukhi
[not found] ` <20051109093755.GA10361@in.ibm.com>
2005-11-10 16:33 ` Prasanna S Panchamukhi [this message]
[not found] <20051108074430.GG28201@elte.hu>
2005-11-08 13:26 ` Zachary Amsden
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=20051110163300.GA8514@in.ibm.com \
--to=prasanna@in.ibm.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=chrisl@vmware.com \
--cc=chrisw@osdl.org \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@mbligh.org \
--cc=mingo@elte.hu \
--cc=pratap@vmware.com \
--cc=torvalds@osdl.org \
--cc=virtualization@lists.osdl.org \
--cc=zach@vmware.com \
--cc=zwane@arm.linux.org.uk \
/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