Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp324082rwe; Thu, 25 Aug 2022 00:29:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5pIe6BIBgr2fKMTI1qTsL6PexzYRBe2PEwcDrV3wDdh6UApBn/TUybtkEzMSuLZjoLADeO X-Received: by 2002:a17:907:7284:b0:731:82a3:16e3 with SMTP id dt4-20020a170907728400b0073182a316e3mr1591092ejc.30.1661412551451; Thu, 25 Aug 2022 00:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661412551; cv=none; d=google.com; s=arc-20160816; b=jDzLgQn0cqQRfIyC5M0T1AvZtGVyLHymgK/8cy2LYeYPYr3XlHyjbiCnU2vvEaR+dG d9CI3d2qolLkC5ylVDbNIJmJIZytfLGC8roIAnRaBQRpG+7n4hL2IkI4uPWhLapowejL oGzs6NbemYt1nc9L4s/6W3cFvyDNakYoNZ5fW6lwkiVUVM6NRG5b88Beh0LHUmxRc2ow gG/cszTDl7D+75YEdW0suaJDx7YHcwTny8w/VDms2kvb8ysq3RPaU49GjTNcjmvoeL4o GUZCxM9HTI3lweQZ6UFf3Bd6gEOJn5Xc+psvAC5Wz9Mfap0meCq+eBisneqwiKdaEnZJ tdrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=SnII6Fo2+WTgXrCpEYWOd5rqFgnklJor6N4Ows/yZgk=; b=Hu4bp4pE0YGcpWKDUFmap2iiynHcTYtAYvvgNYbbxZp0Eu4ZkJwYmRGaiNmNRE3ied uqJZP0dZf/dBXEE3Rfuolx1RyKmbzZlj1mZSltzjwC/puVBGtn2QGlONRS48Qe+WatTy YPVmeGHNLZs+kSHtUAvN1y2SSQHcxLVTueJrvjbMHykAenVOz8O3x97vtxufvOecqcAK az93tkmQUV5Md1J7wBzP3HTVkRdnTrgkpMLDW5KXIIMI8wwN24CyQQGOo5Ctadb5Oonm 8tWaQO7tgayZQm1tlehxqlGAbZtubiWmcl40OBlM+lHDSvjKtR/l+C7YreMbQXYrQ1lE wP1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=U9MBgRLV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a056402500e00b00447afd333eesi800462eda.308.2022.08.25.00.28.46; Thu, 25 Aug 2022 00:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=U9MBgRLV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236640AbiHYHYZ (ORCPT + 99 others); Thu, 25 Aug 2022 03:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235550AbiHYHYY (ORCPT ); Thu, 25 Aug 2022 03:24:24 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850CE98D24 for ; Thu, 25 Aug 2022 00:24:23 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id u9so8824885ejy.5 for ; Thu, 25 Aug 2022 00:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=SnII6Fo2+WTgXrCpEYWOd5rqFgnklJor6N4Ows/yZgk=; b=U9MBgRLVFKT2BuVXmI7cAiVOqF5V4v2Rgazy2mJykJGQTPOtjdPQlnMc2WqZRkoOk9 vwS0rOjCh3If33dE5wmDRFFaMa9jakBa/P9Pmh7rwq9Iq9Um8vklHaqJoNj3BFH4WTl5 wqZhmDEFGJKL7fFE9Um6dOqUxFJAdOnzV6sjrG9b5TeIKJYg7KGxebAeCjgPELwpVZpO 7iKETCn5AS0JXPAmbzO9btppZO0jAe1unnjIpXfXhRQecW1R5b0sKCwsfzXW+nBoqS2l Jo/rfkwiDQK6oYqwppLAW1wCXH2DF3aWyo0pvxTlMiJ11KTTqnpk0dLEr0Iq9eAaxucL LAFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=SnII6Fo2+WTgXrCpEYWOd5rqFgnklJor6N4Ows/yZgk=; b=SiP5gQFCeC9XsluqJMOJg9SugX4Lt/exNt26yE3agIngHfheYZp0//HPW0bny6rF9B MXJ3nscKgBlexlKHr0UH2SYt0/rRF9a1z1x6Fb81Q9MHuItG0kIKRg8U07cKT0JgHIBE FCcczW2zE85j6IVwFRAhoCZBvlCDlvBOJW8Y43DOwdKLc34c66HDeDDeyqGspnzcZLEX r2lzF+xOf8gD+mSA2AfDPuu8w907YSIDhOCWT+93JPslj9qTpHdUHgUKxB4yMF+6VEIM G6cnzIZStdr6niGOsAILOcpHA4RARB6uhBaUZeQV/SQJXR1wwuVI4CCgB1GahsXoC2mi ITRw== X-Gm-Message-State: ACgBeo2cIpmjtu7JAranY0yAtUqmS1GEfPrgVJ072Bi7fO8kDRz/9IfI T00eOkfs/s+R/9q+EEfIrlfDXBBDgbVRfg== X-Received: by 2002:a17:907:3f0c:b0:73d:60fc:6594 with SMTP id hq12-20020a1709073f0c00b0073d60fc6594mr1624484ejc.669.1661412262090; Thu, 25 Aug 2022 00:24:22 -0700 (PDT) Received: from lb02065.fritz.box ([2001:9e8:142d:a900:eab:b5b1:a064:1d0d]) by smtp.gmail.com with ESMTPSA id ky12-20020a170907778c00b0073ce4abf093sm2032281ejc.214.2022.08.25.00.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 00:24:21 -0700 (PDT) From: Jack Wang To: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org Subject: [PATCH 0/6] Crypto: Fix dma_map_sg error check Date: Thu, 25 Aug 2022 09:24:15 +0200 Message-Id: <20220825072421.29020-1-jinpu.wang@ionos.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi, all, While working on a bugfix on RTRS[1], I noticed there are quite a few other drivers have the same problem, due to the fact dma_map_sg return 0 on error, not like most of the cases, return negative value for error. I "grep -A 5 dma_map_sg' in kernel tree, and audit/fix the one I feel is buggy, hence this patchset. As suggested by Christoph Hellwig, I now send the patches per subsystem, this is for crypto subsystem. Thanks! [1] https://lore.kernel.org/linux-rdma/20220818105355.110344-1-haris.iqbal@ionos.com/T/#t Jack Wang (6): crypto: gemin: Fix error check for dma_map_sg crypto: sahara: Fix error check for dma_map_sg crypto: qce: Fix dma_map_sg error check crypto: amlogic: Fix dma_map_sg error check crypto: allwinner: Fix dma_map_sg error check crypto: ccree: Fix dma_map_sg error check drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 6 +++--- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 2 +- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 4 ++-- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +- drivers/crypto/amlogic/amlogic-gxl-cipher.c | 6 +++--- drivers/crypto/ccree/cc_buffer_mgr.c | 2 +- drivers/crypto/gemini/sl3516-ce-cipher.c | 6 +++--- drivers/crypto/qce/aead.c | 4 ++-- drivers/crypto/qce/sha.c | 8 +++++--- drivers/crypto/qce/skcipher.c | 8 ++++---- drivers/crypto/sahara.c | 4 ++-- 11 files changed, 27 insertions(+), 25 deletions(-) -- 2.34.1