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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 F3F3CC3DA47 for ; Thu, 11 Jul 2024 08:49:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 990464163E; Thu, 11 Jul 2024 08:49:05 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iNuCubXc7MQR; Thu, 11 Jul 2024 08:49:04 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 658D241686 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1720687744; bh=pYchy3My81Vc+ZTBbj/Mwa89NW67tIeKxXHGx9yC0EQ=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=z8ddWTdd8K73HKnbYSuGtf3NdlNaGBPiGvfGB1dlYFZmvyxMwXfIovUinQueDurpg OEjNqB8Z2f5C2v/nSEMhvk7gphcF75/7GDqqNe2O4FWdeFgiRWBdONZ5lcQntv/Gr+ fVh5vMR9iIMvN+pI4uCT366N9g8m+bVTrUkXSrUb7HiZPQfNWTzM6qaiTwxToghvEQ R4I6pZM8H5oVtXrjcs8wAITzx0Cc70St/1QJSrMNYchh9HyfcTXfdc/APcktlxvcw7 pS2V2Fy61nPIar8Z3k8vV0yIDOdQMWzL8/uSrEnBf8A6r/lMFUg/hU+66BuN4YultP bbzLnljYCWmwQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 658D241686; Thu, 11 Jul 2024 08:49:04 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5E8581BF471 for ; Thu, 11 Jul 2024 08:49:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5686380CD4 for ; Thu, 11 Jul 2024 08:49:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id egkYNRNmG1uH for ; Thu, 11 Jul 2024 08:49:02 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 836A080C9A DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 836A080C9A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp1.osuosl.org (Postfix) with ESMTPS id 836A080C9A for ; Thu, 11 Jul 2024 08:49:02 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 517FD61B32; Thu, 11 Jul 2024 08:49:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78717C116B1; Thu, 11 Jul 2024 08:48:58 +0000 (UTC) Date: Thu, 11 Jul 2024 09:48:56 +0100 From: Simon Horman To: Aleksandr Mishin Message-ID: <20240711084856.GB8788@kernel.org> References: <20240710123949.9265-1-amishin@t-argos.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240710123949.9265-1-amishin@t-argos.ru> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720687741; bh=KvSh6XeA52JyOMfHv09Hn8dqnlUTpUE6bi2Cxcgc3ZM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fR0alzbSMLlG8PEUDZzG2UHxWzI1XW8DEVXqg8wuYWbTmYJgOTfK3FLogTE/gLZuQ QP6mzkZ8VHIIRsXcca6bekX7QPUBWeWSWe84TBbS0SOwHAFSu/T7OdI2w8R57Y/Pg7 1/OMdzHb18YgPUu7om/UqQX9AliwDgssniukFsjwTV0xVnjulCZcDJ8WnmKsuqYp2y tLi/VzXIfgJBDxmJuxk7lOWB2Oe68ETEeD5wI3uXv7ba/4xtvgh3VLyPpNKsj1gI/a YKNPGt1TwC0CDz2mUNKnmBfAvZAw+cZYHVdcwla7lc1+/nK6utb3Qu17L7Bw506F88 qi1iMdZ9wFgDw== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=fR0alzbS Subject: Re: [Intel-wired-lan] [PATCH net-next v4] ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvc-project@linuxtesting.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, Przemek Kitszel , Anirudh Venkataramanan , Tony Nguyen , netdev@vger.kernel.org, Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Wed, Jul 10, 2024 at 03:39:49PM +0300, Aleksandr Mishin wrote: > In ice_sched_add_root_node() and ice_sched_add_node() there are calls to > devm_kcalloc() in order to allocate memory for array of pointers to > 'ice_sched_node' structure. But incorrect types are used as sizeof() > arguments in these calls (structures instead of pointers) which leads to > over allocation of memory. > > Adjust over allocation of memory by correcting types in devm_kcalloc() > sizeof() arguments. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Reviewed-by: Przemek Kitszel > Signed-off-by: Aleksandr Mishin > --- > v4: > - Remove Suggested-by: Przemek Kitszel > - Add Reviewed-by: Przemek Kitszel > (https://lore.kernel.org/all/6d8ac0cf-b954-4c12-8b5b-e172c850e529@intel.com/) > v3: https://lore.kernel.org/all/20240708182736.8514-1-amishin@t-argos.ru/ > - Update comment and use the correct entities as suggested by Przemek > v2: https://lore.kernel.org/all/20240706140518.9214-1-amishin@t-argos.ru/ > - Update comment, remove 'Fixes' tag and change the tree from 'net' to > 'net-next' as suggested by Simon > (https://lore.kernel.org/all/20240706095258.GB1481495@kernel.org/) > v1: https://lore.kernel.org/all/20240705163620.12429-1-amishin@t-argos.ru/ Thanks for your persistence, this version looks good to me. Reviewed-by: Simon Horman From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 67B3B78283; Thu, 11 Jul 2024 08:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720687741; cv=none; b=jQTVVpUqZ23WSSiVsitVA2aqmj82AQTxnPyOgzQCGejybvb0kC3JfZ/Xgk9uIj34mIzXAaxLTUuGgj7XE9df4VRU+oXCAbV8TJAFIjcwTCCM7lqs4JCfXJFG4qPnwx5V5UiWNQp0Qh1vXAt7I+qsSC/AsUaO10ajNwoxGAYSNa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720687741; c=relaxed/simple; bh=KvSh6XeA52JyOMfHv09Hn8dqnlUTpUE6bi2Cxcgc3ZM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lKekRMXM3SIGztfhJOuk7+2RFnR/aT+Wzpuv3pm+qZZU1gqsW4W5oOsdoJISqv5C3YoU6ifEo5FnPTR+cWy04K/ZOnPNKl1wdfmFBzz+sLGzGj76Mg4jjjHzacALaO9QEIFxzoW83nRpv9JN3GIecrBmegsMBApbnvBpTdhA+5Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fR0alzbS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fR0alzbS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78717C116B1; Thu, 11 Jul 2024 08:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720687741; bh=KvSh6XeA52JyOMfHv09Hn8dqnlUTpUE6bi2Cxcgc3ZM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fR0alzbSMLlG8PEUDZzG2UHxWzI1XW8DEVXqg8wuYWbTmYJgOTfK3FLogTE/gLZuQ QP6mzkZ8VHIIRsXcca6bekX7QPUBWeWSWe84TBbS0SOwHAFSu/T7OdI2w8R57Y/Pg7 1/OMdzHb18YgPUu7om/UqQX9AliwDgssniukFsjwTV0xVnjulCZcDJ8WnmKsuqYp2y tLi/VzXIfgJBDxmJuxk7lOWB2Oe68ETEeD5wI3uXv7ba/4xtvgh3VLyPpNKsj1gI/a YKNPGt1TwC0CDz2mUNKnmBfAvZAw+cZYHVdcwla7lc1+/nK6utb3Qu17L7Bw506F88 qi1iMdZ9wFgDw== Date: Thu, 11 Jul 2024 09:48:56 +0100 From: Simon Horman To: Aleksandr Mishin Cc: Anirudh Venkataramanan , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Przemek Kitszel Subject: Re: [PATCH net-next v4] ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node() Message-ID: <20240711084856.GB8788@kernel.org> References: <20240710123949.9265-1-amishin@t-argos.ru> 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: <20240710123949.9265-1-amishin@t-argos.ru> On Wed, Jul 10, 2024 at 03:39:49PM +0300, Aleksandr Mishin wrote: > In ice_sched_add_root_node() and ice_sched_add_node() there are calls to > devm_kcalloc() in order to allocate memory for array of pointers to > 'ice_sched_node' structure. But incorrect types are used as sizeof() > arguments in these calls (structures instead of pointers) which leads to > over allocation of memory. > > Adjust over allocation of memory by correcting types in devm_kcalloc() > sizeof() arguments. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Reviewed-by: Przemek Kitszel > Signed-off-by: Aleksandr Mishin > --- > v4: > - Remove Suggested-by: Przemek Kitszel > - Add Reviewed-by: Przemek Kitszel > (https://lore.kernel.org/all/6d8ac0cf-b954-4c12-8b5b-e172c850e529@intel.com/) > v3: https://lore.kernel.org/all/20240708182736.8514-1-amishin@t-argos.ru/ > - Update comment and use the correct entities as suggested by Przemek > v2: https://lore.kernel.org/all/20240706140518.9214-1-amishin@t-argos.ru/ > - Update comment, remove 'Fixes' tag and change the tree from 'net' to > 'net-next' as suggested by Simon > (https://lore.kernel.org/all/20240706095258.GB1481495@kernel.org/) > v1: https://lore.kernel.org/all/20240705163620.12429-1-amishin@t-argos.ru/ Thanks for your persistence, this version looks good to me. Reviewed-by: Simon Horman