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 174231A3161 for ; Wed, 26 Feb 2025 01:57:48 +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=1740535068; cv=none; b=H7r9W0yyJ5pEttupIEcXQnM8hIK08lX1HXIrjT84OnID9OoV+HGQsUY3zJw6hIhQvLM0uNjQ4NbwXiDr2Vp8CdZvGmFx34yLiBWJgcB70SYiX0OHB5boGb5u9KloF2zhdkLbbBnJj95MFI8XNQKjA0OoL80ztQILgyKfv2CYW4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535068; c=relaxed/simple; bh=6Fx9BOI7RoQoaU6LOy6T6mo7EGhWwRcwmPTtKiB5mpM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HvIj409GQLi46MB2ZyNv6e72fipkx8vayl8NxNiwqXm5btBEe+Y8IomfRS6cAhua+s6V+lnJLnIiw/+/yR80qPcb4HrB+svlgJQLypmlZLsps63t6P5NZEm3uIh3Q/nqXEClYzHUWOzmiQuYNHB4LF08ZAoWwYT3xSjHmV0FmoY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lZHy/eoz; 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="lZHy/eoz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E00A3C4CEE6; Wed, 26 Feb 2025 01:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535068; bh=6Fx9BOI7RoQoaU6LOy6T6mo7EGhWwRcwmPTtKiB5mpM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=lZHy/eozOmxW7VfFHj60aQ+gFS0/xZPdut6kRyolRfxUCBIMXG2b+8fJL1wqetAYC jsUnpI8sz6G1FdjI8JUTnsJ2MYS3p0RHt1780tFd+0u9hbqALXfYZOfysG+PqbLM0/ OGhf7+tFQEQeVlRFMiqULA+V4G7v2BYcG+5lE45Q= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49062: cachefiles: Fix KASAN slab-out-of-bounds in cachefiles_set_volume_xattr Date: Wed, 26 Feb 2025 02:54:27 +0100 Message-ID: <2025022653-CVE-2022-49062-ec51@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=4500; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=6Fx9BOI7RoQoaU6LOy6T6mo7EGhWwRcwmPTtKiB5mpM=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SgxtmJTrFMydJ02Ok1tQdGnT4du9qywX5MZWqGvll ecuPGjaEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABdZwDC/1HXr3BOL8xZd2RVY /vVa0us2+afsDPMzmXy2Z+RP7jB4v6b+S/HE05wZ+xkA 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: cachefiles: Fix KASAN slab-out-of-bounds in cachefiles_set_volume_xattr Use the actual length of volume coherency data when setting the xattr to avoid the following KASAN report. BUG: KASAN: slab-out-of-bounds in cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] Write of size 4 at addr ffff888101e02af4 by task kworker/6:0/1347 CPU: 6 PID: 1347 Comm: kworker/6:0 Kdump: loaded Not tainted 5.18.0-rc1-nfs-fscache-netfs+ #13 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-4.fc34 04/01/2014 Workqueue: events fscache_create_volume_work [fscache] Call Trace: dump_stack_lvl+0x45/0x5a print_report.cold+0x5e/0x5db ? __lock_text_start+0x8/0x8 ? cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] kasan_report+0xab/0x120 ? cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] kasan_check_range+0xf5/0x1d0 memcpy+0x39/0x60 cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] cachefiles_acquire_volume+0x2be/0x500 [cachefiles] ? __cachefiles_free_volume+0x90/0x90 [cachefiles] fscache_create_volume_work+0x68/0x160 [fscache] process_one_work+0x3b7/0x6a0 worker_thread+0x2c4/0x650 ? process_one_work+0x6a0/0x6a0 kthread+0x16c/0x1a0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Allocated by task 1347: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 cachefiles_set_volume_xattr+0x76/0x350 [cachefiles] cachefiles_acquire_volume+0x2be/0x500 [cachefiles] fscache_create_volume_work+0x68/0x160 [fscache] process_one_work+0x3b7/0x6a0 worker_thread+0x2c4/0x650 kthread+0x16c/0x1a0 ret_from_fork+0x22/0x30 The buggy address belongs to the object at ffff888101e02af0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes inside of 8-byte region [ffff888101e02af0, ffff888101e02af8) The buggy address belongs to the physical page: page:00000000a2292d70 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e02 flags: 0x17ffffc0000200(slab|node=0|zone=2|lastcpupid=0x1fffff) raw: 0017ffffc0000200 0000000000000000 dead000000000001 ffff888100042280 raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888101e02980: fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc ffff888101e02a00: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 >ffff888101e02a80: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 04 fc ^ ffff888101e02b00: fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc ffff888101e02b80: fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc ================================================================== The Linux kernel CVE team has assigned CVE-2022-49062 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 413a4a6b0b5553f2423d210f65e98c211b99c3f8 and fixed in 5.17.4 with commit 09a5df1b88c8f126c8ff9938edf160edd4e92f42 Issue introduced in 5.17 with commit 413a4a6b0b5553f2423d210f65e98c211b99c3f8 and fixed in 5.18 with commit 7b2f6c306601240635c72caa61f682e74d4591b2 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-49062 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: fs/cachefiles/xattr.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/09a5df1b88c8f126c8ff9938edf160edd4e92f42 https://git.kernel.org/stable/c/7b2f6c306601240635c72caa61f682e74d4591b2