From nobody Thu Dec 09 20:17:39 2021 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 B8D1F18DA07D; Thu, 9 Dec 2021 20:17:39 +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 4J951b3MXdz4r4x; Thu, 9 Dec 2021 20:17:39 +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 538F75498; Thu, 9 Dec 2021 20:17:39 +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 1B9KHdvl053654; Thu, 9 Dec 2021 20:17:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B9KHdwc053653; Thu, 9 Dec 2021 20:17:39 GMT (envelope-from git) Date: Thu, 9 Dec 2021 20:17:39 GMT Message-Id: <202112092017.1B9KHdwc053653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ec498562b71a - main - crypto: Don't assert for empty output buffers. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec498562b71a5e2baee3556eed7e22947f7abc5d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639081059; 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=AS6CssGDk9lH9fsPE2jd/wPNMF+iwfXviPGpLByxHRM=; b=gh9tR2ekte0mrSEn4JOItS8cn6+hIpS9hZ9qekh+d5ZqyloiJg+pzk+GtSIaBA8+XJUETJ 0vYfUW3FJ7Jhgm4z9vdjc90GpR6GObspjGh9nlVMBZEwWQ9ANCKvDlIq1SsqUW25LISBG7 ssc/ozx/v6cUOLRQXjw88EtQK2WsQV3lZO9wdLdxlFnxNZDXWE3c1ZG9CjR4/MXJwEgq0T jVgaVSTPyUrei6U4cQXxUGSJ0bu37bVxlEDnem2CEdmm1VbL9ptCnsSekgh9pGkW7OBLye uOeY3olrvqiKY9Sx41lJr6Tdk0+UlbGrPa95S72MW6am3clUh1KnhkWdHUoxSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639081059; a=rsa-sha256; cv=none; b=a+zOU7tRA9iBCHUW4BMNXZeW4QXIhpA4RR9Z/jBS8gEtE9MnNeJv2LZhOhFglLwJRo2jv2 bTl2SV4wJdu8Vkgw6ZMbv65Fr9Kh09YmmZlX1YO7mYuSWdZBzUKcNYahrlbzf7JILINtD8 bD0Z95qhrDBXXSY16b/iTsPC+hS4vwaKAtuh2Ci/ARv6YeStB+Wf11C3sGwFuOl/+eaPDP 4HkfHWY0Siu1BmVwppNAgx0eaz1Aqyle+3jsVISYKcOiY9NNFh0nsBpj8zitBhXkGLMtHP ngyTWuNyz5+S/7krPUACv9pl8T7GHRif+oWK3WrRpIXRh5q0wav10H3ga7xAYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ec498562b71a5e2baee3556eed7e22947f7abc5d commit ec498562b71a5e2baee3556eed7e22947f7abc5d Author: John Baldwin AuthorDate: 2021-12-09 19:52:41 +0000 Commit: John Baldwin CommitDate: 2021-12-09 19:52:41 +0000 crypto: Don't assert for empty output buffers. It is always valid for crp_payload_output_start to be 0. However, if an output buffer is empty (e.g. a decryption request with a tag but an empty payload), the existing assertion failed since 0 is not less than 0. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33193 --- sys/opencrypto/crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 8c5457a48f65..cc0e5860c882 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1352,7 +1352,8 @@ crp_sanity(struct cryptop *crp) KASSERT(crp->crp_payload_output_start == 0, ("payload output start non-zero without output buffer")); } else { - KASSERT(crp->crp_payload_output_start < olen, + KASSERT(crp->crp_payload_output_start == 0 || + crp->crp_payload_output_start < olen, ("invalid payload output start")); KASSERT(crp->crp_payload_output_start + crp->crp_payload_length <= olen,