Re: [PATCH 1/1] can: skb: add and set local_origin flag

From: Marc Kleine-Budde
Date: Thu May 12 2022 - 03:58:21 EST


On 12.05.2022 08:23:26, Oliver Hartkopp wrote:
> > > > > BTW: There is a bug with interfaces that don't support IFF_ECHO.
> > > > >
> > > > > Assume an invalid CAN frame is passed to can_send() on an
> > > > > interface that doesn't support IFF_ECHO. The above mentioned
> > > > > code does happily generate an echo frame and it's send, even
> > > > > if the driver drops it, due to can_dropped_invalid_skb(dev,
> > > > > skb).
> > > > >
> > > > > The echoed back CAN frame is treated in raw_rcv() as if the
> > > > > headroom is valid:

> I double checked that code and when I didn't miss anything all the callers
> of can_send() (e.g. raw_sendmsg()) are creating valid skbs.

ACK - I haven't checked, but I assume that all current callers of
can_send() are sound, this I why I started the description with: "Assume
an invalid CAN frame is passed to can_send()". But we can argue that we
trust all callers.

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