diff options
author | Ingo Molnar <mingo@kernel.org> | 2024-01-08 12:57:28 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2024-01-08 12:57:28 +0100 |
commit | cdb3033e191fd03da2d7da23b9cd448dfa180a8e (patch) | |
tree | e863d55e63bea2bc9c18652e0d7291fec5e5cd23 /fs/smb/client/misc.c | |
parent | fbb66ce0b1d670c72def736a13ac9176b860df4e (diff) | |
parent | f60a631ab9ed5df15e446269ea515f2b8948ba0c (diff) |
Merge branch 'sched/urgent' into sched/core, to pick up pending v6.7 fixes for the v6.8 merge window
This fix didn't make it upstream in time, pick it up
for the v6.8 merge window.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/smb/client/misc.c')
-rw-r--r-- | fs/smb/client/misc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 35b176457bbe..c2137ea3c253 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -363,6 +363,10 @@ checkSMB(char *buf, unsigned int total_read, struct TCP_Server_Info *server) cifs_dbg(VFS, "Length less than smb header size\n"); } return -EIO; + } else if (total_read < sizeof(*smb) + 2 * smb->WordCount) { + cifs_dbg(VFS, "%s: can't read BCC due to invalid WordCount(%u)\n", + __func__, smb->WordCount); + return -EIO; } /* otherwise, there is enough to get to the BCC */ |