summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@cjr.nz>2020-11-28 16:54:02 -0300
committerSteve French <stfrench@microsoft.com>2020-11-30 15:23:45 -0600
commit212253367dc7b49ed3fc194ce71b0992eacaecf2 (patch)
treef70fc65d0b8eda01cf1c7d37b2bf212840cd4096 /fs/cifs
parent6988a619f5b79e4efadea6e19dcfe75fbcd350b5 (diff)
downloadlinux-stable-212253367dc7b49ed3fc194ce71b0992eacaecf2.tar.gz
linux-stable-212253367dc7b49ed3fc194ce71b0992eacaecf2.tar.bz2
linux-stable-212253367dc7b49ed3fc194ce71b0992eacaecf2.zip
cifs: fix potential use-after-free in cifs_echo_request()
This patch fixes a potential use-after-free bug in cifs_echo_request(). For instance, thread 1 -------- cifs_demultiplex_thread() clean_demultiplex_info() kfree(server) thread 2 (workqueue) -------- apic_timer_interrupt() smp_apic_timer_interrupt() irq_exit() __do_softirq() run_timer_softirq() call_timer_fn() cifs_echo_request() <- use-after-free in server ptr Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> CC: Stable <stable@vger.kernel.org> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index c38156f324dd..28c1459fb0fc 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -876,6 +876,8 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
list_del_init(&server->tcp_ses_list);
spin_unlock(&cifs_tcp_ses_lock);
+ cancel_delayed_work_sync(&server->echo);
+
spin_lock(&GlobalMid_Lock);
server->tcpStatus = CifsExiting;
spin_unlock(&GlobalMid_Lock);