linux-stable/drivers
Vladimir Oltean ce6fc76162 net: dsa: sja1105: disallow C45 transactions on the BASE-TX MDIO bus
[ Upstream commit 24deec6b9e ]

You'd think people know that the internal 100BASE-TX PHY on the SJA1110
responds only to clause 22 MDIO transactions, but they don't :)

When a clause 45 transaction is attempted, sja1105_base_tx_mdio_read()
and sja1105_base_tx_mdio_write() don't expect "reg" to contain bit 30
set (MII_ADDR_C45) and pack this value into the SPI transaction buffer.

But the field in the SPI buffer has a width smaller than 30 bits, so we
see this confusing message from the packing() API rather than a proper
rejection of C45 transactions:

Call trace:
 dump_stack+0x1c/0x38
 sja1105_pack+0xbc/0xc0 [sja1105]
 sja1105_xfer+0x114/0x2b0 [sja1105]
 sja1105_xfer_u32+0x44/0xf4 [sja1105]
 sja1105_base_tx_mdio_read+0x44/0x7c [sja1105]
 mdiobus_read+0x44/0x80
 get_phy_c45_ids+0x70/0x234
 get_phy_device+0x68/0x15c
 fwnode_mdiobus_register_phy+0x74/0x240
 of_mdiobus_register+0x13c/0x380
 sja1105_mdiobus_register+0x368/0x490 [sja1105]
 sja1105_setup+0x94/0x119c [sja1105]
Cannot store 401d2405 inside bits 24-4 (would truncate)

Fixes: 5a8f09748e ("net: dsa: sja1105: register the MDIO buses for 100base-T1 and 100base-TX")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-02 17:43:04 +01:00
..
accessibility speakup: replace utils' u_char with unsigned char 2022-11-26 09:27:45 +01:00
acpi ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 2022-12-02 17:43:00 +01:00
amba
android binder: validate alloc->mm in ->mmap() handler 2022-12-02 17:42:59 +01:00
ata ata: libata-core: do not issue non-internal commands once EH is pending 2022-11-26 09:27:33 +01:00
atm
auxdisplay
base
bcma
block drbd: use after free in drbd_create_device() 2022-11-26 09:27:37 +01:00
bluetooth
bus bus: sunxi-rsb: Support atomic transfers 2022-12-02 17:43:03 +01:00
cdrom
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl cxl/pmem: Use size_add() against integer overflow 2022-11-26 09:27:21 +01:00
dax
dca
devfreq
dio
dma dmaengine: at_hdmac: Check return code of dma_async_device_register 2022-11-16 10:04:14 +01:00
dma-buf
edac
eisa
extcon
firewire
firmware firmware: coreboot: Register bus in module init 2022-11-26 09:27:50 +01:00
fpga
fsi
gnss
gpio
gpu drm/amd/display: only fill dirty rectangles when PSR is enabled 2022-12-02 17:43:01 +01:00
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c: i801: add lis3lv02d's I2C address for Vostro 5568 2022-11-26 09:27:19 +01:00
i3c
idle
iio iio: pressure: ms5611: changed hardcoded SPI speed to value limited 2022-11-26 09:27:47 +01:00
infiniband RDMA/efa: Add EFA 0xefa2 PCI ID 2022-11-26 09:27:18 +01:00
input Input: i8042 - fix leaking of platform device on module removal 2022-11-26 09:27:54 +01:00
interconnect
iommu iommu/vt-d: Set SRE bit only when hardware has SRS cap 2022-11-26 09:27:50 +01:00
ipack
irqchip
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-26 09:27:35 +01:00
leds
macintosh
mailbox
mcb
md dm ioctl: fix misbehavior if list_versions races with module loading 2022-11-26 09:27:48 +01:00
media
memory
memstick
message
mfd
misc misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() 2022-11-26 09:27:51 +01:00
mmc mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() 2022-11-26 09:27:50 +01:00
most
mtd mtd: onenand: omap2: add dependency on GPMC 2022-11-26 09:27:28 +01:00
mux
net net: dsa: sja1105: disallow C45 transactions on the BASE-TX MDIO bus 2022-12-02 17:43:04 +01:00
nfc
ntb
nubus
nvdimm
nvme nvmet: fix memory leak in nvmet_subsys_attr_model_store_locked 2022-12-02 17:43:01 +01:00
nvmem
of
opp
parisc
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:27:30 +01:00
pci PCI: hv: Only reuse existing IRTE allocation for Multi-MSI 2022-12-02 17:43:03 +01:00
pcmcia
peci
perf
phy phy: qcom-qmp-combo: fix NULL-deref on runtime resume 2022-11-16 10:04:09 +01:00
pinctrl pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map 2022-11-26 09:27:31 +01:00
platform platform/x86/intel/hid: Add some ACPI device IDs 2022-12-02 17:43:00 +01:00
pnp
power power: supply: ab8500: Defer thermal zone probe 2022-12-02 17:43:02 +01:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: core: fix UAF in destroy_regulator() 2022-12-02 17:43:03 +01:00
remoteproc
reset
rpmsg
rtc
s390 s390/zcrypt: fix warning about field-spanning write 2022-12-02 17:43:00 +01:00
sbus
scsi scsi: storvsc: Fix handling of srb_status and capacity change events 2022-12-02 17:43:02 +01:00
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:27:30 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:27:45 +01:00
soc soc: imx8m: Enable OCOTP clock before reading the register 2022-11-26 09:27:34 +01:00
soundwire
spi spi: tegra210-quad: Fix duplicate resource error 2022-12-02 17:43:03 +01:00
spmi
ssb
staging
target scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-26 09:27:53 +01:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:43:03 +01:00
thermal
thunderbolt
tty serial: 8250_lpss: Use 16B DMA burst with Elkhart Lake 2022-11-26 09:27:48 +01:00
ufs
uio
usb usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler 2022-11-26 09:27:46 +01:00
vdpa
vfio vfio: Split the register_device ops call into functions 2022-11-26 09:27:52 +01:00
vhost
video
virt
virtio
vlynq
w1
watchdog
xen xen/pcpu: fix possible memory leak in register_pcpu() 2022-11-26 09:27:36 +01:00
zorro
Kconfig
Makefile