From nobody Wed Mar 23 16:55:50 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0CC6A1A32137; Wed, 23 Mar 2022 16:55:51 +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 4KNvck6N9Cz3FGr; Wed, 23 Mar 2022 16:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648054551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8vvOcYFMvyKWem01Lk78bSYUXsf17CFVjV3QO8vN0s=; b=hxveXf5jZSWbt2Vws6TZcPO0KmgxvrFuz3XfK61je7AHi5NKL/wLIsnKms5A66WWrHDywp VU1LXM+zs+F/XdEhzyM7Gh96J7emKxM4VQHD/h2n1rWgH/olP7kPneK1CjTE2/rrzDv9i3 WoU1LN+u+LYcXIDzzFFwJxNLN9BqtNPD1x5WGRT7Mh6t36/0UrVupFDsYUdHZu6cpmaWEw zNdFWRv9k12G/UKaB+ylIJBPb+mrTJS11N04kWFcSHqZXdQCkRN+4kYUYHTRoXlO+7idzZ zEqw5nS897ROdV8tWfPeS/qfrF11RgoolEgmKKhwzemBhnDSnTkeLiLtS4Hilw== 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 BC2952749C; Wed, 23 Mar 2022 16:55:50 +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 22NGtoA1076976; Wed, 23 Mar 2022 16:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22NGto8M076975; Wed, 23 Mar 2022 16:55:50 GMT (envelope-from git) Date: Wed, 23 Mar 2022 16:55:50 GMT Message-Id: <202203231655.22NGto8M076975@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: 1babcad6bc40 - main - elf: Avoid dumping uninitialized bytes in PRSTATUS core dump notes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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: 1babcad6bc4093664a10c7ab98b9ebd2d64bcaaf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648054551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8vvOcYFMvyKWem01Lk78bSYUXsf17CFVjV3QO8vN0s=; b=v/0sGVTWaQVEY6ZPGAgqTps60Jcscm1axWEmqjMjhEfQG4RWjq/ZY7ZoT/Lg0oTdvSCznK FGTiqDsIRoj91EB0Me5D0EmKhPcg29Qhpd2DF75iuaTR818nCj75hCBfxg2wUPZsFu/a/Z jqO5GSfaJOs42OHNEpmejXcxmr3IGETXo2clro/i3WMEV9z5C4AbziaYbMAnPHqcU43xqX zkHfaHhwzXiRE4JnX9z1P0s0T+Un7D9ckdjDx1W2JoklqQm40Rf9FnMygv1YQJu9OREx6r eCQhYm84qi/Xx37KZNdO8SjnToa89w4SjQLsqu8OO6d4UUClFcck6ALJWu/Z1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648054551; a=rsa-sha256; cv=none; b=YWWAMau65eFY0ViWFTL3O1ExKUbddUs9bQ5OXZmIY47ujmBFa693W9tghRODy/9W29c30n JuM2vONViwUuPN/JQ/SeNlQJwbytP2yPK9fb6oRKwVkt1BVkzXBwzvoNx27rZzPEyPiJSW rMRv0FFqov1XonSu6Ev1oe0DcUVStb89z8kukxEhmQQSsxnvfUFyYqYcLCOwCFhdd22Y7u 2xtCx78DoI1j1DzENFA2q2VQ7kWJE/lccX7xGY3oNeOCNcAKeteo72Z9CzSkFymYXwwxOp vagqD3Wkn6LQzsqBpx1TBBb8XZ7cSP7tvTNO37Rbtfsto2BcA3PjW04GIWvIQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1babcad6bc4093664a10c7ab98b9ebd2d64bcaaf commit 1babcad6bc4093664a10c7ab98b9ebd2d64bcaaf Author: Mark Johnston AuthorDate: 2022-03-23 16:52:44 +0000 Commit: Mark Johnston CommitDate: 2022-03-23 16:53:49 +0000 elf: Avoid dumping uninitialized bytes in PRSTATUS core dump notes elf_prstatus_t contains pad space. Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34606 --- sys/kern/imgact_elf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 0f60835ce5e2..91c967c0c8de 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2232,6 +2232,7 @@ __elfN(get_prstatus)(struct regset *rs, struct thread *td, void *buf, KASSERT(*sizep == sizeof(*status), ("%s: invalid size", __func__)); status = buf; + memset(status, 0, *sizep); status->pr_version = PRSTATUS_VERSION; status->pr_statussz = sizeof(elf_prstatus_t); status->pr_gregsetsz = sizeof(elf_gregset_t);