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 67D042153DD for ; Wed, 26 Feb 2025 02:13:18 +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=1740535998; cv=none; b=U0S7kNgrFnh4xtTUvk0b5hC2K/Ceu0L284OlR2JDl0/XDujYZjwe2vpg1IAJs45rAP2R0VS5qlx2GMr+pPh44YtXrXRTjDwS4J9Kw0v+YxSWQ8NmV85T3RJz96x0ulKSUTySu79tYiQGF9t5MNdH69zsh8r2QlT9kYFl/jCPzLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535998; c=relaxed/simple; bh=vBWlW+/5wB6rR8jvp/TFZXgjV7r+tKXtBO+XBag5zB0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Lpc5a/B6R41hlBV9vL7t7KuQ5ldb9S3y772psJcId5IOVO8H2Br7nrPdpnfSCAhd9k98o3GU0/+WaLy16WXiRubpDE2JJc3e5pZPdGFWeLCmLJSKTZlrKn8Lo45ChDdJOxyzJixRPN+fNd3nM8KjxX5Gz/3gDgXUBcIhJoSF6SE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JeDsCQGy; 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="JeDsCQGy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D931C4CEDD; Wed, 26 Feb 2025 02:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535998; bh=vBWlW+/5wB6rR8jvp/TFZXgjV7r+tKXtBO+XBag5zB0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=JeDsCQGysQ+IlrFJ80ZssCJ6HodLWWfdcJEHPIAZWsmYkMw/5ebcqzRLQmX7TV5ca lltTBqCxuWYVSDLCsLhGhZzQ3YZeh4FZsji0o8YGNVWE3id+/1aMsPjTWM/+pdrcOB AYqejd1u3KzHm6vaRrPC4zfTj0bhfQ76fKe/PX6c= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49353: powerpc/papr_scm: don't requests stats with '0' sized stats buffer Date: Wed, 26 Feb 2025 03:10:27 +0100 Message-ID: <2025022643-CVE-2022-49353-8599@gregkh> X-Mailer: git-send-email 2.48.1 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=3300; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vBWlW+/5wB6rR8jvp/TFZXgjV7r+tKXtBO+XBag5zB0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7yp8z7Ul/zBVx06d8x99loosbI/Y+nHxffq7Xx6ePP 58VqM2X74hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJZJgwLFi16+6S8q7I7Xc4 RESXb9UxvLHWM4dhwTaWtTlvdlfecCt/suC+BSv/7bKwagA= 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: powerpc/papr_scm: don't requests stats with '0' sized stats buffer Sachin reported [1] that on a POWER-10 lpar he is seeing a kernel panic being reported with vPMEM when papr_scm probe is being called. The panic is of the form below and is observed only with following option disabled(profile) for the said LPAR 'Enable Performance Information Collection' in the HMC: Kernel attempted to write user page (1c) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on write at 0x0000001c Faulting instruction address: 0xc008000001b90844 Oops: Kernel access of bad area, sig: 11 [#1] NIP [c008000001b90844] drc_pmem_query_stats+0x5c/0x270 [papr_scm] LR [c008000001b92794] papr_scm_probe+0x2ac/0x6ec [papr_scm] Call Trace: 0xc00000000941bca0 (unreliable) papr_scm_probe+0x2ac/0x6ec [papr_scm] platform_probe+0x98/0x150 really_probe+0xfc/0x510 __driver_probe_device+0x17c/0x230 ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Fatal exception On investigation looks like this panic was caused due to a 'stat_buffer' of size==0 being provided to drc_pmem_query_stats() to fetch all performance stats-ids of an NVDIMM. However drc_pmem_query_stats() shouldn't have been called since the vPMEM NVDIMM doesn't support and performance stat-id's. This was caused due to missing check for 'p->stat_buffer_len' at the beginning of papr_scm_pmu_check_events() which indicates that the NVDIMM doesn't support performance-stats. Fix this by introducing the check for 'p->stat_buffer_len' at the beginning of papr_scm_pmu_check_events(). [1] https://lore.kernel.org/all/6B3A522A-6A5F-4CC9-B268-0C63AA6E07D3@linux.ibm.com The Linux kernel CVE team has assigned CVE-2022-49353 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18.3 with commit b073096df4dec70d0436321b7093bad27ae91f9e and fixed in 5.18.4 with commit e1295aab2ebcda1c1a9ed342baedc080e5c393e5 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-2022-49353 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: arch/powerpc/platforms/pseries/papr_scm.c 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/e1295aab2ebcda1c1a9ed342baedc080e5c393e5 https://git.kernel.org/stable/c/07bf9431b1590d1cd7a8d62075d0b50b073f0495