Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jul 2006 18:34:11 +0200
From:      Tijl Coosemans <tijl@ulyssis.org>
To:        kmacy@fsmware.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: i386 page fault clobbers error code in trap frame
Message-ID:  <200607301834.16657.tijl@ulyssis.org>
In-Reply-To: <b1fa29170607291257h43592826j75513b465074f115@mail.gmail.com>
References:  <200607292110.37733.tijl@ulyssis.org> <b1fa29170607291257h43592826j75513b465074f115@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart5604069.S5Bz4dlXLo
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Saturday 29 July 2006 21:57, Kip Macy wrote:
> Looking at siginfo it isn't clear that there is a "right way" to
> provide SIGSEGV, eva, and the error code.
>
> _fault._trapno should contain the machine's error code and si_signo
> should contain SIGSEGV, and si_addr contains the faulting pc. Maybe
> one could abuse si_code to contain eva. Sorry for asking a question
> that has already been answered but where is eva being put currently?

si_addr doesn't contain the faulting pc, it contains the address that=20
caused the page fault (i.e. eva). pc at the time of the fault is stored=20
in the sigcontext as sc_eip.

But siginfo is ok. The problem is in sigcontext (mostly a copy of=20
trapframe), where sc_err is incorrect. However, it appears that all the=20
relevant code has changed significantly in CURRENT to the point that=20
the offending line can simply be removed. It would be nice if somebody=20
could review/verify/test this, because I don't have CURRENT installed=20
at the moment.

=2D-- sys/i386/i386/trap.c.orig   Sun Jul 30 18:27:21 2006
+++ sys/i386/i386/trap.c        Sun Jul 30 18:27:56 2006
@@ -777,9 +777,6 @@
                return (-1);
        }

=2D       /* kludge to pass faulting virtual address to sendsig */
=2D       frame->tf_err =3D eva;
=2D
        return((rv =3D=3D KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
 }

--nextPart5604069.S5Bz4dlXLo
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQBEzN+IdMR2xnarec8RAsHKAKDHdOFNszIR4mgbUfzx2kthR3N9eACgrKmR
4deLo0S9sYFtD4DegfegMFA=
=x1wM
-----END PGP SIGNATURE-----

--nextPart5604069.S5Bz4dlXLo--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607301834.16657.tijl>