From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36552C47258 for ; Tue, 23 Jan 2024 17:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SenAnp5EgdiX0eW7jF9fLjn7BPsbWGMbY0vvcHl9swk=; b=vgIuX9kuwi+7xF tU25PbmFEO+M4P8i/6FbL8xyinDMm/pYFtULdoM4VEs8EEHoIwRm8c6uTs820Vic4bLtTBbU5eA5X X2ASuwDw2a59Xz/Nw1wYW78bfWjMWZZRCCxuDeZ5qK9noKlWTet6x9/sjgE27lQulk7TZwdRsqlJi RRBaR58CfkBbQFq5s3NkyzYrhgEYrOmjkltXU0E4ax5UVBlOUysmRMMkE0CWfjnltqP8OHQgcbAKE yQFZxCKldZ+bCJw8IH5rNT9JlmJhFo/939cNkKiaRZNhTGcZfUu1p8z/V/jv+6BpxUtUA8ZBnNgjB a/C/0Q0YkL1xKX6Cro1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSKpq-00HYiJ-0n; Tue, 23 Jan 2024 17:45:18 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSKpn-00HYhS-0u for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 17:45:16 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40ec048e0c1so6062705e9.2 for ; Tue, 23 Jan 2024 09:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706031909; x=1706636709; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W4oyBrQ4+qtvNHd22bRaiLV27J7OcLKPIojk24G7ULU=; b=U+prlJhn4e1DgCSA56VhONS3dyOk60PeHxR3VdvE++l8+LLJAaUShMkvNF68G0r2ur voAeCEa2I7bB2RkW25/fPLtGq+wVBz1W35qvnFO7fJEkJtEJSVHIaWAiwsfQ6cwa3B2B QeZvk1JEhC84BY5GbgMKK7g8rIJd/FysyUnOn5mmI7iGgxK+hi1ONLLST0BGA2CcHn0X rMmqhw+skvyVXeiL1NYMUnxxUOM6eeq/bIxCull/4wre865kXDbV7JeQ4SYH/y4cb5CI VatU6NUKp7fQzYrpiu5P1uQgK+nnEckeEmlVbe3wAVJO7Cc9KAEJsxxSjcEI6q2fkNMr KoPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706031909; x=1706636709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W4oyBrQ4+qtvNHd22bRaiLV27J7OcLKPIojk24G7ULU=; b=YMsFdCEowDIUSSOc3Wjpcdm+ZRyFh70WtMUra1ozwcgu7klaS8xs05kJnxdk7nkvVz izdbeZ6ozwBL4LgFWODzQ738HRDgmiajONQfKZ7Isi1HNefgIeUsTCa5oBseTYY1U5qw ooFZbtCL1kRV8sXsnV5csRG1FEV+gdUEAzUrf4EOknZff8p4W6iltMzPszqbFsZPc1oa dr2gZt/FzonWZTOcWk60qZp3DGXLkIx3wwbi5f2vRbw2dvze6yQGUQuubEtZpKFgaJja 8FqdxRbLeTA6enoVsbI+utZq3KtQE+SmsjMGLw7bSGSga4JKDj05/oo/No7DyGD6z5q5 wI2g== X-Gm-Message-State: AOJu0Yw1IjtLavzc/CR33LoIrSHCBoGVXVAGigkeI+N+iYgSYjEQen5f 9T+R2XRoPPu10/uxt3mEEc+a7OguA1S4kvGVhWSl73JN4pp/21Jl X-Google-Smtp-Source: AGHT+IFvQq2aPOGlvF4JOsf/hb7L41ATp/rSHCn3ZpEvu3AEHPAoSdqMSCs8os0KHLA0EEadsR8H9A== X-Received: by 2002:adf:e84c:0:b0:337:cdc1:daff with SMTP id d12-20020adfe84c000000b00337cdc1daffmr3997048wrn.71.1706031908892; Tue, 23 Jan 2024 09:45:08 -0800 (PST) Received: from jernej-laptop.localnet (86-58-14-70.dynamic.telemach.net. [86.58.14.70]) by smtp.gmail.com with ESMTPSA id x8-20020adfdd88000000b003392ae3aee8sm9009835wrl.97.2024.01.23.09.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 09:45:08 -0800 (PST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Corentin Labbe , Herbert Xu , "David S. Miller" , Chen-Yu Tsai , Samuel Holland , Jonathan Corbet , "Gustavo A. R. Silva" , Erick Archer Cc: Erick Archer , 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() Date: Tue, 23 Jan 2024 18:45:07 +0100 Message-ID: <1876185.tdWV9SEqCh@jernej-laptop> In-Reply-To: <20240121153407.8348-1-erick.archer@gmx.com> References: <20240121153407.8348-1-erick.archer@gmx.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_094515_321049_4E6F2395 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dne nedelja, 21. januar 2024 ob 16:34:07 CET je Erick Archer napisal(a): > 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 Acked-by: Jernej Skrabec Best regards, Jernej _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel