From owner-svn-src-all@freebsd.org Fri May 29 05:41:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82D4A32FA7E; Fri, 29 May 2020 05:41:22 +0000 (UTC) (envelope-from jhb@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49YD2V2tc5z44qL; Fri, 29 May 2020 05:41:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E5C512F00; Fri, 29 May 2020 05:41:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04T5fME9086717; Fri, 29 May 2020 05:41:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04T5fMv2086716; Fri, 29 May 2020 05:41:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005290541.04T5fMv2086716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 May 2020 05:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361617 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 361617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2020 05:41:22 -0000 Author: jhb Date: Fri May 29 05:41:21 2020 New Revision: 361617 URL: https://svnweb.freebsd.org/changeset/base/361617 Log: Increment the correct pointer when a crypto buffer spans an mbuf or iovec. When a crypto_cursor_copyback() request spanned multiple mbufs or iovecs, the pointer into the mbuf/iovec was incremented instead of the pointer into the source buffer being copied from. PR: 246737 Reported by: Jenkins, ZFS test suite Sponsored by: Netflix Modified: head/sys/opencrypto/criov.c Modified: head/sys/opencrypto/criov.c ============================================================================== --- head/sys/opencrypto/criov.c Fri May 29 02:32:48 2020 (r361616) +++ head/sys/opencrypto/criov.c Fri May 29 05:41:21 2020 (r361617) @@ -266,7 +266,7 @@ crypto_cursor_copyback(struct crypto_buffer_cursor *cc remain = cc->cc_mbuf->m_len - cc->cc_offset; todo = MIN(remain, size); memcpy(dst, src, todo); - dst += todo; + src += todo; if (todo < remain) { cc->cc_offset += todo; break; @@ -284,7 +284,7 @@ crypto_cursor_copyback(struct crypto_buffer_cursor *cc remain = cc->cc_iov->iov_len - cc->cc_offset; todo = MIN(remain, size); memcpy(dst, src, todo); - dst += todo; + src += todo; if (todo < remain) { cc->cc_offset += todo; break;