Re: [PATCH v1] j1939: transport: make sure EOMA is send with the total message size set

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

 



On vr, 25 okt 2019 11:36:26 +0200, Oleksij Rempel wrote:
> Hi all,
> 
> i decided to be strict here and drop malformed EOMA packages. At least
> it makes testing easier.
> I have no idea how far is it from reality. Will it brake some thing?
> 
> 
> On Fri, Oct 25, 2019 at 11:30:15AM +0200, Oleksij Rempel wrote:
> > We was sending malformed EOMA with total message size set to 0. So, fix this
> > bug and add sanity check to the RX path.
> > 
...
> > +	if (session->total_message_size != len) {
> > +		netdev_warn(session->priv->ndev, "%s: 0x%p: Incorrect size. Expected: %i; got: %i.\n",
> > +			    __func__, session, session->total_message_size,
> > +			    len);

A warning is usefull here, maybe rate-limited.

> > +		return;

But returning an otherwise complete transfer is rough.
I'm sure verifying this at this stage is unusual.
I'm sure there are little controllers out there that fail here.

Be tolerant on the input and strict on the output, isn't it?

Kind regards,
Kurt 
> > +	}
> > +



[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