Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp434014rwl; Fri, 4 Nov 2022 02:06:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72uUMaCfwWf705sNCnL0UJzxrhQff9VeKmfXAzSgrkbQW9pWB4luT78pYHkAMFnuDBWPF+ X-Received: by 2002:a05:6a00:993:b0:56c:80f6:db5 with SMTP id u19-20020a056a00099300b0056c80f60db5mr34500633pfg.45.1667552765979; Fri, 04 Nov 2022 02:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667552765; cv=none; d=google.com; s=arc-20160816; b=TxZ96TgS8PuMLmOZQmQKHHBEMJpgJYpeKoA0Tpv9X0avih5e7Cp3mDa14bZuBcIHkh kEt+EqOqMPmo4rDhI4PZLIRIMuO9oBwwBYhCdROa7j065B/rMaF5+P+AYXy/mTUHZYXc 1ywxkPGAqr4LWbWuf35/1oq4BCSFwZW1Xjei1VPnCG0qcSmTG5PzSIhv9pcfMq7eHyls 2Qgq9xERBcNXScndcP6JQF0RC1U+QtIf717doxwNXu4lF+WLv/ygcVJUxZAT3BO+zTfB d+ETFwabh2QFzPbo5in4oYaT+n/dwXKvPanM2VQzy5opclHzJGCNKKzXc+pVE1bzH/Vr Hwww== 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 :references:message-id:subject:cc:to:from:date; bh=wl0lTIw6N9Lmtejg6ZJi1gifi7dbhshB9iCTcSlViOM=; b=qKd7ydzF27kpnL0po8aFMEAQwDxGt0VQN7bHrrdAEK4oKfuQhkDcMjC0blr6/l3OwL gqf+0OAgaCsWNGwgypn6/VfMvpgfaRGwBrk6wn4hRXdrz6RqIUQU/z9HUbMoRDNO52yv bPSCkvZkBDtqYdMqTsdOT3Hpmcw607mYayeOQGC0mwwBNbAEhtAagXkYq59zFkS8Sh5Y b7ZpJud7giBm9yzVuVsSoG0kEW3ZFrUkVHgjjJHG7SMP2k6KJH1ia9mAIAIf9WvF2RDM fCF57ADJsoImnhBCOo28AexxzeXIjiKeFLLjzjDWWUgVKVfuEh5Yaj78ZDYhDu270vMW Kvyg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a63dd05000000b0042aff6e2846si4345803pgg.251.2022.11.04.02.05.50; Fri, 04 Nov 2022 02:06:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbiKDJDf (ORCPT + 99 others); Fri, 4 Nov 2022 05:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiKDJDe (ORCPT ); Fri, 4 Nov 2022 05:03:34 -0400 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69EFF1AD85; Fri, 4 Nov 2022 02:03:33 -0700 (PDT) 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 1oqsb9-00A1aS-Jq; Fri, 04 Nov 2022 17:03:25 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 04 Nov 2022 17:03:24 +0800 Date: Fri, 4 Nov 2022 17:03:24 +0800 From: Herbert Xu To: Kees Cook Cc: Horia =?utf-8?Q?Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , "David S. Miller" , linux-crypto@vger.kernel.org, kernel test robot , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] crypto/caam: Avoid GCC constprop bug warning Message-ID: References: <20221028210527.never.934-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221028210527.never.934-kees@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 On Fri, Oct 28, 2022 at 02:05:31PM -0700, Kees Cook wrote: > > @@ -163,7 +163,7 @@ static inline void append_data(u32 * const desc, const void *data, int len) > { > u32 *offset = desc_end(desc); > > - if (len) /* avoid sparse warning: memcpy with byte count of 0 */ > + if (data && len) /* avoid sparse warning: memcpy with byte count of 0 */ > memcpy(offset, data, len); How about just killing the if clause altogether? I don't see any sparse warnings without it. What am I missing? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt