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 2C2F02951D4 for ; Wed, 18 Jun 2025 11:15:02 +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=1750245302; cv=none; b=ktWTjZ3luu4eP7We+DMrXIVHjFgIrdaKfYGstkZXxFfu9dJb8cVMk8I3GrZHBpugrUvxD7FV8X6enyLMlPvHQXqYV/mz/voqUbPlKc55uw0ipdi/N6WtrJTWIaJe9i1lzSSsr8mDYYx2HPZqayYU5E1H2IZ5iEwEvWyC1BnFW0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245302; c=relaxed/simple; bh=YjQnq2QUq6Np/TWHps6WC/f2zhVRwPKpwN4JtMTt6FE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dKS034RsAe11FF6zCVtAACKyiAeyxCP2MZTemRTNz8Iq1YvBtu8qILQnRXJNt5kCKR4mRg8MK5mkyOcE/A2nTcs9iIXAs5Hyn7TlmErOhJxKLooKkEiMZld86z29JzFXjW8R3juAWQ0qrwqjbGoF+Mk6VH6GgxsXeFeQ3UqGiow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WnYJZSaT; 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="WnYJZSaT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C903C4CEE7; Wed, 18 Jun 2025 11:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245302; bh=YjQnq2QUq6Np/TWHps6WC/f2zhVRwPKpwN4JtMTt6FE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WnYJZSaTvH7j96NQiDTei5Qlk0TGsoO8jJhEptugGdMwLWpQzjP90+oowQf6XaeVI FhV58T0MYdXHqczgqu5P3zDf75vKf8qrUvEWfXSDY1/LHF3UXkMv08JB0M3rnFMk5k Wbkpo+M+XT19d4nlUmKVSQafpxZRkQbJYXNUIIgw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50190: spi: Fix simplification of devm_spi_register_controller Date: Wed, 18 Jun 2025 13:04:15 +0200 Message-ID: <2025061836-CVE-2022-50190-5833@gregkh> X-Mailer: git-send-email 2.49.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=2530; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oWoRUf6LKfHc2xUa6cBc/xosdCU8pt8sj+BrFOYzsQg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBcyYod9/Wvjb5T9Jjxq0X2d0LrlZtDZWRd+sU2Vl0S sbnz/sXHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRDc8YFpwrdnf3vdrlenXm Dfts7vDPBYsfiTEsWDO3U83GO9C66I/SvNSH9/a0KaoYAgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: spi: Fix simplification of devm_spi_register_controller This reverts commit 59ebbe40fb51 ("spi: simplify devm_spi_register_controller"). If devm_add_action() fails in devm_add_action_or_reset(), devm_spi_unregister() will be called, it decreases the refcount of 'ctlr->dev' to 0, then it will cause uaf in the drivers that calling spi_put_controller() in error path. The Linux kernel CVE team has assigned CVE-2022-50190 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit 59ebbe40fb51e307032ae7f63b2749fad2d4635a and fixed in 5.15.61 with commit 445fb9c19cf45bd9472fd9babaa31c5e6c7d2720 Issue introduced in 5.13 with commit 59ebbe40fb51e307032ae7f63b2749fad2d4635a and fixed in 5.18.18 with commit 34bab623ebfc08398499e463396b81abb4abe01e Issue introduced in 5.13 with commit 59ebbe40fb51e307032ae7f63b2749fad2d4635a and fixed in 5.19.2 with commit 3c6bd448442b6c3f6843ac70d57201a13478dd47 Issue introduced in 5.13 with commit 59ebbe40fb51e307032ae7f63b2749fad2d4635a and fixed in 6.0 with commit 43cc5a0afe4184a7fafe1eba32b5a11bb69c9ce0 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-50190 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/spi/spi.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/445fb9c19cf45bd9472fd9babaa31c5e6c7d2720 https://git.kernel.org/stable/c/34bab623ebfc08398499e463396b81abb4abe01e https://git.kernel.org/stable/c/3c6bd448442b6c3f6843ac70d57201a13478dd47 https://git.kernel.org/stable/c/43cc5a0afe4184a7fafe1eba32b5a11bb69c9ce0