From nobody Fri Apr 29 20:55:04 2022 X-Original-To: dev-commits-src-branches@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 3A89C1994592; Fri, 29 Apr 2022 20:55: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 4Kql9h5hfPz3FH9; Fri, 29 Apr 2022 20:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651265704; 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=VTQFp4HszD0ygwUbzG8m9MC02FOYMrL0M8wrgCB3ZxU=; b=xA4zLqJZx9Hxow+guqToy/c2hFPc3DS9aqW7UcssYX+u0vgOR0CCHHBkcT6nrwyhfy+GqM dM/BPWgm+iSfjuRtHHKTACVF4sx90HGq8476q9mUzfTRbGt/Xl/chvygFkJsk5IOBuaLzp TcupWWBxD73wKuyJ7yC2T2AiNaUyDyCwEQitiYMjlXFRdcVJhT32R5EpSE1pkpgAScJnTL 3VUpgrjp4kU8Ub7NJTzd/EcvC/z0jjpuJDJTs9+8Hzjt9aXVn4He7BR/6nXttG3s2+/rOC kLKXO7z57iA7q9qz18Mlv+b0n/xmClj36yGNZPScqXRDUOLtPhn876CMA9Eo+w== 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 7B50914121; Fri, 29 Apr 2022 20:55:04 +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 23TKt4vL055164; Fri, 29 Apr 2022 20:55:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23TKt4s5055163; Fri, 29 Apr 2022 20:55:04 GMT (envelope-from git) Date: Fri, 29 Apr 2022 20:55:04 GMT Message-Id: <202204292055.23TKt4s5055163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: af2c2a9cb59d - stable/13 - crypto: Don't assert for empty output buffers. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: af2c2a9cb59dbaf9cd9f227d4a518a5fb05208c3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651265704; 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=VTQFp4HszD0ygwUbzG8m9MC02FOYMrL0M8wrgCB3ZxU=; b=INGsO1Him1H8tFzb4nOW3MpMMB8Gsm3wY1peqrqoTs2pxNxnvVIEE3GYZBGgcZBj9/zpc4 IrC86GLUqG89xIBr+ukv0E7RftPWcmLS6EIIWmnwNk1o1kcGyeLpgWDmOIszZ1hhO9VudF oHf71GiinYgvNZ/Z0vJs5msmi8EVuoOmJFn/tp++8FC6RoZ7LS/dMe1sEY5X99ZYkQBiBg pBkoxUoz4JE87SN0b7WeLOsRS87walDgR+DAAbZxkG8bLLyYSJPQ2mtDGgh53e/D8pBtAt Yag7BfupkeI7i+gKjepC4vLi98pgtAinF5ozpUS8JoBohZVMGSSTHL/K2y0uWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651265704; a=rsa-sha256; cv=none; b=NtzBSf6ODhxBRlgbXd31UTLWtTGPL7hK+nmkhnsnDsTHF5+WBYCZKkqxos5e4y/sBkKgfE 0bPcmU4hQ/DFm5Qxe4nl5Yjmhp++wHaMQDBtYstUuBdS8HI66D2iSMM7F3IFWu6kTNRZer zQVOhxKWw4OrhQWAf7noaJ/9XXwP+tnnnl7TjDrcVDgjHVOyiZCnCOm0hZ6T26taW56uFc FwL8fzu6d9X/Tows9hPRQv8kyeeLW+9OmXiBwwum/G3WppiPTID3WaFTIHq4AKuFY+byUD qY9dM5+0ioyvGtjlFipoFdzFlcbRKzdqmUFT5qd4/xpw1jr+4Y0wZXwehSxDUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=af2c2a9cb59dbaf9cd9f227d4a518a5fb05208c3 commit af2c2a9cb59dbaf9cd9f227d4a518a5fb05208c3 Author: John Baldwin AuthorDate: 2021-12-09 19:52:41 +0000 Commit: John Baldwin CommitDate: 2022-04-29 20:50:04 +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 (cherry picked from commit ec498562b71a5e2baee3556eed7e22947f7abc5d) --- 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 5332ab5f07ce..69dd75ab1d0c 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1424,7 +1424,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,