Files
linux/fs
Ronnie Sahlberg b4d965a37d cifs: allow calling SMB2_xxx_free(NULL)
commit 32a1fb36f6 upstream.

Change these free functions to allow passing NULL as the argument and
treat it as a no-op just like free(NULL) would.
Or, if rqst->rq_iov is NULL.

The second scenario could happen for smb2_queryfs() if the call
to SMB2_query_info_init() fails and we go to qfs_exit to clean up
and free all resources.
In that case we have not yet assigned rqst[2].rq_iov and thus
the rq_iov dereference in SMB2_close_free() will cause a NULL pointer
dereference.

[ bp: upstream patch also fixes SMB2_set_info_free which was introduced in 4.20 ]

Fixes:  1eb9fb5204 ("cifs: create SMB2_open_init()/SMB2_open_free() helpers")

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-13 14:02:40 -07:00
..
2018-11-13 11:08:46 -08:00
2018-08-21 23:54:17 -04:00
2018-12-05 19:32:11 +01:00
2018-12-17 09:24:41 +01:00
2018-08-17 16:20:28 -07:00
2018-05-22 14:27:52 -04:00
2018-08-17 16:20:27 -07:00
2019-02-12 19:47:18 +01:00
2019-03-13 14:02:32 -07:00
2018-05-22 14:27:52 -04:00
2019-02-12 19:47:09 +01:00
2019-03-10 07:17:21 +01:00
2018-07-03 16:44:45 -04:00
2018-06-05 19:23:26 +02:00
2019-03-10 07:17:21 +01:00
2018-06-11 08:22:34 -07:00