]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
cifs: check rsp for NULL before dereferencing in SMB2_open
authorRonnie Sahlberg <lsahlber@redhat.com>
Fri, 8 Sep 2017 00:37:35 +0000 (10:37 +1000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:19:57 +0000 (16:19 -0500)
commit7da7c95876c2337956f047d420fa2672fe344e5d
treeccb9d01e344cfff9d42eb80619085c3f9bd9fc86
parent860159cf043db66bd9ae780ad1bb026390af8dc6
cifs: check rsp for NULL before dereferencing in SMB2_open

BugLink: http://bugs.launchpad.net/bugs/1721777
commit bf2afee14e07de16d3cafc67edbfc2a3cc65e4bc upstream.

In SMB2_open there are several paths where the SendReceive2
call will return an error before it sets rsp_iov.iov_base
thus leaving iov_base uninitialized.

Thus we need to check rsp before we dereference it in
the call to get_rfc1002_length().

A report of this issue was previously reported in
http://www.spinics.net/lists/linux-cifs/msg12846.html

RH-bugzilla : 1476151

Version 2 :
* Lets properly initialize rsp_iov before we use it.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/cifs/smb2pdu.c