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 2771ECA0FF2 for ; Tue, 26 Aug 2025 16:35:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E01E1404B5; Tue, 26 Aug 2025 16:35:09 +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 R76XnFqFsqIc; Tue, 26 Aug 2025 16:35:09 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6A56D404BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1756226109; bh=sMCMEoZiNRbinWDWAhjd4RnbfkqT+XEVSpUnoVyKL9k=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qonS6OKasxkscJDYsvs6PFWahoa3fPazpdCkmZLD8hn2bxrr//iYQy6Cp3asZJvm7 FBulo3/AxjZHkGvagAhAB3psP1/6o5lXh71eByDmvYFDtEH69XcgtB5ehHCUrO3vMt AeHAZxOUKeuAS2pxXit3I9oHBZRWbxJLwH+mAszTYv5NhvGO6sgxoEdwxT/R8CBqx7 /BRsNU9D9H13gsrHWpHIW6nTB2GBrX1GWyHspAViO/ll5g+sLZ6ruMozMKR1nExxtE Qr7+XTHNVQan+wHuzeyhemNgGFrcMVjViwRzfy1ZgiAkZnwffLVNyLxV/wmOsJaOGM 3nnHkGf3OxVlw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 6A56D404BF; Tue, 26 Aug 2025 16:35:09 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id 26255114 for ; Tue, 26 Aug 2025 16:35:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 18415404B7 for ; Tue, 26 Aug 2025 16:35:08 +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 QOMA3TZ91nXG for ; Tue, 26 Aug 2025 16:35:07 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 94720404B5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 94720404B5 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp4.osuosl.org (Postfix) with ESMTPS id 94720404B5 for ; Tue, 26 Aug 2025 16:35:07 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 8D6CE601F5; Tue, 26 Aug 2025 16:35:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D65AC4CEF1; Tue, 26 Aug 2025 16:35:04 +0000 (UTC) Date: Tue, 26 Aug 2025 17:35:01 +0100 From: Simon Horman To: Przemek Kitszel Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , netdev@vger.kernel.org, Greg KH , jeremiah.kyle@intel.com, leszek.pepiak@intel.com, Lukasz Czapnik , Aleksandr Loktionov Message-ID: <20250826163501.GF5892@horms.kernel.org> References: <20250813104552.61027-1-przemyslaw.kitszel@intel.com> <20250813104552.61027-2-przemyslaw.kitszel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250813104552.61027-2-przemyslaw.kitszel@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756226106; bh=W1n1sAkc0JdMu9jx8ALDS1TpplDfSrk9aAQmda91AvQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DQRDt+WDihtX4TcTVNG69PKKYdZvbWuk3GduAi+PG8mmnqkdY+I75+5WL3MLjqUXt 0uvdovT8cvi3c5dNJXc9UcAgWAN35sT9IyJMoDQRx0RFxID4fS+OP8yPVxJg3kfteN cihs4iALoR1PVttxSqwgY7Vl+yjkBBFPDkMngA+latfzW1XpP8yrCDsPix1AaRkx1z 4aYi/jrj1M3AyWY2O0ALmVQMjFYVZzh8cU2E70ja+HySQgvfXwmEYaHma8BEd3g1a3 rsydI65KtNxkVjGzM/gIDz/mJJXBpZWMkxnmwhOqF4wgbMXC/KtK19EuVeFUHMqEvk WirbedRT1fiaw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=DQRDt+WD Subject: Re: [Intel-wired-lan] [PATCH iwl-net 1/8] i40e: add validation for ring_len param X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Wed, Aug 13, 2025 at 12:45:11PM +0200, Przemek Kitszel wrote: > From: Lukasz Czapnik > > The `ring_len` parameter provided by the virtual function (VF) > is assigned directly to the hardware memory context (HMC) without > any validation. > > To address this, introduce an upper boundary check for both Tx and Rx > queue lengths. The maximum number of descriptors supported by the > hardware is 8k-32. > Additionally, enforce alignment constraints: Tx rings must be a multiple > of 8, and Rx rings must be a multiple of 32. > > Fixes: 5c3c48ac6bf5 ("i40e: implement virtual device interface") > Cc: stable@vger.kernel.org > Signed-off-by: Lukasz Czapnik > Reviewed-by: Aleksandr Loktionov > Signed-off-by: Przemek Kitszel 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 AA1772C3261 for ; Tue, 26 Aug 2025 16:35:06 +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=1756226106; cv=none; b=qmPPWsItj/7S/v49EYC8gNqObPI0kCLKbOH16rIPu1cJyBl4u/zBU5QK2ebgmfJYU3OmZaY80RMpTI3X7OgGJABtuJkxAFB8otJxVzJXsrfyE7bgK2CrfYwr2R24hiwVVRZVxrhG1v1fB71WxJB5pSSISwIAfJ2ASVvR4xYTm/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756226106; c=relaxed/simple; bh=W1n1sAkc0JdMu9jx8ALDS1TpplDfSrk9aAQmda91AvQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uq2xua8STp1c0B9ScRMHzz4d4n8UU1mMgjcbLXqstz8oD5rFJJI+Vk9JMJ/9us3s9eOBhFTX+SZrrmdlfsbbVn8ep6IWOjXGQ09Ha2IBWHl8o8DMhPispqt0BdnmHVAyKb3q4xA5PQmwvtfVkHRHJvpAmD2EIOxZ+hmZ5I8rKtE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DQRDt+WD; 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="DQRDt+WD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D65AC4CEF1; Tue, 26 Aug 2025 16:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756226106; bh=W1n1sAkc0JdMu9jx8ALDS1TpplDfSrk9aAQmda91AvQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DQRDt+WDihtX4TcTVNG69PKKYdZvbWuk3GduAi+PG8mmnqkdY+I75+5WL3MLjqUXt 0uvdovT8cvi3c5dNJXc9UcAgWAN35sT9IyJMoDQRx0RFxID4fS+OP8yPVxJg3kfteN cihs4iALoR1PVttxSqwgY7Vl+yjkBBFPDkMngA+latfzW1XpP8yrCDsPix1AaRkx1z 4aYi/jrj1M3AyWY2O0ALmVQMjFYVZzh8cU2E70ja+HySQgvfXwmEYaHma8BEd3g1a3 rsydI65KtNxkVjGzM/gIDz/mJJXBpZWMkxnmwhOqF4wgbMXC/KtK19EuVeFUHMqEvk WirbedRT1fiaw== Date: Tue, 26 Aug 2025 17:35:01 +0100 From: Simon Horman To: Przemek Kitszel Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , netdev@vger.kernel.org, Greg KH , jeremiah.kyle@intel.com, leszek.pepiak@intel.com, Lukasz Czapnik , Aleksandr Loktionov Subject: Re: [PATCH iwl-net 1/8] i40e: add validation for ring_len param Message-ID: <20250826163501.GF5892@horms.kernel.org> References: <20250813104552.61027-1-przemyslaw.kitszel@intel.com> <20250813104552.61027-2-przemyslaw.kitszel@intel.com> Precedence: bulk X-Mailing-List: netdev@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: <20250813104552.61027-2-przemyslaw.kitszel@intel.com> On Wed, Aug 13, 2025 at 12:45:11PM +0200, Przemek Kitszel wrote: > From: Lukasz Czapnik > > The `ring_len` parameter provided by the virtual function (VF) > is assigned directly to the hardware memory context (HMC) without > any validation. > > To address this, introduce an upper boundary check for both Tx and Rx > queue lengths. The maximum number of descriptors supported by the > hardware is 8k-32. > Additionally, enforce alignment constraints: Tx rings must be a multiple > of 8, and Rx rings must be a multiple of 32. > > Fixes: 5c3c48ac6bf5 ("i40e: implement virtual device interface") > Cc: stable@vger.kernel.org > Signed-off-by: Lukasz Czapnik > Reviewed-by: Aleksandr Loktionov > Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman