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: Fri, 18 May 2007 10:32:50 +0200 [thread overview]
Message-ID: <464D64B2.6050104@uni-greifswald.de> (raw)
In-Reply-To: <464CE653.4020006@zytor.com>
H. Peter Anvin wrote:
> Philipp Kohlbecher wrote:
>> (This may be superfluous, but I don't think it hurts and it might
>> prevent future errors.)
>
> ... and it may *cause* future errors by making it harder to find bugs, too.
>
> In other words, your patch doesn't actually fix anything, it *masks*
> potential bugs which would also be triggered by interrupts in kernel
> mode. This is bad.
I am not sure these potential bugs would also be triggered by interrupts
in kernel mode. After all, kernel_execve is a special case: It is the
only case (AFAIK) where a software interrupt is generated while in
kernel mode (intra-privilege interrupt), but (if all goes right) the
iret "returns" to user mode (inter-privilege return).
This iret will pop the ss and esp registers off the stack, so
start_thread (include/asm-i386/processor.h:444) needs to put the correct
values in these stack positions, which it does.
Now, my point is that, when start_thread gets called at the end of a
successful kernel_execve, these stack positions cannot contain what they
are supposed to contain and no space is allocated on the stack for these
register values, so that something else gets overwritten.
It would seem cleaner to handle this special case differently by making
sure that the stack is set up the way it would be for an inter-privilege
interrupt.
- Phil Kohlbecher
next prev parent reply other threads:[~2007-05-18 8:32 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 [this message]
2007-05-18 22:41 ` H. Peter Anvin
2007-05-18 23:08 ` H. Peter Anvin
2007-05-21 10:48 ` Philipp Kohlbecher
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=464D64B2.6050104@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 NNTP newsgroup(s).