linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Kohlbecher <pk031698@uni-greifswald.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Dave Jones <davej@codemonkey.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, linux-assembly@vger.kernel.org
Subject: Re: [PATCH 2.6.21.1] i386: save registers before intra-privilege syscall
Date: Mon, 21 May 2007 12:48:42 +0200	[thread overview]
Message-ID: <4651790A.2050703@uni-greifswald.de> (raw)
In-Reply-To: <464E2B97.9040205@zytor.com>

H. Peter Anvin wrote:
> Sticking kernel mode values in those fields would add no value, except
> as a poison (since %ss == KERNEL_DS and would cause a #GP(0) if it ever
> reached IRET.)  If anything, those fields should be pushed as zero or
> some other poison bits.  That would be slightly better than what's there
> now, which is whatever garbage happens to be on the stack.  Pushing the
> kernel SS:ESP is just plain wrong (not to mention that the way you do it
> doesn't even produce the right value for ESP -- you'd have to save away
> ESP before you push SS.)

That's true. The xss and esp fields of the pt_regs struct always contain
either garbage (for interrupts occuring while in kernel mode) or
user-mode values (for interrupts occuring while in user mode).
So, filling these fields with kernel-mode values indeed doesn't make
much sense.

Allocating space on the stack and poisoning those values would make
sense, though, so I will modify the patch accordingly and resend it.

Thank you for your feedback!

- Philipp Kohlbecher

      parent reply	other threads:[~2007-05-21 10:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17 22:06 [PATCH 2.6.21.1] i386: save registers before intra-privilege syscall Philipp Kohlbecher
2007-05-17 22:16 ` H. Peter Anvin
2007-05-17 23:27   ` Philipp Kohlbecher
2007-05-17 23:33     ` H. Peter Anvin
2007-05-18  8:32       ` Philipp Kohlbecher
2007-05-18 22:41         ` H. Peter Anvin
2007-05-18 23:08           ` H. Peter Anvin
2007-05-21 10:48           ` Philipp Kohlbecher [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=4651790A.2050703@uni-greifswald.de \
    --to=pk031698@uni-greifswald.de \
    --cc=arnd@arndb.de \
    --cc=davej@codemonkey.org.uk \
    --cc=hpa@zytor.com \
    --cc=linux-assembly@vger.kernel.org \
    --cc=linux-kernel@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).