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 60AE8C3DA4A for ; Fri, 9 Aug 2024 12:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type: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=4Nt3KN+GgvNj0GJvoFrPWLBQZUgvxPyBhiVM46HodvQ=; b=K+mj7S8rHxJ6PXWHOyhT/1Ry2o rSnGYqt3Zg3L8xQw14DgYg+EnvEcToajxOD3RVUp0TElzEzlKL828yyG1Q7AuU+LbfHqCaaBuHlFU ljhXA5v6hAwIKgc4jC5CnvyiXnpTUOZJQtmwKOH4MVl8jGmz8gKkAYVK/bFmwGu/n0I7eqaMsn0hn rpUKlugGPk1QBP/3oYU66g/KinZSXpCLkibfPgpYVFUrdnoP+82oMaKn/eWAAjTWu+i61X6GgiRH7 S//5HvGuyF7N/XsCfR0JQ1iP1MQBJPpz1s7wqk5auC0jUWeAEOgekERAmMuuCYptaS7Sf1vEjHFaT 6dIyTI+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scP7b-0000000BFVt-3XwD; Fri, 09 Aug 2024 12:53:31 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scP72-0000000BFNU-0vr1 for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 12:52:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 58412CE168B; Fri, 9 Aug 2024 12:52:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA9A3C32782; Fri, 9 Aug 2024 12:52:50 +0000 (UTC) Date: Fri, 9 Aug 2024 13:52:48 +0100 From: Catalin Marinas To: Andy Shevchenko , Will Deacon Cc: Hanjun Guo , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Sudeep Holla , "Rafael J. Wysocki" , Len Brown Subject: Re: [PATCH v1 1/1] ACPI/IORT: Switch to use kmemdup_array() Message-ID: References: <20240606165005.3031490-1-andriy.shevchenko@linux.intel.com> <3a1e0ffe-db11-d18f-db33-881df7d9b18d@huawei.com> <2edd3b72-24a4-8b19-8738-cc82dc4fae6c@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_055256_482311_DE234155 X-CRM114-Status: GOOD ( 23.67 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 09, 2024 at 03:16:34PM +0300, Andy Shevchenko wrote: > On Fri, Jun 14, 2024 at 08:54:39AM +0800, Hanjun Guo wrote: > > +Cc Catalin > > > > On 2024/6/11 18:42, Hanjun Guo wrote: > > > On 2024/6/7 0:50, Andy Shevchenko wrote: > > > > Let the kememdup_array() take care about multiplication and possible > > > > overflows. > > > > > > > > Signed-off-by: Andy Shevchenko > > > > --- > > > >   drivers/acpi/arm64/iort.c | 2 +- > > > >   1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > > > > index c0b1c2c19444..e596dff20f1e 100644 > > > > --- a/drivers/acpi/arm64/iort.c > > > > +++ b/drivers/acpi/arm64/iort.c > > > > @@ -822,7 +822,7 @@ static struct iommu_iort_rmr_data *iort_rmr_alloc( > > > >           return NULL; > > > >       /* Create a copy of SIDs array to associate with this rmr_data */ > > > > -    sids_copy = kmemdup(sids, num_sids * sizeof(*sids), GFP_KERNEL); > > > > +    sids_copy = kmemdup_array(sids, num_sids, sizeof(*sids), > > > > GFP_KERNEL); > > > >       if (!sids_copy) { > > > >           kfree(rmr_data); > > > >           return NULL; > > > > > > Looks good to me, > > > > > > Acked-by: Hanjun Guo > > > > Catalin, would you mind pick this up as well? > > Any news? > > I do not see this even in Linux Next... Ah, sorry, I missed this. Since it doesn't look like a fix, I guess it's fine to go in 6.12. Adding Will since he's handling the upcoming merging window. -- Catalin