public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86_64 GPF handler (was: [PATCH] remove errornous semicolon)
@ 2004-11-24  5:23 Chuck Ebbert
  2004-11-24 10:43 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Ebbert @ 2004-11-24  5:23 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Andi Kleen, linux-kernel

Jesper Juhl wrote:

> arch/i386/kernel/traps.c: In function `do_general_protection':
> arch/i386/kernel/traps.c:506: warning: empty body in an if-statement
> 
> upon inspecting the code I see what looks like a mistakenly placed ";"
> 
>         if (!fixup_exception(regs)) {
>                 if (notify_die(DIE_GPF, "general protection fault", regs,
>                                 error_code, 13, SIGSEGV) == NOTIFY_STOP);
>                         return;
>                 die("general protection fault", regs, error_code);
>         }


  Ouch.  No matter what the notifier chain returns it will be treated
as if it returned NOTIFY_STOP, and no kernel-mode GPF will ever reach
the die().

  This bug was introduced 31 Aug 04 by prasanna@in.ibm.com during a
kprobes update.  The comments say it was ported from x86_64, so I had
a look:

        /* kernel gp */
        {
                const struct exception_table_entry *fixup;
                fixup = search_exception_tables(regs->rip);
                if (fixup) {
                        regs->rip = fixup->fixup;
                        return;
                }
                notify_die(DIE_GPF, "general protection fault", regs, error_code,
                           13, SIGSEGV); 
                die("general protection fault", regs, error_code);
        }

x86_64 never checks the result of notify_die() and unconditionally does a die().
I don't know if this is a bug or not...

Andi, if this is not a bug could you explain why not?


--Chuck Ebbert  24-Nov-04  00:23:50

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-24 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-24  5:23 x86_64 GPF handler (was: [PATCH] remove errornous semicolon) Chuck Ebbert
2004-11-24 10:43 ` Andi Kleen
2004-11-24 11:45   ` Prasanna S Panchamukhi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox