]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:24 +0000 (14:30 +0200)
commit22e4f2bfc1d20f265976b95fe38e2bebef6b9965
treeca09f27c2dd81376c7e7f1879e459a51cad3412a
parent5f8cad9fb1f36beacbdaaeb9f3d6e36d8e04100d
can: isotp: tx-path: zero initialize outgoing CAN frames

[ Upstream commit b5f020f82a8e41201c6ede20fa00389d6980b223 ]

Commit d4eb538e1f48 ("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: e057dd3fc20f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/can/isotp.c