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 0E99D1FCC58 for ; Mon, 21 Oct 2024 19:40:41 +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=1729539642; cv=none; b=enMlv0//MH/zTKlupGRWLhgrAUDFbWclpBCpM8OimuwyfaFbCcWdhZoJ2Bl4RIDzWSHt+wwPrslVcM8E5HHgflzyfQd6B91W/EFX/6ABUYHFK/oeog7/gVDfcJA4xpg2CzsgM3G+N3fjQc0o3uC9/WouDfQEqwwB/i58GkEzhVE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729539642; c=relaxed/simple; bh=YqGnen516rN+EubofajlQd3lUU8QoR03dSFjfXuWQwc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hGr6KXsU9+57paTShZhUWtGYRMFcyyuMxHgZVQP2sdAATBU43uRgQpg53rNNF5sxQbP6QJ89zN91FVyMoNcPaoQbciqQ2XTPqn/Xee9DggwBdOjG/G4agvD0Mmg05ghbmtvT2j9OI72CW5J4W6BaLXcdhCqiMw0PRStALWUi5jA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UMcGD7nv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UMcGD7nv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DB69C4CEE7; Mon, 21 Oct 2024 19:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729539641; bh=YqGnen516rN+EubofajlQd3lUU8QoR03dSFjfXuWQwc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UMcGD7nvqzq4n5yWwKuONrV+h6YZFbakQjm3scfe22XEj5VveBRDTzTcK+PonCBQ2 KZBq2ZdfGnyvvmb4lojxaxJNz/3kL7xhjgULK8YaZU9asYsraLAToSkfxzVPkozHT/ xFYPDsrUXMj+RQmov2sAaHqEfeqOye0qxge6RGpE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50042: ice: Fix increasing MSI-X on VF Date: Mon, 21 Oct 2024 21:39:48 +0200 Message-ID: <2024102133-CVE-2024-50042-ca9e@gregkh> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3577; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YqGnen516rN+EubofajlQd3lUU8QoR03dSFjfXuWQwc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlia78qzoqQ8d15Zttt92WtjsmNG9SFsrb9S2t+uujf1 SIuAfuNHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRnrcM8zTfNfO1+B9stFul cS7AbHbrX7c1Lxjml17b6hb4/nnjpdp5HkukVMtfrDRSBQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: ice: Fix increasing MSI-X on VF Increasing MSI-X value on a VF leads to invalid memory operations. This is caused by not reallocating some arrays. Reproducer: modprobe ice echo 0 > /sys/bus/pci/devices/$PF_PCI/sriov_drivers_autoprobe echo 1 > /sys/bus/pci/devices/$PF_PCI/sriov_numvfs echo 17 > /sys/bus/pci/devices/$VF0_PCI/sriov_vf_msix_count Default MSI-X is 16, so 17 and above triggers this issue. KASAN reports: BUG: KASAN: slab-out-of-bounds in ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] Read of size 8 at addr ffff8888b937d180 by task bash/28433 (...) Call Trace: (...) ? ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] kasan_report+0xed/0x120 ? ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_cfg_def+0x3360/0x4770 [ice] ? mutex_unlock+0x83/0xd0 ? __pfx_ice_vsi_cfg_def+0x10/0x10 [ice] ? __pfx_ice_remove_vsi_lkup_fltr+0x10/0x10 [ice] ice_vsi_cfg+0x7f/0x3b0 [ice] ice_vf_reconfig_vsi+0x114/0x210 [ice] ice_sriov_set_msix_vec_count+0x3d0/0x960 [ice] sriov_vf_msix_count_store+0x21c/0x300 (...) Allocated by task 28201: (...) ice_vsi_cfg_def+0x1c8e/0x4770 [ice] ice_vsi_cfg+0x7f/0x3b0 [ice] ice_vsi_setup+0x179/0xa30 [ice] ice_sriov_configure+0xcaa/0x1520 [ice] sriov_numvfs_store+0x212/0x390 (...) To fix it, use ice_vsi_rebuild() instead of ice_vf_reconfig_vsi(). This causes the required arrays to be reallocated taking the new queue count into account (ice_vsi_realloc_stat_arrays()). Set req_txq and req_rxq before ice_vsi_rebuild(), so that realloc uses the newly set queue count. Additionally, ice_vsi_rebuild() does not remove VSI filters (ice_fltr_remove_all()), so ice_vf_init_host_cfg() is no longer necessary. The Linux kernel CVE team has assigned CVE-2024-50042 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 2a2cb4c6c181 and fixed in 6.11.4 with commit cbda61979294 Issue introduced in 6.8 with commit 2a2cb4c6c181 and fixed in 6.12-rc3 with commit bce9af1b030b Issue introduced in 6.7.10 with commit 8910b1cef190 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-50042 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/ethernet/intel/ice/ice_sriov.c drivers/net/ethernet/intel/ice/ice_vf_lib.c drivers/net/ethernet/intel/ice/ice_vf_lib_private.h Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/cbda6197929418fabf0e45ecf9b7a76360944c70 https://git.kernel.org/stable/c/bce9af1b030bf59d51bbabf909a3ef164787e44e