From: Andi Kleen <andi@firstfloor.org>
To: cra@WPI.EDU
Cc: wdc@mit.edu, linux-kernel@vger.kernel.org
Subject: Re: vm86.c audit_syscall_exit() call trashes registers
Date: 14 Aug 2007 22:42:02 +0200 [thread overview]
Message-ID: <p73r6m5n90l.fsf@bingen.suse.de> (raw)
In-Reply-To: <20070814183119.GC17694@angus.ind.WPI.EDU>
Chuck Anderson <cra@WPI.EDU> writes:
>
> If I'm reading correctly, it appears that the code above trashes the
> %fs and %gs registers, or otherwise doesn't leave them at zero before
> returning from the system call as the old code did. Is this a correct
> analysis?
The kernel runs with defined fs -- saved and set at system call entry/exit --
and shouldn't touch gs (except on a context switch, but then it should
be set back when you get scheduled again)
It's in theory possible that something went wrong with the gs saving
for the vm86 path, but this changed long 2.6.16. But I assume
when you just remove the call in 2.6.16 it already works? If yes
it cannot be that (2.6.16 didn't use either fs or gs in the kernel)
> How should this be fixed?
The problem first needs to be fully understood. Do you have more
details on the corruption?
One suspicious thing is that the audit code does mutex_lock(&tty_mutex)
and could sleep there. It's a long shot, but does the problem go
away when you comment that out? [such a patch is incorrect in theory,
but should be unlikely enough to crash for a quick test]
But actually sleeping should be ok here and a preemptible kernel could do
it anyways.
-Andi
next prev parent reply other threads:[~2007-08-14 19:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 18:31 vm86.c audit_syscall_exit() call trashes registers Chuck Anderson
2007-08-14 20:42 ` Andi Kleen [this message]
2007-08-14 20:52 ` William Cattey
2007-08-14 21:28 ` Andi Kleen
2007-08-14 21:37 ` William Cattey
[not found] ` <20070814214622.GE23308@one.firstfloor.org>
[not found] ` <6655DD8B-D9C6-495D-9E22-2FDF6B375C9D@MIT.EDU>
[not found] ` <20070814221927.GH23308@one.firstfloor.org>
2007-09-25 23:38 ` William Cattey
2007-09-29 0:58 ` Jeremy Fitzhardinge
2007-09-29 1:13 ` William Cattey
2007-09-29 6:06 ` Jeremy Fitzhardinge
2007-09-29 6:09 ` Jeremy Fitzhardinge
2007-10-01 22:30 ` William Cattey
2007-10-01 23:49 ` Jeremy Fitzhardinge
2007-10-02 16:44 ` Chuck Ebbert
2007-10-04 23:58 ` William Cattey
2007-10-05 0:10 ` Chuck Ebbert
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=p73r6m5n90l.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=cra@WPI.EDU \
--cc=linux-kernel@vger.kernel.org \
--cc=wdc@mit.edu \
/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