You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
can: j1939: j1939_send_one(): fix missing CAN header initialization
commit3eb3d283e8upstream. The read access to struct canxl_frame::len inside of a j1939 created skbuff revealed a missing initialization of reserved and later filled elements in struct can_frame. This patch initializes the 8 byte CAN header with zero. Fixes:9d71dd0c70("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.kernel.org/linux-can/20221104052235.GA6474@pengutronix.de Reported-by: syzbot+d168ec0caca4697e03b1@syzkaller.appspotmail.com Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/all/20221104075000.105414-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0b692d41ee
commit
f8e0edeaa0
@@ -332,6 +332,9 @@ int j1939_send_one(struct j1939_priv *priv, struct sk_buff *skb)
|
|||||||
/* re-claim the CAN_HDR from the SKB */
|
/* re-claim the CAN_HDR from the SKB */
|
||||||
cf = skb_push(skb, J1939_CAN_HDR);
|
cf = skb_push(skb, J1939_CAN_HDR);
|
||||||
|
|
||||||
|
/* initialize header structure */
|
||||||
|
memset(cf, 0, J1939_CAN_HDR);
|
||||||
|
|
||||||
/* make it a full can frame again */
|
/* make it a full can frame again */
|
||||||
skb_put(skb, J1939_CAN_FTR + (8 - dlc));
|
skb_put(skb, J1939_CAN_FTR + (8 - dlc));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user