]> git.baikalelectronics.ru Git - kernel.git/commit
net: fman: Use physical address for userspace interfaces
authorSean Anderson <sean.anderson@seco.com>
Thu, 20 Oct 2022 15:50:41 +0000 (11:50 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Oct 2022 09:45:14 +0000 (10:45 +0100)
commitb3be8a13fc7d29a6dc94a451b923b97716386a56
tree8b1c8f5f8e37e066d9044ebdca59a54008da214e
parentf1be97c5c9dc44e346e7f5fb47505af3e96d330b
net: fman: Use physical address for userspace interfaces

Before 3ca21d6c3cad ("net: fman: Map the base address once"), the
physical address of the MAC was exposed to userspace in two places: via
sysfs and via SIOCGIFMAP. While this is not best practice, it is an
external ABI which is in use by userspace software.

The aforementioned commit inadvertently modified these addresses and
made them virtual. This constitutes and ABI break.  Additionally, it
leaks the kernel's memory layout to userspace. Partially revert that
commit, reintroducing the resource back into struct mac_device, while
keeping the intended changes (the rework of the address mapping).

Fixes: 3ca21d6c3cad ("net: fman: Map the base address once")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
drivers/net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c
drivers/net/ethernet/freescale/fman/mac.c
drivers/net/ethernet/freescale/fman/mac.h