From tijl@kalimero.kotnet.org  Fri Aug  4 21:48:24 2006
Return-Path: <tijl@kalimero.kotnet.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 329C316A4DA
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Aug 2006 21:48:24 +0000 (UTC)
	(envelope-from tijl@kalimero.kotnet.org)
Received: from outmx017.isp.belgacom.be (outmx017.isp.belgacom.be [195.238.4.116])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 855EB43D46
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Aug 2006 21:48:23 +0000 (GMT)
	(envelope-from tijl@kalimero.kotnet.org)
Received: from outmx017.isp.belgacom.be (localhost [127.0.0.1])
        by outmx017.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k74LmISX000900
        for <FreeBSD-gnats-submit@freebsd.org>; Fri, 4 Aug 2006 23:48:19 +0200
        (envelope-from <tijl@kalimero.kotnet.org>)
Received: from kalimero.kotnet.org (224.54-245-81.adsl-dyn.isp.belgacom.be [81.245.54.224])
        by outmx017.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k74LmFCC000873
        for <FreeBSD-gnats-submit@freebsd.org>; Fri, 4 Aug 2006 23:48:15 +0200
        (envelope-from <tijl@kalimero.kotnet.org>)
Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1])
	by kalimero.kotnet.org (8.13.6/8.13.6) with ESMTP id k74Lm91w022086
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 4 Aug 2006 23:48:09 +0200 (CEST)
	(envelope-from tijl@kalimero.kotnet.org)
Received: (from tijl@localhost)
	by kalimero.kotnet.org (8.13.6/8.13.6/Submit) id k74Lm8BM022085;
	Fri, 4 Aug 2006 23:48:08 +0200 (CEST)
	(envelope-from tijl)
Message-Id: <200608042148.k74Lm8BM022085@kalimero.kotnet.org>
Date: Fri, 4 Aug 2006 23:48:08 +0200 (CEST)
From: Tijl Coosemans <tijl@ulyssis.org>
Reply-To: Tijl Coosemans <tijl@ulyssis.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: page fault clobbers error code in trap frame
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         101379
>Category:       i386
>Synopsis:       [i386] [patch] page fault clobbers error code in trap frame
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 04 21:50:12 GMT 2006
>Closed-Date:    Sun Jun 01 12:22:14 UTC 2008
>Last-Modified:  Sun Jun 01 12:22:14 UTC 2008
>Originator:     Tijl Coosemans
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:
>Description:
In case of a page fault the trap handler stores the faulting address
in trapframe.tf_err to pass it on to sendsig. This is no longer
necessary because the address is now passed on to sendsig in a
ksiginfo_t.
An example of a program that depends on the correct tf_err ending
up in the signal handler's sigcontext is Wine.
>How-To-Repeat:
>Fix:
(this is a patch against HEAD)

--- trap.c.diff begins here ---
--- sys/i386/i386/trap.c.orig	Fri Aug  4 23:20:16 2006
+++ sys/i386/i386/trap.c	Fri Aug  4 23:20:36 2006
@@ -777,9 +777,6 @@
 		return (-1);
 	}
 
-	/* kludge to pass faulting virtual address to sendsig */
-	frame->tf_err = eva;
-
 	return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
 }
 
--- trap.c.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: jhb 
State-Changed-When: Wed Jun 13 22:37:58 UTC 2007 
State-Changed-Why:  
I've committed the change to 7.  Unfortunately it can't be merged back to 6 
as 6.x still uses tf_err in the signal setup code to set sf_addr for example. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101379 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/101379: commit references a PR
Date: Wed, 13 Jun 2007 22:37:55 +0000 (UTC)

 jhb         2007-06-13 22:37:48 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/i386/i386        trap.c 
   Log:
   Don't clobber tf_err with the eva from a page fault as the page fault
   address is saved in ksi_addr already.
   
   PR:             i386/101379
   Submitted by:   Tijl Coosemans : tijl ulyssis org
   
   Revision  Changes    Path
   1.306     +0 -3      src/sys/i386/i386/trap.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: gavin 
State-Changed-When: Sun Jun 1 12:16:40 UTC 2008 
State-Changed-Why:  
This was fixed in src/sys/i386/i386/trap.c 1.306, and fixed in 
RELENG_6 in a different way in rev. 1.277.2.5 before 6.3 was 
released.  Therefore this PR can be closed 


Responsible-Changed-From-To: freebsd-i386->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun Jun 1 12:16:40 UTC 2008 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=101379 
>Unformatted:
