From: William Cattey <wdc@MIT.EDU>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andi Kleen <andi@firstfloor.org>, Chuck Anderson <cra@WPI.EDU>,
linux-kernel@vger.kernel.org
Subject: Re: vm86.c audit_syscall_exit() call trashes registers
Date: Mon, 1 Oct 2007 18:30:59 -0400 [thread overview]
Message-ID: <7CF81651-4B94-42AA-9FEF-790F4D08EE4F@MIT.EDU> (raw)
In-Reply-To: <46FDEC1F.7080809@goop.org>
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
Thanks very much for responding.
From your two replies, I crafted the attached patch.
Alas, the EDID transfer comes up all zeros.
I see two possible causes of this behavior:
1. I misunderstood how you intended the file to be modified.
2. The fix for my bug is NOT in correcting the audit call, but
instead from some other fix, perhaps from the other aspect that you
worked on.
I know that when I surrounded the audit_syscall_exit with #if 0 I got
correct EDID fetches, so the most likely cause is #1, that I didn't
correctly incorporate your understanding of correct operation of the
call to audit_syscall_exit.
Here's my patch. Where did I screw up?
[-- Attachment #2: linux-2.6-correct-vm86-audit-foonly.patch --]
[-- Type: application/octet-stream, Size: 771 bytes --]
--- linux-2.6.18.i686/arch/i386/kernel/vm86.c.foonly 2007-10-01 16:40:35.000000000 -0400
+++ linux-2.6.18.i686/arch/i386/kernel/vm86.c 2007-10-01 16:27:50.000000000 -0400
@@ -318,12 +318,11 @@
tsk->thread.screen_bitmap = info->screen_bitmap;
if (info->flags & VM86_SCREEN_BITMAP)
mark_screen_rdonly(tsk->mm);
- __asm__ __volatile__("xorl %eax,%eax; movl %eax,%fs; movl %eax,%gs\n\t");
- __asm__ __volatile__("movl %%eax, %0\n" :"=r"(eax));
+ __asm__ __volatile__("mov %0, %%fs; mov %0, %%gs" : : "r" (0));
/*call audit_syscall_exit since we do not exit via the normal paths */
if (unlikely(current->audit_context))
- audit_syscall_exit(AUDITSC_RESULT(eax), eax);
+ audit_syscall_exit(AUDITSC_RESULT(0), 0);
__asm__ __volatile__(
"movl %0,%%esp\n\t"
[-- Attachment #3: Type: text/plain, Size: 778 bytes --]
-Bill
----
William Cattey
Linux Platform Coordinator
MIT Information Services & Technology
N42-040M, 617-253-0140, wdc@mit.edu
http://web.mit.edu/wdc/www/
On Sep 29, 2007, at 2:09 AM, Jeremy Fitzhardinge wrote:
> Jeremy Fitzhardinge wrote:
>> @@ -306,19 +334,18 @@ static void do_sys_vm86(struct kernel_vm
>> tsk->thread.screen_bitmap = info->screen_bitmap;
>> if (info->flags & VM86_SCREEN_BITMAP)
>> mark_screen_rdonly(tsk->mm);
>> __asm__ __volatile__("xorl %eax,%eax; movl %eax,%fs; movl %
>> eax,%gs\n\t");
>>
>
> Oh, this line is also clearly bogus, since it clobbers %eax without
> telling the compiler. The minimal change would be something like:
>
> asm volatile("mov %0, %%fs; mov %0, %%gs" : : "r" (0));
>
>
> J
next prev parent reply other threads:[~2007-10-01 22:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 18:31 Chuck Anderson
2007-08-14 20:42 ` Andi Kleen
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 [this message]
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=7CF81651-4B94-42AA-9FEF-790F4D08EE4F@MIT.EDU \
--to=wdc@mit.edu \
--cc=andi@firstfloor.org \
--cc=cra@WPI.EDU \
--cc=jeremy@goop.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
all inboxes | Powered by JetHome®