]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
i386 copyout_fast: improve detection of a fault on accessing userspace
authorKonstantin Belousov <kib@FreeBSD.org>
Tue, 9 Aug 2022 00:56:54 +0000 (03:56 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Wed, 24 Aug 2022 19:11:40 +0000 (22:11 +0300)
commit95f773e59482b1a3462d2fe3901532d51fb053b3
treee8748a090d137f9182d8221c829a367f36086297
parent0a9b374ecc85d483a52c2bfad548b1bbda496be3
i386 copyout_fast: improve detection of a fault on accessing userspace

Do not blindly account a page fault occuring on the trampoline area,
as the userspace access fault.  Check that it occured exactly in the
instruction that does that.

This avoids unneeded switches of address space on faults not needing the
switch, effectively converting machine resets due to tripple faults,
into regular panics.

Reviewed by: jhb
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36302
sys/i386/i386/copyout_fast.s
sys/i386/i386/exception.s