From owner-dev-commits-src-all@freebsd.org Sat Jul 10 00:48:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9E466496D4; Sat, 10 Jul 2021 00:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GMBGJ4BBGz4XhH; Sat, 10 Jul 2021 00:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 740671E65B; Sat, 10 Jul 2021 00:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16A0m8OZ072308; Sat, 10 Jul 2021 00:48:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16A0m8L8072307; Sat, 10 Jul 2021 00:48:08 GMT (envelope-from git) Date: Sat, 10 Jul 2021 00:48:08 GMT Message-Id: <202107100048.16A0m8L8072307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f08f0ae5247a - main - amd64: Mark the trapframe as initialized in trap() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f08f0ae5247ab31de58bda0817e74ccc1a3a5e95 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2021 00:48:08 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f08f0ae5247ab31de58bda0817e74ccc1a3a5e95 commit f08f0ae5247ab31de58bda0817e74ccc1a3a5e95 Author: Mark Johnston AuthorDate: 2021-07-10 00:38:03 +0000 Commit: Mark Johnston CommitDate: 2021-07-10 00:38:50 +0000 amd64: Mark the trapframe as initialized in trap() Otherwise KASAN may generate false positives if the trapframe was written into a poisoned region of the stack. Reported by: pho Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/trap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index e67e188bb4fd..a60b17cf554f 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include +#include #include #include #include @@ -227,6 +228,8 @@ trap(struct trapframe *frame) p = td->td_proc; dr6 = 0; + kasan_mark(frame, sizeof(*frame), sizeof(*frame), 0); + VM_CNT_INC(v_trap); type = frame->tf_trapno;