]> git.baikalelectronics.ru Git - kernel.git/commit
can: isotp: tx-path: zero initialize outgoing CAN frames
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 19 Mar 2021 10:06:19 +0000 (11:06 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 20 Mar 2021 19:21:35 +0000 (20:21 +0100)
commit0317d1f28cf968ff4ae66efe3a90f49336211cd5
treec114ed8cc2b3c8760a6f5900d14c243c6956370b
parenta608735790b3d240bf844d608d18000f44ae2a40
can: isotp: tx-path: zero initialize outgoing CAN frames

Commit 1e9d9a0b5b1c ("can: isotp: TX-path: ensure that CAN frame flags are
initialized") ensured the TX flags to be properly set for outgoing CAN
frames.

In fact the root cause of the issue results from a missing initialization
of outgoing CAN frames created by isotp. This is no problem on the CAN bus
as the CAN driver only picks the correctly defined content from the struct
can(fd)_frame. But when the outgoing frames are monitored (e.g. with
candump) we potentially leak some bytes in the unused content of
struct can(fd)_frame.

Fixes: 28da5a05c8c3 ("can: add ISO 15765-2:2016 transport protocol")
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/r/20210319100619.10858-1-socketcan@hartkopp.net
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/isotp.c