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 CFE201C831A for ; Wed, 15 Jan 2025 13:06:40 +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=1736946400; cv=none; b=MoL0iJeok5PObdE1F9mUl9GELRZ1XqezlZfEqeT+hBfkwKFQns8haGvimL5CzmEx/4bJCdqHD7Zr7sMMde0EmYSJKBL/e+y0Z997pBLQyh0b1BD3raLqoX1BWkJrkvGTfOcYDvUrzqYQSUmMHd6hgz3WS7EKHzEIXzofkU5srRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736946400; c=relaxed/simple; bh=s0NwS8qQcOv8+Fbq67OO+x3GQq2Jvv5xw7nZus/CjUE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d6PbbC0E9mH9dn+W+GsFvShMIdDikCMTs5DvMZMM9X71QAZ8S/xvOk9IbBN9vje5qQhPxyTdH34CEsIu4QiFRXFILOZmCu4FBkdsvUbkCExScDA0po0JPg7qZMvmPdKx6aKjNl0g7KMwzRO41bVVkFnBlXSUtDMcFIveRp/oPwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sGxitAwj; 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="sGxitAwj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0200DC4CEDF; Wed, 15 Jan 2025 13:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736946400; bh=s0NwS8qQcOv8+Fbq67OO+x3GQq2Jvv5xw7nZus/CjUE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sGxitAwjtG+0mNcv98HpXAiWd1HI+S2Tve2EScD4nm9afjirlKoqocrwkhmbKWuMt ac2LVc6cbecyrV0r3wzKWrStE+e3rDwF34BUwTu86XZobNfubni7zbHXRFbEZp2g2Y lSdpYhxrzlx0LuhtXKhL1OWmmTyhvS1OIXVJkcvA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57895: ksmbd: set ATTR_CTIME flags when setting mtime Date: Wed, 15 Jan 2025 14:06:18 +0100 Message-ID: <2025011514-CVE-2024-57895-9034@gregkh> X-Mailer: git-send-email 2.48.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=4768; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=s0NwS8qQcOv8+Fbq67OO+x3GQq2Jvv5xw7nZus/CjUE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOntm44xNa0u7F6q6u2hu8z+eMujvc9avhUwGZ1+9TH04 ev5Qu/FOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiUl0MCyYY626aduX/6svZ t3vCVK6WHzBP5mVY0LHdL9D9/+nbs19VfVDLecX1PWcCMwA= 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: ksmbd: set ATTR_CTIME flags when setting mtime David reported that the new warning from setattr_copy_mgtime is coming like the following. [ 113.215316] ------------[ cut here ]------------ [ 113.215974] WARNING: CPU: 1 PID: 31 at fs/attr.c:300 setattr_copy+0x1ee/0x200 [ 113.219192] CPU: 1 UID: 0 PID: 31 Comm: kworker/1:1 Not tainted 6.13.0-rc1+ #234 [ 113.220127] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 [ 113.221530] Workqueue: ksmbd-io handle_ksmbd_work [ksmbd] [ 113.222220] RIP: 0010:setattr_copy+0x1ee/0x200 [ 113.222833] Code: 24 28 49 8b 44 24 30 48 89 53 58 89 43 6c 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc 48 89 df e8 77 d6 ff ff e9 cd fe ff ff <0f> 0b e9 be fe ff ff 66 0 [ 113.225110] RSP: 0018:ffffaf218010fb68 EFLAGS: 00010202 [ 113.225765] RAX: 0000000000000120 RBX: ffffa446815f8568 RCX: 0000000000000003 [ 113.226667] RDX: ffffaf218010fd38 RSI: ffffa446815f8568 RDI: ffffffff94eb03a0 [ 113.227531] RBP: ffffaf218010fb90 R08: 0000001a251e217d R09: 00000000675259fa [ 113.228426] R10: 0000000002ba8a6d R11: ffffa4468196c7a8 R12: ffffaf218010fd38 [ 113.229304] R13: 0000000000000120 R14: ffffffff94eb03a0 R15: 0000000000000000 [ 113.230210] FS: 0000000000000000(0000) GS:ffffa44739d00000(0000) knlGS:0000000000000000 [ 113.231215] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 113.232055] CR2: 00007efe0053d27e CR3: 000000000331a000 CR4: 00000000000006b0 [ 113.232926] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 113.233812] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 113.234797] Call Trace: [ 113.235116] [ 113.235393] ? __warn+0x73/0xd0 [ 113.235802] ? setattr_copy+0x1ee/0x200 [ 113.236299] ? report_bug+0xf3/0x1e0 [ 113.236757] ? handle_bug+0x4d/0x90 [ 113.237202] ? exc_invalid_op+0x13/0x60 [ 113.237689] ? asm_exc_invalid_op+0x16/0x20 [ 113.238185] ? setattr_copy+0x1ee/0x200 [ 113.238692] btrfs_setattr+0x80/0x820 [btrfs] [ 113.239285] ? get_stack_info_noinstr+0x12/0xf0 [ 113.239857] ? __module_address+0x22/0xa0 [ 113.240368] ? handle_ksmbd_work+0x6e/0x460 [ksmbd] [ 113.240993] ? __module_text_address+0x9/0x50 [ 113.241545] ? __module_address+0x22/0xa0 [ 113.242033] ? unwind_next_frame+0x10e/0x920 [ 113.242600] ? __pfx_stack_trace_consume_entry+0x10/0x10 [ 113.243268] notify_change+0x2c2/0x4e0 [ 113.243746] ? stack_depot_save_flags+0x27/0x730 [ 113.244339] ? set_file_basic_info+0x130/0x2b0 [ksmbd] [ 113.244993] set_file_basic_info+0x130/0x2b0 [ksmbd] [ 113.245613] ? process_scheduled_works+0xbe/0x310 [ 113.246181] ? worker_thread+0x100/0x240 [ 113.246696] ? kthread+0xc8/0x100 [ 113.247126] ? ret_from_fork+0x2b/0x40 [ 113.247606] ? ret_from_fork_asm+0x1a/0x30 [ 113.248132] smb2_set_info+0x63f/0xa70 [ksmbd] ksmbd is trying to set the atime and mtime via notify_change without also setting the ctime. so This patch add ATTR_CTIME flags when setting mtime to avoid a warning. The Linux kernel CVE team has assigned CVE-2024-57895 to this issue. Affected and fixed versions =========================== Fixed in 6.6.70 with commit 1d7ee876b8b96efc14e177a7fe8d45ac25d68849 Fixed in 6.12.9 with commit 52cefcff6a4a814f4f8e357422fcfb71fd2ebf75 Fixed in 6.13-rc3 with commit 21e46a79bbe6c4e1aa73b3ed998130f2ff07b128 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-57895 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/smb/server/smb2pdu.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/1d7ee876b8b96efc14e177a7fe8d45ac25d68849 https://git.kernel.org/stable/c/52cefcff6a4a814f4f8e357422fcfb71fd2ebf75 https://git.kernel.org/stable/c/21e46a79bbe6c4e1aa73b3ed998130f2ff07b128