Re: [PATCH] can: isotp: tx-path: zero initialize outgoing CAN frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18.03.2021 11:02:33, Oliver Hartkopp wrote:
> 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@xxxxxxxxxxxxxx>
> Signed-off-by: Oliver Hartkopp <socketcan@xxxxxxxxxxxx>

What about skb_put_zero(), which I mentioned in my initial cover letter:

>> Note here the "B" and "E" flags are set. Another possibility is to use
>> skb_put_zero() instead of skb_put(), but with a bigger overhead. A 3.
>> option is to only memset() the non-data part of the struct canfd_frame.

http://lore.kernel.org/r/20210218215434.1708249-1-mkl@xxxxxxxxxxxxxx

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux