Files
linux-stable-mirror/fs
Sean Heelan 9e9841e232 ksmbd: Fix UAF in __close_file_table_ids
commit 36991c1ccd upstream.

A use-after-free is possible if one thread destroys the file
via __ksmbd_close_fd while another thread holds a reference to
it. The existing checks on fp->refcount are not sufficient to
prevent this.

The fix takes ft->lock around the section which removes the
file from the file table. This prevents two threads acquiring the
same file pointer via __close_file_table_ids, as well as the other
functions which retrieve a file from the IDR and which already use
this same lock.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Heelan <seanheelan@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-18 08:24:47 +02:00
..
2024-10-17 00:28:06 -07:00
2024-12-14 20:04:14 +01:00
2025-04-25 10:47:53 +02:00
2025-02-08 09:56:51 +01:00
2025-01-23 17:22:55 +01:00
2025-04-20 10:15:43 +02:00
2025-03-22 12:54:15 -07:00
2025-05-02 07:59:29 +02:00
2024-12-05 14:02:47 +01:00
2025-01-17 13:40:50 +01:00
2024-09-27 08:18:43 -07:00
2024-09-27 18:29:19 +02:00
2024-09-27 08:18:43 -07:00