Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp146482rwj; Thu, 22 Dec 2022 22:31:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXtG5nbD08RGF9TaQVQq9DKgAaVy3loz+IF2ga2xEKvLoxSxueZaJLvP+wJltkeWgBnWnjAC X-Received: by 2002:a05:6402:25c6:b0:46c:d2a3:76b3 with SMTP id x6-20020a05640225c600b0046cd2a376b3mr8296965edb.14.1671777101531; Thu, 22 Dec 2022 22:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671777101; cv=none; d=google.com; s=arc-20160816; b=0lkRwYzS/sHRtclUqHcvDcX0LMyNRJYaBXeZigyu6L3IIPn+1r7DD+7rRLtQO/+82W 83xRWEbfV601SbDDadldIltYYvsB3Fo6fFLFjyT3T7JVaNdY9eGMBDmW+CgrHFw1m6RU eZVuhcMyZWPjjLf4w6DezE+dfXZ2/yWd/ywAco/gqELXiJkp2y86+y4mX9rsssI8BG6i gTlUKsFg1YyTcQDnDw2tf7OXXwMsS95jnVEc7hUfpa+fbaC6i5vYQk9IalP9bzcR1un0 w4EAnbvw8eBsV+61znZ7E8GqBb7AYDxxO4B3ZfHJ/jTrMdzOId1H86jbbU8wEGNzb9HK avyQ== 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; bh=u1gNYydpdMVfOaHar+6HuL/h9l4yynC2qzYEFtGFYHQ=; b=qqJaKzFm7oczI0NXT/FDy7hGF0aVyAAwrsT7ZVM2YVqlyx0jiREo7BfMfJB8T9WgUk BcrMR6KgkP2zfV8NI3T6zWCC7noXA+jlE2jwYegjnT5C+NA70FuRyLKWPWq6pwD9IXzf 9mslZJBd8zMNg7Xusy47m1SNn7SSjlQ3kKE+2mqZlWek40aW2qOnbWVjk7vXsOh/xoR8 euumAjU9LVuEN8MfXxxVNEGAsNhbFqBRi0VT3I5iLc0mJ27oK2voVFDL4R3XmBpAKoeo OxVQ7/2+SURPXWBK4mI9N7a/Ul4QQLsk/4Scq6eG27VN0Q2qAuIWSNdsXxMXmuscQuWR H9jw== 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 f17-20020a0564021e9100b0046ad8e026e1si2445974edf.69.2022.12.22.22.31.17; Thu, 22 Dec 2022 22:31:41 -0800 (PST) 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 S230106AbiLWG37 (ORCPT + 99 others); Fri, 23 Dec 2022 01:29:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiLWG37 (ORCPT ); Fri, 23 Dec 2022 01:29:59 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 179F51705E for ; Thu, 22 Dec 2022 22:29:58 -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 1p8bZ2-009jOx-49; Fri, 23 Dec 2022 14:29:53 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 23 Dec 2022 14:29:52 +0800 Date: Fri, 23 Dec 2022 14:29:52 +0800 From: Herbert Xu To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Horia =?utf-8?Q?Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , "David S. Miller" , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] crypto: caam - Prevent fortify error Message-ID: References: <20221222162513.4021928-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221222162513.4021928-1-u.kleine-koenig@pengutronix.de> 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 Thu, Dec 22, 2022 at 05:25:13PM +0100, Uwe Kleine-König wrote: > When compiling arm64 allmodconfig with gcc 10.2.1 I get > > drivers/crypto/caam/desc_constr.h: In function ‘append_data.constprop’: > include/linux/fortify-string.h:57:29: error: argument 2 null where non-null expected [-Werror=nonnull] > > Fix this by skipping the memcpy if data is NULL and add a BUG_ON instead > that triggers on a problematic call that is now prevented to trigger. > After data == NULL && len != 0 is known to be false, logically > > if (len) > memcpy(...) > > could be enough to know that memcpy is not called with dest=NULL, but > gcc doesn't seem smart enough for that conclusion. gcc 12 doesn't have a > problem with the original code. > > Signed-off-by: Uwe Kleine-König > --- > drivers/crypto/caam/desc_constr.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) Does this patch fix your problem? https://lore.kernel.org/all/Y4mHjKXnF%2F4Pfw5I@gondor.apana.org.au/ If not please send me your kconfig file. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt