]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmem: imx-ocotp: fix MAC address byte length
authorSteffen Bätz <steffen@innosonix.de>
Sat, 12 Jul 2025 18:17:27 +0000 (19:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:53:11 +0000 (08:53 +0200)
commit0f6f30f5b01ac249e5efe4ce7b0b67871a0274f1
tree4270be1bd732eecd7f4d3ebd0002d84498764d3c
parent0cd051cb5852c340755db676dc25cb8e9b7e2e41
nvmem: imx-ocotp: fix MAC address byte length

commit 2aa4ad626ee7f817a8f4715a47b318cfdc1714c9 upstream.

The commit "13bcd440f2ff nvmem: core: verify cell's raw_len" caused an
extension of the "mac-address" cell from 6 to 8 bytes due to word_size
of 4 bytes. This led to a required byte swap of the full buffer length,
which caused truncation of the mac-address when read.

Previously, the mac-address was incorrectly truncated from
70:B3:D5:14:E9:0E to 00:00:70:B3:D5:14.

Fix the issue by swapping only the first 6 bytes to correctly pass the
mac-address to the upper layers.

Fixes: 13bcd440f2ff ("nvmem: core: verify cell's raw_len")
Cc: stable@vger.kernel.org
Signed-off-by: Steffen Bätz <steffen@innosonix.de>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://lore.kernel.org/r/20250712181729.6495-3-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/imx-ocotp-ele.c
drivers/nvmem/imx-ocotp.c