Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp498390rdb; Fri, 26 Jan 2024 01:59:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqW+r3h6pJRby4LdMmPraqT+5Hemh4uAzeci7XWf3d4IA5iw+stXjSYID0W9lCRT+sKx6b X-Received: by 2002:a17:906:d29a:b0:a34:96fa:9602 with SMTP id ay26-20020a170906d29a00b00a3496fa9602mr614147ejb.34.1706263169122; Fri, 26 Jan 2024 01:59:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706263169; cv=pass; d=google.com; s=arc-20160816; b=lykKILg55DYXvJZQg2WA368vZzl5KoScRTx0AQEA7+8G44itsQUJpOCp+z7uKGl54N VPCaGMiQY2EigjzgaU/Lp5psp4zli8vGlb3UfPtMQUtTMHDn/4KrIHyOE3GfCGupT+h1 MppoxElGxsJQan7Y3z+5z+uFHS1pYMNdQqo1KQ1bpkL2/hUzXs21EX102cjTw6CPAXzc pi9UBrC21Wo+lvi/tcsDvBUZ6SIVN4dRvrby3wQCfwcqXtoJl/oCctQ4RvZdV42n29pc QHzq2A3aA7X1vvBe4v3eEqyd337pCZz1mzrH/AiqkHjCeuR64z+XCKnIrAVlsWPXdSI3 oiWw== 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=gOrLGUw6goGvvu1JQrRoS6DNHhPwez2U6NIvUuYAw/s=; fh=8dCFo0iPp+tyfitIVBHyrt0VYu6RIH/trRja+dtQ/3A=; b=yaNBIxpgC75JLE+KdJzGwoPgF1FwTtdHTR9UvP0/EOvxUMlRj0kS5wn7wb2ITgelTq NQYS/HvBpI9Ai0I+dRp6M2pYyhpHBAjA1i8Y4C3xhS5ZcUc8QR3EYKQm45tgeMtQO0bD JAxliM5ix/MYNwjmbW3X+ncOBQlssxkxEgs1K6TMpTlRNecce7ctlw/QYlmV93we9NUV 7ccAfRfT3r1AuQRPH92xLh1L2AdENw5rCsZEN2ICSjBrRmYyof9++ocJRBDFMYkhFAFV FfoZO/8ZXYa1ayqOCQNdYBXS/W28VDHod6NYFKbMa0u2sWIG+kb6fGdXV7YzFOvMG3vW YT9Q== 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-kernel+bounces-39887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39887-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ay21-20020a170906d29500b00a2f005f2f7asi438103ejb.163.2024.01.26.01.59.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 01:59:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-kernel+bounces-39887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39887-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 4230F1F2141F for ; Fri, 26 Jan 2024 09:57:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0095160DD3; Fri, 26 Jan 2024 09:06:49 +0000 (UTC) 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 AE5C860B90; Fri, 26 Jan 2024 09:06:46 +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=1706260008; cv=none; b=nCJFaBYTpAiLqsiKsk5rjoLI0d92wMhbx7Q+EWG9WZ7GarBSWgmWZMfSK7ehyos2sBMPppcNavSI9Aze6yLT0ss7fiITDIB1DfkwLqncaQce3MnjuSMyz1BQVFeZibnpZTBcvXN2DIFvvK66N4AJQd4Ay7UFozu2wylcZ5nEiG8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706260008; c=relaxed/simple; bh=FmZ7L70FxZzdqagdRT1MctQ8VKv5y9VO6LoUIfjlsTQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pT8I4HVCc8fBIywDamug1+mM3G5z8OfnRizdbNOx2FX0ydsh5RPxHpqBNY25FyF1y1r527gzwHmq5oQEaKW6j2MKF9crICKrkXNdUv4e3pxW6wnkdsQlLBLkWO6S/nxV9J0m+wSI+ocupGaQ3h0fKp2i1oGi5KPXJX1VhXg5dNw= 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 1rTIAG-006Eu5-Mh; Fri, 26 Jan 2024 17:06:21 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 26 Jan 2024 17:06:33 +0800 Date: Fri, 26 Jan 2024 17:06:33 +0800 From: Herbert Xu To: Erick Archer Cc: Corentin Labbe , "David S. Miller" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , "Gustavo A. R. Silva" , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] crypto: sun8i-ce - Use kcalloc() instead of kzalloc() Message-ID: References: <20240121153407.8348-1-erick.archer@gmx.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240121153407.8348-1-erick.archer@gmx.com> On Sun, Jan 21, 2024 at 04:34:07PM +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() function instead of the argument > size * count in the kzalloc() 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/allwinner/sun8i-ce/sun8i-ce-hash.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