Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2107956rdb; Thu, 7 Dec 2023 20:09:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhFhFZvDxh4+lrycWUlDEHZJDH8EhZ6Fc8tZYTrjKdUOBeCKiF7ZdjHYIbBmR+43eGWu9W X-Received: by 2002:a17:902:ecc8:b0:1d0:7908:ab64 with SMTP id a8-20020a170902ecc800b001d07908ab64mr378707plh.10.1702008591119; Thu, 07 Dec 2023 20:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702008591; cv=none; d=google.com; s=arc-20160816; b=P8wfEP7Qxe3SfJ+u8JxxSoe44DJJje2OHCmyVikZT3+kennV7b6VQsQvcuPjBa1k5B 84kSR94kj57keQ03btrs8jfJj+asL5kv6rqZRHFG34O91/6IwbSjavBAix0QUtuCNVl4 jQkwByQf3g6kVqqsCZIyTMd5o4jd0Wy6tQftkCIhROiXIZ9wwTM/i7Yam/z7ug1cFSR9 H1eP3GAQMxfbaSGw0MjA3aqbFMNJjUTvqisDUGlHe0XyRuDJVwCFWo7FQbvOQLZtg9Ah uj+rTSyITgW1d6+92HeTSDacklxcSKZvZipNiwTpvibn+7HRtA84n1RCQEbo4ICbUhXI Y0NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=AXYc2+FHSt3utyYd9jmqni0helseKyoDjZ9oLeRx+88=; fh=ZiBRcxKR2wq5hqq4cyuE4LkXD8vfgLgMOc2IJTx73gk=; b=fugoX2wG4kSI8hBxJeSWwIFYMXSIzMKOdK+ka8Xt5VzY6U/jZA+lvPAEwpm4X7rcJq T7WuEfdnqjDiHEiT3YjUoIvMmLtod3njLhYvWpJKW8lp0vYd8chako13d4RSwHUnz68d bJSciwvdutItHJZoCupMtOrRc3tsV1plhCF0Z8bv/5/XhU+cTttxTqn/4Q71k9vMya+Y HU/4y7k/eyPishgPQs/CRzqz7wLSGvrHqa3CpbjDRcmJXjPHzN264y/XZ6XlUNEgEGTm 4k+DRCedPevIy9+RkeZkPA1v6gtc1A1dywHk6GgNsOaEnfG4WwIK+V44cFdKvKZgxZtu ttQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d1-20020a170902aa8100b001d0afa2f5ddsi833645plr.621.2023.12.07.20.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 20:09:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 70D2C81DE6A1; Thu, 7 Dec 2023 20:09:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573124AbjLHEJd (ORCPT + 99 others); Thu, 7 Dec 2023 23:09:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjLHEJc (ORCPT ); Thu, 7 Dec 2023 23:09:32 -0500 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C86C1712; Thu, 7 Dec 2023 20:09:38 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1rBSB2-008IlK-4b; Fri, 08 Dec 2023 12:09:25 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 08 Dec 2023 12:09:34 +0800 Date: Fri, 8 Dec 2023 12:09:34 +0800 From: Herbert Xu To: Nikita Zhandarovich Cc: atenart@kernel.org, n.zhandarovich@fintech.ru, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] crypto: safexcel - Add error handling for dma_map_sg() calls Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231201124929.12448-1-n.zhandarovich@fintech.ru> X-Newsgroups: apana.lists.os.linux.cryptoapi,apana.lists.os.linux.kernel X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 20:09:48 -0800 (PST) Nikita Zhandarovich wrote: > Macro dma_map_sg() may return 0 on error. This patch enables > checks in case of the macro failure and ensures unmapping of > previously mapped buffers with dma_unmap_sg(). > > Found by Linux Verification Center (linuxtesting.org) with static > analysis tool SVACE. > > Fixes: 49186a7d9e46 ("crypto: inside_secure - Avoid dma map if size is zero") > Signed-off-by: Nikita Zhandarovich > --- > v2: remove extra level of parentheses and > change return error code from -ENOMEM to EIO > per Antoine Tenart's suggestion > > drivers/crypto/inside-secure/safexcel_cipher.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt