From: "H. Peter Anvin" <hpa@zytor.com>
To: Matteo Croce <matteo@openwrt.org>
Cc: Thomas Backlund <tmb@mandriva.org>,
linux-kernel@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
Natale Vinto <ebballon@gmail.com>
Subject: Re: AMD Geode NOPL emulation for kernel 2.6.36-rc2
Date: Wed, 08 Sep 2010 13:59:47 -0700 [thread overview]
Message-ID: <4C87F943.4080209@zytor.com> (raw)
In-Reply-To: <AANLkTikaRkwPqB0u3OWknKpG2grZmDR976CBVz7jyVWC@mail.gmail.com>
On 08/29/2010 06:39 AM, Matteo Croce wrote:
> If the parsing fails due get_user returning error I call
> `do_invalid_op(regs, error_code);`
> which is the default handler, which does the page fault.
No, it doesn't. It does an SIGILL, not a SIGSEGV. An application which
does its own VM management depends on the difference.
Also, you only test for specific forms of NOPL, whereas the right thing
is to recognize the overall forms, not just byte sequences.
> to check the CS I do `regs->cs != __USER_CS` but how to check the IP value?
> convert_ip_to_linear() and then check something?
get_user() will check for the validity of a linear address, and yes,
convert_ip_to_linear() should give you the linear address to check for.
However, you also have to check for the CPU mode, since the byte
sequences mean different things in 16-, 32- and 64-bit mode.
All of this is why I'm extremely reluctant to allow in an ad hoc hack
like this one ... there just are way too many pitfalls, any of which can
turn into a security hole.
-hpa
next prev parent reply other threads:[~2010-09-08 21:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 18:07 AMD Geode NOPL emulation for kernel 2.6.36-rc2 Matteo Croce
2010-08-27 18:48 ` H. Peter Anvin
2010-08-27 20:15 ` Matteo Croce
2010-08-27 20:49 ` Thomas Backlund
2010-08-27 21:32 ` Matteo Croce
2010-08-27 22:16 ` Matteo Croce
2010-08-27 22:19 ` Matteo Croce
2010-08-27 23:07 ` H. Peter Anvin
2010-08-29 12:52 ` Avi Kivity
2010-08-29 13:39 ` Matteo Croce
2010-09-08 20:59 ` H. Peter Anvin [this message]
2010-08-27 20:54 ` H. Peter Anvin
[not found] <fmbxh-5N8-41@gated-at.bofh.it>
2010-09-07 15:57 ` Nick Lowe
2010-09-08 9:15 ` Hans-Peter Jansen
2010-09-08 11:34 ` Nick Lowe
2010-09-08 11:55 ` Nick Lowe
2010-09-08 17:56 ` Alan Cox
2010-09-08 17:51 ` Nick Lowe
2010-09-08 19:07 ` Alan Cox
2010-09-08 19:44 ` Nick Lowe
2010-09-08 21:11 ` Alan Cox
2010-09-08 21:05 ` H. Peter Anvin
2010-09-08 21:07 ` Nick Lowe
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=4C87F943.4080209@zytor.com \
--to=hpa@zytor.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=ebballon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matteo@openwrt.org \
--cc=tmb@mandriva.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.