]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: fix potential use-after-free in cifs_echo_request()
authorPaulo Alcantara <pc@cjr.nz>
Sat, 28 Nov 2020 19:54:02 +0000 (16:54 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Dec 2020 12:22:06 +0000 (13:22 +0100)
commit08a257a3ff0c3947b5d8de06588a148d2ec2bcc2
treefa4b3746a5617cc9d8dacf6e6748b17fb0e024ab
parent60729f2188ec6df45461451a4cf5a109d2cc1173
cifs: fix potential use-after-free in cifs_echo_request()

commit 212253367dc7b49ed3fc194ce71b0992eacaecf2 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/connect.c