FAILED: patch "[PATCH] smb: client: fix potential OOB in cifs_dump_detail()" failed to apply to 4.19-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x b50492b05fd02887b46aef079592207fb5c97a4c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023122805-dullness-armless-eea7@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
b50492b05fd0 ("smb: client: fix potential OOB in cifs_dump_detail()")38c8a9a52082 ("smb: move client and server files to common directory fs/smb") abdb1742a312 ("cifs: get rid of mount options string parsing")9fd29a5bae6e ("cifs: use fs_context for automounts")68ed14496b03 ("cifs: remove unused server parameter from calc_smb_size()") 5dd8ce24667a ("cifs: missing directory in MAINTAINERS file")332019e23a51 ("Merge tag '5.20-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b50492b05fd02887b46aef079592207fb5c97a4c Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <[email protected]>
Date: Sat, 16 Dec 2023 01:10:04 -0300
Subject: [PATCH] smb: client: fix potential OOB in cifs_dump_detail()
Validate SMB message with ->check_message() before calling ->calc_smb_size().
fs/smb/client/cifs_debug.c +7 -5
@@ -40,11 +40,13 @@ void cifs_dump_detail(void *buf, struct TCP_Server_Info *server)#ifdef CONFIG_CIFS_DEBUG2 struct smb_hdr *smb = buf; -cifs_dbg (VFS ,"Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d\n" , - smb->Command, smb->Status.CifsError, - smb->Flags, smb->Flags2, smb->Mid, smb->Pid); -cifs_dbg (VFS ,"smb buf %p len %u\n" , smb, - server->ops->calc_smb_size (smb)); +cifs_dbg (VFS ,"Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d Wct: %d\n" , + smb->Command, smb->Status.CifsError, smb->Flags, + smb->Flags2, smb->Mid, smb->Pid, smb->WordCount); +if (!server->ops->check_message (buf, server->total_read, server)) { +cifs_dbg (VFS ,"smb buf %p len %u\n" , smb, + server->ops->calc_smb_size (smb)); + }#endif /* CONFIG_CIFS_DEBUG2 */ }