1
0
Fork 0
alistair23-linux/drivers/net/can
Uwe Kleine-König a55234dabe can: flexcan: fix NULL pointer exception during bringup
Commit cbffaf7aa0 ("can: flexcan: Always use last mailbox for TX")
introduced a loop letting i run up to (including) ARRAY_SIZE(regs->mb)
and in the body accessed regs->mb[i] which is an out-of-bounds array
access that then resulted in an access to an reserved register area.

Later this was changed by commit 0517961ccd ("can: flexcan: Add
provision for variable payload size") to iterate a bit differently but
still runs one iteration too much resulting to call

	flexcan_get_mb(priv, priv->mb_count)

which results in a WARN_ON and then a NULL pointer exception. This
only affects devices compatible with "fsl,p1010-flexcan",
"fsl,imx53-flexcan", "fsl,imx35-flexcan", "fsl,imx25-flexcan",
"fsl,imx28-flexcan", so newer i.MX SoCs are not affected.

Fixes: cbffaf7aa0 ("can: flexcan: Always use last mailbox for TX")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: linux-stable <stable@vger.kernel.org> # >= 4.20
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-01-22 11:35:33 +01:00
..
c_can
cc770 can: cc770: fix spelling mistake: "comptibility" -> "compatibility" 2018-07-27 10:40:16 +02:00
ifi_canfd
m_can can: m_can: Move accessing of message ram to after clocks are enabled 2018-07-23 14:34:45 +02:00
mscan can: mpc5xxx_can: check of_iomap return before use 2018-07-23 14:34:45 +02:00
peak_canfd can: peak_canfd: rearrange the way resources are released 2018-07-27 10:40:18 +02:00
rcar can: rcar: add SPDX identifiers to Kconfig and Makefile 2018-11-28 16:19:53 +01:00
sja1000 can: sja1000: plx_pci: add support for ASEM CAN raw device 2018-11-28 16:19:53 +01:00
softing
spi can: hi311x: Use level-triggered interrupt 2018-11-09 17:20:08 +01:00
usb can: ucan: fix spelling mistake: "resumbmitting" -> "resubmitting" 2018-11-28 16:19:52 +01:00
Kconfig can: flexcan: enable flexcan for all architectures 2018-11-28 16:19:53 +01:00
Makefile
at91_can.c
dev.c can: dev: __can_get_echo_skb(): fix bogous check for non-existing skb by removing it 2019-01-22 11:18:34 +01:00
flexcan.c can: flexcan: fix NULL pointer exception during bringup 2019-01-22 11:35:33 +01:00
grcan.c
janz-ican3.c can: janz-ican3: fix ican3_xmit()'s return type 2018-07-27 10:40:16 +02:00
led.c
pch_can.c
rx-offload.c can: rx-offload: rename can_rx_offload_irq_queue_err_skb() to can_rx_offload_queue_tail() 2018-11-09 17:33:32 +01:00
slcan.c
sun4i_can.c can: sun4i: fix sun4ican_start_xmit()'s return type 2018-07-27 10:40:16 +02:00
ti_hecc.c
vcan.c
vxcan.c net: Add extack argument to rtnl_create_link 2018-11-06 15:00:45 -08:00
xilinx_can.c can: xilinx: add can 2.0 support 2018-11-28 16:19:52 +01:00