From nobody Wed Jun 29 08:51:05 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 8CB3586C0C4; Wed, 29 Jun 2022 08:51:05 +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 4LXwD93c1Gz3HYD; Wed, 29 Jun 2022 08:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656492665; 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=tTScENNlBnX8+X5wseI1eEICqDiBOVU7l4UJAdBK0SY=; b=KH3k1xfBplmFZQq0ufGhLu6zXsZYjmfdxdH7pCtkk/p6UIcnGloPC+feGpy43YWP2Y/1rc kECn8b8H3xdX2HXpvfzz8Ef26QJwmRDU1LvV4CnHNX1hXGY+PLvkD6egR38ueGAriGSsx6 RimFHOzmIiI1zLBymnXB5vV1DUyT/l38wHansoijRl+GPZ04ROBSX8Uq+RyQ4CBh04XdXa /fB8V/SlupTYRTnD9h9iR+a4ysia5ahSMZFK18zITiSsKDuz9XnDmJL1pq/I7XtNCHTWtp 3jmJ1cXMLxIIDUNWF71JvRxh578D/SgCx+xuiJtIsNUfVk47+sH6jkOPc5xFdQ== 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 5BD8568A2; Wed, 29 Jun 2022 08:51:05 +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 25T8p55c055674; Wed, 29 Jun 2022 08:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25T8p5WE055673; Wed, 29 Jun 2022 08:51:05 GMT (envelope-from git) Date: Wed, 29 Jun 2022 08:51:05 GMT Message-Id: <202206290851.25T8p5WE055673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: e6ef5042e485 - main - libsecureboot: Do not propagate empty string 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: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6ef5042e485f74e7233a9974010b16a7316167e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656492665; 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=tTScENNlBnX8+X5wseI1eEICqDiBOVU7l4UJAdBK0SY=; b=mZfIod/o8LwBPbI8VlA5kRtKGuRw38EnDRrg60ylrq8X3GIzqo6ula4/3Q2Z1oIYDDEI90 VyOJYDMgnWcZ/yWRW6jHR7bQw9ihoJom2Pt9gbg99tEy/wXqZ03FpaJRQHZ3H0AbjlmWrb t12e4k1CUUJblPBEeg6YmaA3OJAfYHpPcIJtCwcSLlaqp5Kb6lRrB88/lO28u8F6xmiiJd 0fqI9wrwa6urQobQ1EHZ5Htzd+AQlSlZcdCiFiI+x7w6ARFrwWZMKmGFpbhGKmSwPXDLRE GFlcHC0e59YpunX6BjiNfBUOjcll7uquRrwtzjGspzcrDcAFu9bNGE3aAczZqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656492665; a=rsa-sha256; cv=none; b=wQnsKx2Fnli+Szikw5wRxofcOpiN6pMxR9UpmBRLbrl4ZC9z2vsCutHhxIk4DCZr80TZTj ixf31azjlKiDwPvbS+GD8OnHpuil5kRWrNVXVMWWmux6x9EUNnxbRx3HOpWXtvSxW0YkER mWcvUGtFmOBxhkw08MM73UeMsXr1cTL0ZooBftdxEsf454x64/7+y1yeN0+xfX4qH+dLyl 4oibaWP6H3/df3YCZUg2Rul2DV2zNhucqJkAo0Jb6FC5vyVbnTNEAk/DfJaetdx/N9lXQ8 4wREB2lKwcp6SO8GJlAwSO1Id+b57jTZc4FkIwWgAcZWHMuBLftA8M4Pi9HLpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ef5042e485f74e7233a9974010b16a7316167e commit e6ef5042e485f74e7233a9974010b16a7316167e Author: Wojciech Macek AuthorDate: 2022-06-29 08:50:23 +0000 Commit: Wojciech Macek CommitDate: 2022-06-29 08:50:23 +0000 libsecureboot: Do not propagate empty string If Trust Anchors are provided by UEFI and not compiled into libsecureboot the segmentation fault occurs due to empty or NULL string usage. Obtained from: Semihalf Reviewed by: sjg Differential revision: https://reviews.freebsd.org/D35120 --- lib/libsecureboot/vets.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libsecureboot/vets.c b/lib/libsecureboot/vets.c index a3c1fb34a419..b06ab346f716 100644 --- a/lib/libsecureboot/vets.c +++ b/lib/libsecureboot/vets.c @@ -420,8 +420,9 @@ ve_trust_init(void) #endif #ifdef TRUST_ANCHOR_STR - ve_trust_anchors_add_buf(__DECONST(unsigned char *, TRUST_ANCHOR_STR), - sizeof(TRUST_ANCHOR_STR)); + if (TRUST_ANCHOR_STR != NULL && strlen(TRUST_ANCHOR_STR) != 0ul) + ve_trust_anchors_add_buf(__DECONST(unsigned char *, + TRUST_ANCHOR_STR), sizeof(TRUST_ANCHOR_STR)); #endif once = (int) VEC_LEN(trust_anchors); #ifdef VE_OPENPGP_SUPPORT