Received: by 2002:ab3:689a:0:b0:1da:d01c:d2b2 with SMTP id t26csp10618ltj; Fri, 19 Aug 2022 16:10:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR7pBAeijuOMc1zg52PBX1cMacVGWavvNpZxQU4UYB1mUsHNI1Jpp0LQxZ9FBtK+HEhIkPwu X-Received: by 2002:a05:6402:194e:b0:442:c81c:ca25 with SMTP id f14-20020a056402194e00b00442c81cca25mr7872128edz.137.1660950623915; Fri, 19 Aug 2022 16:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660950623; cv=none; d=google.com; s=arc-20160816; b=QVlDb3rDJDKoDa/3YWT0AbQDyXQjvXFuCvVrujNI/TpWxO6PRyK2kORPw31j8qUi5+ 1qxRh5ks9N5DSFqHC4NfJ1T+4Cwe00t+1U5tjP438cm84CD4WHx2wYr7eEn0KvGkoB+r FMiWvnE4JnPST0ng58FRosAUbT1tOJ2P9c2XzSBdjzat006bGPmiNKRmy65tyvbmIR3b Tw9/L51JaBBdzJ0WF0RRTTTQaf090YBfH+1m/8vqfx2uoA01mo5j4fJAW+Q3KGEmhj52 eVZucfjWytU45JW3089CETHsu4IZC66P5vJ3Mqe5625WIG5j/uKBE5gxWyPTxxacJOQz BkoQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QUVq2AEfy4BLzc5ShfAzmaXa1lQpxGbdDm4GA683rSc=; b=YbynHLMaYN/fWKdB2K0+seRSP8oW/miE47nRLd1YT/ADPdEdG5vbUm+/bYoFz+Vhr2 iVVl/ZSyJeZcdL1ONmiT/FnRrgdhNvhLNw9x6SGUuQTJc++QUUx5en89+FQTFFy1o6bD +LyZY6zgxIzZehrijDOwrTqS+ABgtmR7OSEgltvDW4lzSwrvCy41s9BXk43dJoqEX5Mg 922b3oFaL5QHBbdv9LRNpRlIxIwLG8t8GmDPQ5qcEsge3a+vIz59IuQBqsjoFI6BuBPf Ee+cHrctnkTdzKA1X65+tnq+G1BA+T5h1pRWYjiTYSHj9uG8n/b6vwOPj2ULjVn6ss9D IMug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ENdToelV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf3-20020a1709077f0300b00730d37d3f0asi3935160ejc.766.2022.08.19.16.09.58; Fri, 19 Aug 2022 16:10:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@chromium.org header.s=google header.b=ENdToelV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240454AbiHSWTS (ORCPT + 99 others); Fri, 19 Aug 2022 18:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbiHSWTH (ORCPT ); Fri, 19 Aug 2022 18:19:07 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F6B0D87C9 for ; Fri, 19 Aug 2022 15:19:03 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id r22so4707894pgm.5 for ; Fri, 19 Aug 2022 15:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc; bh=QUVq2AEfy4BLzc5ShfAzmaXa1lQpxGbdDm4GA683rSc=; b=ENdToelV8P3tTBi2wyMgiiiSSMF5hoMniphFi0mNyhiWmSB7WnKAAGDm0y249ftZx0 euJ59gUES9Sl1uGVN9rZFlMBBym+At5jN4QekFPo64wXRHssx1NA7mtKm5Zza9ebg/Mk 8RvsoBVQmiYFDka9tvNFAMmHimhVJcbfvX97A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=QUVq2AEfy4BLzc5ShfAzmaXa1lQpxGbdDm4GA683rSc=; b=7e7gIWv08l8IVFN6jicupedj2zjjGmQ9yE3DyxAxLe3trKqzYqBNGGHqswyA3W7N8R bEbLuWZM1Xg80rx+afjBzg+2ngm4FXBrPSQkQ9JiDq6eaHg2ogrsMYYZ4tghRPJUwwtm jqJBR2huWU8qp0rYg72KPFgCqkIiiiwS4Zf9vdHA6g26CMprcVsr4eV4ThOAsL87CI8m WrZ5fpCOa7Wp6buWvLy1qdO3Np8+AiIo+I8MPqkrrlJkpFHETJ0FczwCsUraPWuWy+6D l12SZlO+mIhb+7VveS7zKmHy170yOJGJMCft5p5Tj4CCBwJAPnQmooVfLNgZXE7apv4I yqTA== X-Gm-Message-State: ACgBeo1Ms/e0cSxfEBqNBjEgs6CrZtspTDiyZml1uW12Cp70pBaoW+Qk oDBF4vahVMCBclEo2tMiXaQMXg== X-Received: by 2002:a05:6a00:10d3:b0:4fe:5d:75c8 with SMTP id d19-20020a056a0010d300b004fe005d75c8mr10058352pfu.6.1660947542596; Fri, 19 Aug 2022 15:19:02 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l9-20020a170902f68900b0016be96e07d1sm3570628plg.121.2022.08.19.15.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 15:19:02 -0700 (PDT) Date: Fri, 19 Aug 2022 15:19:01 -0700 From: Kees Cook To: Jack Wang Cc: linux-kernel@vger.kernel.org, Jason Gunthorpe , Leon Romanovsky , Christophe JAILLET , =?iso-8859-1?Q?H=E5kon?= Bugge , linux-rdma@vger.kernel.org Subject: Re: [PATCH v1 02/19] infiniband/mthca: Fix dma_map_sg error check Message-ID: <202208191518.A550DF53BC@keescook> References: <20220819060801.10443-1-jinpu.wang@ionos.com> <20220819060801.10443-3-jinpu.wang@ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220819060801.10443-3-jinpu.wang@ionos.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Fri, Aug 19, 2022 at 08:07:44AM +0200, Jack Wang wrote: > dma_map_sg return 0 on error, in case of error set > EIO as return code. > > Cc: Jason Gunthorpe > Cc: Leon Romanovsky > Cc: Christophe JAILLET > Cc: Kees Cook > Cc: "H?kon Bugge" > Cc: linux-rdma@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Jack Wang Reviewed-by: Kees Cook -- Kees Cook