From owner-svn-src-head@freebsd.org Tue Sep 8 22:41:36 2020 Return-Path: Delivered-To: svn-src-head@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 A50A93DA5CB; Tue, 8 Sep 2020 22:41:36 +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 4BmKrc3vQJz4Z0X; Tue, 8 Sep 2020 22:41:36 +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 69517178E9; Tue, 8 Sep 2020 22:41:36 +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 088MfaPg037157; Tue, 8 Sep 2020 22:41:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MfZMH037152; Tue, 8 Sep 2020 22:41:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082241.088MfZMH037152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365478 - in head/sys: crypto/armv8 dev/hifn dev/safe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: crypto/armv8 dev/hifn dev/safe X-SVN-Commit-Revision: 365478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 22:41:36 -0000 Author: jhb Date: Tue Sep 8 22:41:35 2020 New Revision: 365478 URL: https://svnweb.freebsd.org/changeset/base/365478 Log: Don't return errors from the cryptodev_process() method. The cryptodev_process() method should either return 0 if it has completed a request, or ERESTART to defer the request until later. If a request encounters an error, the error should be reported via crp_etype before completing the request via crypto_done(). Fix a few more drivers noticed by asomers@ similar to the fix in r365389. This is an old bug, but went unnoticed since crypto requests did not start failing as a normal part of operation until digest verification was introduced which can fail requests with EBADMSG. PR: 247986 Reported by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26361 Modified: head/sys/crypto/armv8/armv8_crypto.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Tue Sep 8 22:23:53 2020 (r365477) +++ head/sys/crypto/armv8/armv8_crypto.c Tue Sep 8 22:41:35 2020 (r365478) @@ -281,7 +281,7 @@ armv8_crypto_process(device_t dev, struct cryptop *crp out: crp->crp_etype = error; crypto_done(crp); - return (error); + return (0); } static uint8_t * Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Sep 8 22:23:53 2020 (r365477) +++ head/sys/dev/hifn/hifn7751.c Tue Sep 8 22:41:35 2020 (r365478) @@ -2517,7 +2517,7 @@ errout: hifnstats.hst_nomem++; crp->crp_etype = err; crypto_done(crp); - return (err); + return (0); } static void Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Tue Sep 8 22:23:53 2020 (r365477) +++ head/sys/dev/safe/safe.c Tue Sep 8 22:41:35 2020 (r365478) @@ -1259,6 +1259,7 @@ errout: if (err != ERESTART) { crp->crp_etype = err; crypto_done(crp); + err = 0; } else { sc->sc_needwakeup |= CRYPTO_SYMQ; }