Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp498372rdb; Fri, 26 Jan 2024 01:59:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdxPOqhy2IOxcHVtJB4jJ1/SAr6T6h0j8NyyMs5QAQf5w8JWxjB04A1NcE7znzxk0TNf7m X-Received: by 2002:a17:906:a9b:b0:a31:b59:9cec with SMTP id y27-20020a1709060a9b00b00a310b599cecmr531601ejf.16.1706263165089; Fri, 26 Jan 2024 01:59:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706263165; cv=pass; d=google.com; s=arc-20160816; b=i5Zeux14lbWFLWCbgNugV2FtuMCfpcybxxKu7TOIC7mBq1uEBtntF1T/9BPtuWd7MY I8mC6+OQHcFO71UjBHYsfaIu5Rn57z3AvQ9hTKhO/3eNIevmNnVE7OGkvNjgKGHyQfid EnDieW4IxC6atKT7V5Go0H7ArB2Gg5+QPXVqPlsTl7CmkohvNcdS2JxaVk+M4uehM+El XzOw4Q57+suKAMJK3UCAOYs4LVakbO7fYNdoFZ/S6xlHuCGvt9CwqlhgRjtQhw+F9I3t Ezo3AfVFiAbGOeaLzu1tlKGAn8DFZADbn8h/kCvujJ9VBzeyjMhvvvQr2tGsjpwEsGnL iFlg== 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=OZl4RR+C3Chp7k18oN9SuDo2WrJGiWcuuZ0eUdbDBgo=; fh=Y4qIt80dkEN9nwGoxmC3Z3yxJM9kJ4eQ9K45bN1HbY8=; b=wSDDJkt4mHC8mtplHG/t7USKAIpJclkliCvG6y8dfpN3rs8Rq14h4+MrAJTTOvlPI7 5lfW3ujvHHWSkAcxR2zfUoLj40u6Gx9JlDFZsXyt1+8KKXA5qhd7EUMQn85oOv0ZtGu3 OQgU7oYpmLdm5NIJWWC+QN0qh+cwsUGDu12GVsB5Je5cym6iEXKpRK3By7UAuwhwGwii ywB3o2qSTowHvjTj2PfgWpXas2rzxpkVQbCG8xR5khzmq9m8uIJDzIAv4dPoIhbqLo/o lGKZzEmE/cun529BDWAXT4eoCUe7exDhzQqMPMcZumEJYKYB5PzXoRgRo+G2ZQvCdraR fQag== 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-1660-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1660-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 ch15-20020a170906c2cf00b00a341e30b001si408462ejb.941.2024.01.26.01.59.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 01:59:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1660-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-1660-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1660-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 C35FA1F29919 for ; Fri, 26 Jan 2024 09:57:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF9BC60B9C; Fri, 26 Jan 2024 09:06:47 +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 054B314019; Fri, 26 Jan 2024 09:06:45 +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=1706260007; cv=none; b=F9xhDXgC+o0QxMJ0hqK7HHUf1Rxja8ytsOnOsowVxoOMJb1OdgkO+WROw4WuTnXfS/y3NR9oJgyP/uozAEy12Ra7hV9MlBfsulU9FWF0iFDxMXQvf0hCIPG3T3BE9LAfnVXok9nJcChVlXRMFsE7C8+BlqplKlNgButjDTa+eLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706260007; c=relaxed/simple; bh=9TdjaTUeIdEneZuhIQO/f8S3DH/zxaQ0JHSf+TTrUB0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UNcUVsCVy3qrI4rz8jO2eF0Hn8QGJ04lsyfspeP7Y63AM8CHiTDsqqdK9BbAg79Kg+ZD9Pgax1lgGzSwLNGqqDBoJo2l+yxDtVF0Z0W9min8MugGIXzo5DzV1H2NrJQwJmo5v5B2p1xhw+XwfPU8cRa++AoQTYAulNa+CQFtBiA= 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 1rTIAQ-006EuX-Rm; Fri, 26 Jan 2024 17:06:31 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 26 Jan 2024 17:06:43 +0800 Date: Fri, 26 Jan 2024 17:06:43 +0800 From: Herbert Xu To: Erick Archer Cc: Giovanni Cabiddu , "David S. Miller" , Tero Kristo , Andy Shevchenko , Damian Muszynski , Shashank Gupta , Tom Zanussi , "Gustavo A. R. Silva" , qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] crypto: qat - use kcalloc_node() instead of kzalloc_node() Message-ID: References: <20240121164043.11222-1-erick.archer@gmx.com> 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: <20240121164043.11222-1-erick.archer@gmx.com> On Sun, Jan 21, 2024 at 05:40:43PM +0100, Erick Archer wrote: > As noted in the "Deprecated Interfaces, Language Features, Attributes, > and Conventions" documentation [1], size calculations (especially > multiplication) should not be performed in memory allocator (or similar) > function arguments due to the risk of them overflowing. This could lead > to values wrapping around and a smaller allocation being made than the > caller was expecting. Using those allocations could lead to linear > overflows of heap memory and other misbehaviors. > > So, use the purpose specific kcalloc_node() function instead of the > argument count * size in the kzalloc_node() function. > > Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1] > Link: https://github.com/KSPP/linux/issues/162 > Signed-off-by: Erick Archer > --- > drivers/crypto/intel/qat/qat_common/adf_isr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt