From nobody Tue Nov 23 23:13:12 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 BA74318A2529; Tue, 23 Nov 2021 23:13:16 +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 4HzKgZ1Xx7z3vtC; Tue, 23 Nov 2021 23:13:14 +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 937D01F728; Tue, 23 Nov 2021 23:13:12 +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 1ANNDC81038089; Tue, 23 Nov 2021 23:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNDCDV038088; Tue, 23 Nov 2021 23:13:12 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:13:12 GMT Message-Id: <202111232313.1ANNDCDV038088@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: b2d704ea8820 - stable/13 - ktls: Use ATF_REQUIRE instead of assert() for validating TLS header lengths. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b2d704ea882031204c41ecf472200e9bf5c629eb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709195; 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=VibIGNa9gxF/LZelh6rOgRKpSN5edx0BWPSCzhP5OUQ=; b=yKQEF1xo7Ez8zZjxVrc2Dc0ZnIaeoSFdoXCLRnnnX9yONB+LFJV1zds01m2pBux3MrDF9K 8X1/t1A/VmWzQZW+DzK6yAUdWeDpq2g91Pi+bJ538c6QtUJHQb7Oempaz0jalpTkCNeuju O4ubWFO5/NdIQ9I+ViUAurvZ5SBlMZjitcsRVX+1c0IUTXVz/E+2MMthOkobZKB5lwSMBH LpTXtFJHMn8wnyCpgcG86QpC1UnI/S4iSkfZej/zzyZq0n6lYqvfXsPVOLNGpWF33I9Jjb ZTWjSjA6bev3jgtGkNQNOv/o2lXVsuqF2vMJj+B4zT9L1nedikOJ0582xpsW/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709195; a=rsa-sha256; cv=none; b=FMSNV3DEqg1ptcKKLNHA39Hv9MbuqlrGGHktP8I9cJ/ndotT8bnN0/78scBAmIbTVeRjD0 vDyz5EITIbkU3GD9wxlUguAxZIDOY8mTurnrexpgm04AP9AZt+xVVOWGE6ZkRwUwaBlvT7 fz2PfKWpfHdQky/hMYem4X6kulODWd6eSacLkc3/GYEx+pD3xUEMS5QdQGVuIc3EbbmkX2 p30WI+IMitCm2xT5Hbvzsh5+rG7B2g3RgUjNX2iYZ2R+nNLND4UD+R2MmSYjJ9k0S4FxA9 4cugJrVhBD4exhe2nsETI/8y0Rzg98zN1JEFOVJwSfl4FuQ4m+lmHC0DSUt4Qw== 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=b2d704ea882031204c41ecf472200e9bf5c629eb commit b2d704ea882031204c41ecf472200e9bf5c629eb Author: John Baldwin AuthorDate: 2021-11-16 17:56:15 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:54 +0000 ktls: Use ATF_REQUIRE instead of assert() for validating TLS header lengths. The TLS header length field is set by the kernel, so if it is incorrect that is an indication of a kernel bug, not an internal error in the tests. Prompted by: markj (comment in an earlier review) Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33003 (cherry picked from commit d71830cdf0df6dbc4bd3332daa95d9ecd7d64060) --- tests/sys/kern/ktls_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 21e3213a8634..64e26bb27f37 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -913,8 +913,8 @@ test_ktls_transmit_app_data(struct tls_enable *en, uint64_t seqno, size_t len) record_len = sizeof(struct tls_record_layer) + ntohs(hdr->tls_length); - assert(record_len <= outbuf_cap); - assert(record_len > outbuf_len); + ATF_REQUIRE(record_len <= outbuf_cap); + ATF_REQUIRE(record_len > outbuf_len); rv = read(ev.ident, outbuf + outbuf_len, record_len - outbuf_len); if (rv == -1 && errno == EAGAIN) @@ -1013,7 +1013,7 @@ test_ktls_transmit_control(struct tls_enable *en, uint64_t seqno, uint8_t type, ATF_REQUIRE(rv == sizeof(struct tls_record_layer)); payload_len = ntohs(hdr->tls_length); record_len = payload_len + sizeof(struct tls_record_layer); - assert(record_len <= outbuf_cap); + ATF_REQUIRE(record_len <= outbuf_cap); rv = read(sockets[0], outbuf + sizeof(struct tls_record_layer), payload_len); ATF_REQUIRE(rv == (ssize_t)payload_len);