From owner-svn-src-head@freebsd.org Fri Aug 18 17:11:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CAA6DC8086; Fri, 18 Aug 2017 17:11:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C19F6D256; Fri, 18 Aug 2017 17:11:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7IHBFJ1036109; Fri, 18 Aug 2017 17:11:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7IHBFtO036108; Fri, 18 Aug 2017 17:11:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708181711.v7IHBFtO036108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Aug 2017 17:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322667 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 322667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2017 17:11:16 -0000 Author: kib Date: Fri Aug 18 17:11:15 2017 New Revision: 322667 URL: https://svnweb.freebsd.org/changeset/base/322667 Log: When checking that #UD comes from kernel mode, check that the exception did not happen in vm86 mode. A vm86 userland process could have a %cs that matches GSEL_KPL, while dtrace cannot hook it. Submitted by: Maxime Villard MFC after: 3 days Modified: head/sys/i386/i386/exception.s Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Fri Aug 18 16:43:59 2017 (r322666) +++ head/sys/i386/i386/exception.s Fri Aug 18 17:11:15 2017 (r322667) @@ -187,11 +187,14 @@ IDTVEC(ill) cmpl $0,dtrace_invop_jump_addr je norm_ill - /* Check if this is a user fault. */ - cmpl $GSEL_KPL, 4(%esp) /* Check the code segment. */ - - /* If so, just handle it as a normal trap. */ + /* + * Check if this is a user fault. If so, just handle it as a normal + * trap. + */ + cmpl $GSEL_KPL, 4(%esp) /* Check the code segment */ jne norm_ill + testl $PSL_VM, 8(%esp) /* and vm86 mode. */ + jnz norm_ill /* * This is a kernel instruction fault that might have been caused