Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp495812rdb; Fri, 26 Jan 2024 01:51:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+rLqo4GN8CHgF3tHnmMOTfSN57/RvnIikIA8JPKLjex03s6umRehXh6lfi0xgSaOfSqu2 X-Received: by 2002:a05:6512:20c5:b0:510:16cd:b79f with SMTP id u5-20020a05651220c500b0051016cdb79fmr505286lfr.139.1706262710988; Fri, 26 Jan 2024 01:51:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706262710; cv=pass; d=google.com; s=arc-20160816; b=jFhWHxZmIUmMQjn4FzyCTv4FbJu5Midt+CpmavkrEG6VVfevkFfjT+227x7IJJ3Y1m 1rwaLtsaeOf3puwloLbn4Z0AG6SHj2h3q5uveFMGBUpnFvNCIkyQCtmEubeF4uojIvHJ 4M7iAQBcuiaFug1ggrQ10exsLEmyKV7ldEEQq8ogVNvwJ+BkyozuJ8NydDoXNV91/vQt R6KLoCsk6TZbe8dyXPZjyLGvCOazxL/Ver0GWbKUPMxa0EiyBNOw5feXItKZNQ7nfGlt 8t8+Z+6VfHRwJH/KXYv+lgj8ATiICyIfm6C2Z/Ay3d9B2qoKq42S6ipCK4yyo6fHY0Zh KulQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=TUCcMzeKB0HIX6lA0YEyBB2URrvqpJeEfGQmGUUU9uU=; fh=8D6eeFq53uEm3zPWwG7KQ6BQinM0tgFqsnq+dz6nkno=; b=AjFH6FGaZCHj7KdSh7jGQiGhYvdQPXBVPvaaqX97IURmiTC6w55TCWAPcTgq5WUIou +994gLwg/o48zt6MnZNf79p1dZ5r/Z4pFaUr0giIgYRjSH5OlCFxCDBNekbqXnQcFASk PUY55Kp6zRknqm8LlFwtNw+371opCVT76YNqw6Bu+f3iF4Fq97+MbDRUuLQEl7NDjtGB 9jEWZQA8iofU4vBoP7W2tNwtpIDMdgxl7MclvjY0d09XNJA9aDdDN5hWOrtNmg40EhxC UFq6QVThaF5P3PYHJBrzTkktZ/KByVidTxPEPUZ/IMZSMjVRqepU87YOFMz1sv+YNuEq TdxQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-crypto+bounces-1647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1647-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g25-20020a17090613d900b00a3008b7b9d3si405467ejc.171.2024.01.26.01.51.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 01:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-crypto+bounces-1647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1647-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 734A11F2D7BD for ; Fri, 26 Jan 2024 09:47:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74575151472; Fri, 26 Jan 2024 08:58:51 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C755915146A; Fri, 26 Jan 2024 08:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.6.53.87 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706259531; cv=none; b=bjm2IYTR1+ny92THo1r5E6Fb52Yb0Up2bQQ3S3vyk1Ecnv1KyxTbDpVUTNJSI4jnkOOkw9lLDNyVjTJ/claxSKXAVMYt4Px1q404yg5llUcEh65tva9tRZ+ZqneHsgKfFSwZ5yKYFp7NIyOYK6i/ST4EXFwb3u+WPVdpQeug4a8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706259531; c=relaxed/simple; bh=f2Ea4tnTpi+RhTPJlVTJ67qgqs8LtHYD3YVA7bfKOpE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wv13k/xi6wkurdwHiiuIJj6m3M5QsbvtoVb4k4aR50zHwqCKFZeaoqYt29ZSDdgc4hk8GQPnVlROB4AXuP/T8PdQ9z9/QcwqsxSQraFEHe2HBGiBL7aWmHZQv3qxaCnFkjtKMVBziBz9PAY1EMpvWoa3R5mkP3/IHlt44HJjd1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; arc=none smtp.client-ip=144.6.53.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au 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 1rTI2k-006EZY-27; Fri, 26 Jan 2024 16:58:35 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 26 Jan 2024 16:58:46 +0800 Date: Fri, 26 Jan 2024 16:58:46 +0800 From: Herbert Xu To: Arnd Bergmann Cc: Giovanni Cabiddu , "David S. Miller" , Damian Muszynski , Arnd Bergmann , Tom Zanussi , Jie Wang , qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: qat - avoid memcpy() overflow warning Message-ID: References: <20240103162608.987145-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240103162608.987145-1-arnd@kernel.org> On Wed, Jan 03, 2024 at 05:26:02PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The use of array_size() leads gcc to assume the memcpy() can have a larger > limit than actually possible, which triggers a string fortification warning: > > In file included from include/linux/string.h:296, > from include/linux/bitmap.h:12, > from include/linux/cpumask.h:12, > from include/linux/sched.h:16, > from include/linux/delay.h:23, > from include/linux/iopoll.h:12, > from drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c:3: > In function 'fortify_memcpy_chk', > inlined from 'adf_gen4_init_thd2arb_map' at drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c:401:3: > include/linux/fortify-string.h:579:4: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] > 579 | __write_overflow_field(p_size_field, size); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/fortify-string.h:588:4: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] > 588 | __read_overflow2_field(q_size_field, size); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Add an explicit range check to avoid this. > > Fixes: 5da6a2d5353e ("crypto: qat - generate dynamically arbiter mappings") > Signed-off-by: Arnd Bergmann > --- > drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c | 3 +++ > 1 file changed, 3 insertions(+) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt