Subject: CVE-2021-47307: cifs: prevent NULL deref in cifs_compose_mount_options()

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

cifs: prevent NULL deref in cifs_compose_mount_options()

The optional @ref parameter might contain an NULL node_name, so
prevent dereferencing it in cifs_compose_mount_options().

Addresses-Coverity: 1476408 ("Explicit null dereferenced")

The Linux kernel CVE team has assigned CVE-2021-47307 to this issue.

Affected and fixed versions
===========================

	Fixed in 5.4.135 with commit f7d1fa65e742
	Fixed in 5.10.53 with commit e58c162789be
	Fixed in 5.13.5 with commit ae3d181f4e91
	Fixed in 5.14 with commit 03313d1c3a2f

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2021-47307
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	fs/cifs/cifs_dfs_ref.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/f7d1fa65e74263d11f90ddd33b4d4cd905a93759
	https://git.kernel.org/stable/c/e58c162789becede894d3e94c0ce6695a2ef5796
	https://git.kernel.org/stable/c/ae3d181f4e912f51af7776ea165f199b16fc165d
	https://git.kernel.org/stable/c/03313d1c3a2f086bb60920607ab79ac8f8578306