Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp446222rwb; Thu, 1 Dec 2022 04:22:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf54BRNKrvGaRa4MftNNC6oBJOT9dvdKDUKUdw2mkst8Ycp/xFpN5pKezhP5bcKmvf8m+k2/ X-Received: by 2002:a17:902:ec01:b0:186:a27d:8e81 with SMTP id l1-20020a170902ec0100b00186a27d8e81mr60198374pld.133.1669897354584; Thu, 01 Dec 2022 04:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669897354; cv=none; d=google.com; s=arc-20160816; b=PJ9FMpI/UyjHwGEkNH2v8OfOUndOVRsGIh5yc8Fp1zW4F5LhA4YRZaYDHoQjbRTX9g 0XQNo2F3POz4DWQka3vp6IKnjZmzhUOGaVJlArE1s+W5uHYYsBlj61ksTz7V8sewomMr Zto1gLmWXsJ1+5iQfdtqgSl8MJ1rWNofIhG7TCFT2/80/kj1Czi/qIwdDcUN0WomwOo2 czhRj3Ro9byhxrJRhoDVlj3IWGWJC/n6SHFHaYHe23mvJSgjhF0cejTxEmdSagVHvQ+q LbrhyfkT46W0ifXp/X6xU0RnkH/CjYAX6AwxttzZso65/++WEH6O2SXCwwlOAzL8Toxd sTNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hYw83hza5KUMmqWdnnIZoi5MZPfbnrDq+x3Y/unYtZg=; b=1DvtfGwKji1Rdnfp1fIjUDwYUqiCqBMoNqfXPXbapDRJC13QD1H/PvV7I4AqHkpfrQ 9GawvNsLu4WepPnMccTB/iRjah0oEsjrleQsPefZt01uuOFRrYzPsx8wmi75pRPm/WtR lziRv7nCQRVdXjlp61P+VaJ21FRpzlPCDpMZhBYd513GKg9TKAT+g5++BcIFfPHUTd3K W39/YZC38dAAMw6DevO5/FFDAWMwZGhtuWZjLKHRTKpDDCwamnpKX1WJxaMAW86mR22e 0ehpHcHU8b/fIgvk9c9Ml+Nr9RwSIsoHCjpIWObfitDK4jFzXPdkIGeUT4HLnJO5oeJ3 lNqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vD2UqwkT; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63040a000000b0047688fc8acdsi4450081pge.474.2022.12.01.04.22.23; Thu, 01 Dec 2022 04:22:34 -0800 (PST) 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=@linaro.org header.s=google header.b=vD2UqwkT; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbiLALxJ (ORCPT + 82 others); Thu, 1 Dec 2022 06:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230484AbiLALww (ORCPT ); Thu, 1 Dec 2022 06:52:52 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142262B0 for ; Thu, 1 Dec 2022 03:52:49 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id b3so2128261lfv.2 for ; Thu, 01 Dec 2022 03:52:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hYw83hza5KUMmqWdnnIZoi5MZPfbnrDq+x3Y/unYtZg=; b=vD2UqwkTJAdcg3y/oUqJgFc3UVogimvWO+4kpmGX+TGc9tVoGR9rkXDLrMCtRLETgo bxsYGqwobSEhw9hN/Nngc+tO1s9dD5fSg14NnrSML2G+ooyUQy9y8FQj01/SK0WRDcx3 6+LjpN3epjNRgUY5MCzuLeH/YqOyHhQdskM/nj2XSSDTiyyQDTcB4HU8TucCtY52+QgV ohnxhXafcU0Uonkxgr4v8p5Elsw4yytzcRbcnj2+fVMaqftRBHJngBdkvbpVpSY2Dw6s qsovl9p4Ur+0g9xU35hUEDQ+A3bQ4jlr+7zu2ATmM5lP7OEi7sRCqqgbWLg5Oy8l72QO 1uiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hYw83hza5KUMmqWdnnIZoi5MZPfbnrDq+x3Y/unYtZg=; b=CcTC+NE+Xn/sqMj9Msp6p72HFqOCB3ESRkA0YtOR+iRnzAnLqt97SZJcajaKF87sBy X2chWG2EXVfLdN7UA+1wh4c4gKIbmSD4/lElffNQyCjSMRNCKRFYLxtPvbaV1ETLIs68 MeBch1pZvrc4Lp9XfguFERQSbV49aB8d3k3XZ7x2wU1njrtZF+ffS1EPy/RyMmIsVhOo z583z+gEXXhKo8F5oQDKNmARgG1sSiM1fifxwLXuzPvd4Ap4UOZaCXJ2KnMRxIJEqt87 BBr1ADhzSD0EujaLjyQwtd4Nm8zrnrEoQRzUDhQRBc3m5v7db0AeqCQIagPUPxiygXsF cUHQ== X-Gm-Message-State: ANoB5plX7GPbVNiiigVOMwq5UQcrDvJME7WI/ipD6M/keUouBok2xEUi 9+eB4g8HX0THj14sLCG5SMfVJQ== X-Received: by 2002:a05:6512:3153:b0:4a2:da6:d969 with SMTP id s19-20020a056512315300b004a20da6d969mr19251541lfi.671.1669895567330; Thu, 01 Dec 2022 03:52:47 -0800 (PST) Received: from mutt (c-e429e555.07-21-73746f28.bbcust.telenor.se. [85.229.41.228]) by smtp.gmail.com with ESMTPSA id bi41-20020a0565120ea900b00492ce573726sm625609lfb.47.2022.12.01.03.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 03:52:46 -0800 (PST) Date: Thu, 1 Dec 2022 12:52:44 +0100 From: Anders Roxell To: Herbert Xu Cc: Kees Cook , 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: <20221201115244.GC69385@mutt> References: <20221028210527.never.934-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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_PASS autolearn=unavailable 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 2022-11-04 17:03, Herbert Xu wrote: > 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? I think that was fixed in sparse release v0.5.1 [1]. The workaround 'if (len)' was introduced back in 2011, and the sparse release v0.5.1 was done in 2017. So it should probably be safe to remove the 'if (len)' or what do you think? Cheers, Anders [1] https://sparse.docs.kernel.org/en/latest/release-notes/v0.5.1.html