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 6993FC46467 for ; Tue, 3 Jan 2023 15:24:44 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FSijRkbL6C0Ck7ybPc6r0a4XUJwd/CMfAdN9ZIToxaQ=; b=GEenNHCvH0A3mm ipN4iQ9sHBCYT2OsRgKUo7WXjFD4hXyRY0HNe3lQcg+0yWi6oGofbwWvGrqAWDr64QEG/Xgo1zZhV W244oMdIIUu0GLL+1P28p+Nw2Rv2z3Swa7IvOqYCMDHoFGYbkpVoqEREZz4cEUH5T5U75lLn4uB+U 4c492u2TRZUvgrrEg2Aq28Qr7kF4/vM0pwxphI+7YZFH5D8PriAoeuMCgyog+iFotVPgxnI6ZQtKt AOUApRA4z5FqiFZTRvF50jI79eNl3KPdJ78PUKOcTyJSjqp2ttN9KF23Y/Y6UR2jSoQbquv2TlH4i qwQpFeg9/tq4N4YSZAcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCj8Q-002OnH-0Y; Tue, 03 Jan 2023 15:23:27 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCeOD-000g9U-B8 for linux-arm-kernel@lists.infradead.org; Tue, 03 Jan 2023 10:19:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mQ+kH7Y1jP8FPnV3r6fvzT20qbbg9pYdOaXBVU8Mh1s=; b=VfiIGMI2Jwicl5gjt8FuQRhlgB FtZPIMyWuAC4dgXlPh3TkJuEvvN+V0RWGejKvr4P5AGwseO7pDjNmN5yiVfQJmZO09UEPWc6ZtPJ+ ErgjrC0kT2jtz/DG0Vks/zZnVUH861EWUJBfJdRstwFZr+k0ygSCHgv/YuH6/DUIKfQlz7nI2OIUn W8XAdWtdq+xUtMMDjYd+hCDMaEkA0vGy1OaFYiqzZAqXV9RTTmf9itr6fU8YLfgaRs9AMrAObCGEp AiJUNANy6036vD/1GpQsBMaNjCblNsUReY/aU4OOHe0BBRA+lptViivo2TdYUITBzxOQ3iP8F6OLZ 2b6s46eA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35912) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pCeOA-0005Cm-J8; Tue, 03 Jan 2023 10:19:22 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCeO8-0001yu-W1; Tue, 03 Jan 2023 10:19:21 +0000 Date: Tue, 3 Jan 2023 10:19:20 +0000 From: "Russell King (Oracle)" To: Deepak R Varma Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Praveen Kumar , Saurabh Singh Sengar , Julia Lawall Subject: Re: [PATCH v2] ARM/dma-mapping: use kvcalloc for fallback memory allocation need Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_021925_459351_135AD435 X-CRM114-Status: GOOD ( 18.36 ) 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 On Wed, Dec 28, 2022 at 03:49:44PM +0530, Deepak R Varma wrote: > On Tue, Dec 20, 2022 at 07:46:32PM +0530, Deepak R Varma wrote: > > Current conditional determination of whether to use kzalloc or vzalloc > > has known issues such as "indefinite retry" when less than PAGE_SIZE > > memory is needed, but is unavailable. This LWN article [1] describes > > these issues in greater detail. Use helper function kvcalloc() instead > > which is more efficient in terms of performance and security. > > > > [1] https://lwn.net/Articles/711653/ > > > > This patch proposal is based on following Coccinelle warning using the > > kvmalloc.cocci semantic patch. > > arch/arm/mm/dma-mapping.c:858:28-29: WARNING opportunity for kvmalloc > > > > The semantic patch suggests using kvzalloc() helper function, however, > > this patch proposes to use kvcalloc instead. kvcalloc() helper function > > uses 2-factor argument form which is better from a security perspective > > as described in the following KSPP project commit. > > > > Commit 4e3fd7217105 ("wireguard: ratelimiter: use kvcalloc() instead of kvzalloc()") > > > > Signed-off-by: Deepak R Varma > > Hello, > May I please request a review and feedback on this patch proposal? The DMA API on ARM has been maintained by others recently, so it's no longer up to me. Please include Christoph Hellwig when sending changes for this. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8A28C3DA7D for ; Tue, 3 Jan 2023 10:19:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233192AbjACKT2 (ORCPT ); Tue, 3 Jan 2023 05:19:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232898AbjACKTZ (ORCPT ); Tue, 3 Jan 2023 05:19:25 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F50DE9D for ; Tue, 3 Jan 2023 02:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mQ+kH7Y1jP8FPnV3r6fvzT20qbbg9pYdOaXBVU8Mh1s=; b=VfiIGMI2Jwicl5gjt8FuQRhlgB FtZPIMyWuAC4dgXlPh3TkJuEvvN+V0RWGejKvr4P5AGwseO7pDjNmN5yiVfQJmZO09UEPWc6ZtPJ+ ErgjrC0kT2jtz/DG0Vks/zZnVUH861EWUJBfJdRstwFZr+k0ygSCHgv/YuH6/DUIKfQlz7nI2OIUn W8XAdWtdq+xUtMMDjYd+hCDMaEkA0vGy1OaFYiqzZAqXV9RTTmf9itr6fU8YLfgaRs9AMrAObCGEp AiJUNANy6036vD/1GpQsBMaNjCblNsUReY/aU4OOHe0BBRA+lptViivo2TdYUITBzxOQ3iP8F6OLZ 2b6s46eA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35912) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pCeOA-0005Cm-J8; Tue, 03 Jan 2023 10:19:22 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCeO8-0001yu-W1; Tue, 03 Jan 2023 10:19:21 +0000 Date: Tue, 3 Jan 2023 10:19:20 +0000 From: "Russell King (Oracle)" To: Deepak R Varma Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Praveen Kumar , Saurabh Singh Sengar , Julia Lawall Subject: Re: [PATCH v2] ARM/dma-mapping: use kvcalloc for fallback memory allocation need Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 28, 2022 at 03:49:44PM +0530, Deepak R Varma wrote: > On Tue, Dec 20, 2022 at 07:46:32PM +0530, Deepak R Varma wrote: > > Current conditional determination of whether to use kzalloc or vzalloc > > has known issues such as "indefinite retry" when less than PAGE_SIZE > > memory is needed, but is unavailable. This LWN article [1] describes > > these issues in greater detail. Use helper function kvcalloc() instead > > which is more efficient in terms of performance and security. > > > > [1] https://lwn.net/Articles/711653/ > > > > This patch proposal is based on following Coccinelle warning using the > > kvmalloc.cocci semantic patch. > > arch/arm/mm/dma-mapping.c:858:28-29: WARNING opportunity for kvmalloc > > > > The semantic patch suggests using kvzalloc() helper function, however, > > this patch proposes to use kvcalloc instead. kvcalloc() helper function > > uses 2-factor argument form which is better from a security perspective > > as described in the following KSPP project commit. > > > > Commit 4e3fd7217105 ("wireguard: ratelimiter: use kvcalloc() instead of kvzalloc()") > > > > Signed-off-by: Deepak R Varma > > Hello, > May I please request a review and feedback on this patch proposal? The DMA API on ARM has been maintained by others recently, so it's no longer up to me. Please include Christoph Hellwig when sending changes for this. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!