Subject: CVE-2021-46965: mtd: physmap: physmap-bt1-rom: Fix unintentional stack access

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

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

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

mtd: physmap: physmap-bt1-rom: Fix unintentional stack access

Cast &data to (char *) in order to avoid unintentionally accessing
the stack.

Notice that data is of type u32, so any increment to &data
will be in the order of 4-byte chunks, and this piece of code
is actually intended to be a byte offset.

Addresses-Coverity-ID: 1497765 ("Out-of-bounds access")

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

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

	Issue introduced in 5.10 with commit b3e79e7682e0 and fixed in 5.10.36 with commit 34ec706bf0b7
	Issue introduced in 5.10 with commit b3e79e7682e0 and fixed in 5.11.20 with commit 4e4ebb827bf0
	Issue introduced in 5.10 with commit b3e79e7682e0 and fixed in 5.12.3 with commit 4d786870e326
	Issue introduced in 5.10 with commit b3e79e7682e0 and fixed in 5.13 with commit 683313993dbe

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-46965
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:
	drivers/mtd/maps/physmap-bt1-rom.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/34ec706bf0b7c4ca249a729c1bcb91f706c7a7be
	https://git.kernel.org/stable/c/4e4ebb827bf09311469ffd9d0c14ed40ed9747aa
	https://git.kernel.org/stable/c/4d786870e3262ec098a3b4ed10b895176bc66ecb
	https://git.kernel.org/stable/c/683313993dbe1651c7aa00bb42a041d70e914925