Re: Sending short raw packets using sendmsg() broke

2016-03-04 Thread Willem de Bruijn
On Fri, Mar 4, 2016 at 11:33 AM, Willem de Bruijn wrote: > On Fri, Mar 4, 2016 at 10:54 AM, Alan Cox wrote: >>> > A quick search for ethhdr in drivers/net/ethernet shows, for >>> > instance, >>> > bnx2x_select_queue casting skb->data to an

Re: Sending short raw packets using sendmsg() broke

2016-03-04 Thread Willem de Bruijn
On Fri, Mar 4, 2016 at 10:54 AM, Alan Cox wrote: >> > A quick search for ethhdr in drivers/net/ethernet shows, for >> > instance, >> > bnx2x_select_queue casting skb->data to an ethernet header. Reading >> > nonsense in that particular function is quite safe and given the >>

Re: Sending short raw packets using sendmsg() broke

2016-03-04 Thread Alan Cox
> > A quick search for ethhdr in drivers/net/ethernet shows, for > > instance, > > bnx2x_select_queue casting skb->data to an ethernet header. Reading > > nonsense in that particular function is quite safe and given the > > skbuff layout (skb_shared_info) code will never read beyond an > >

Re: Sending short raw packets using sendmsg() broke

2016-03-03 Thread Willem de Bruijn
On Thu, Mar 3, 2016 at 11:40 AM, Willem de Bruijn wrote: > On Tue, Mar 1, 2016 at 7:00 PM, Alan Cox wrote: >>> More thorough validation of the header contents is not necessarily >>> hard. The following validates the address, including

Re: Sending short raw packets using sendmsg() broke

2016-03-03 Thread Willem de Bruijn
On Tue, Mar 1, 2016 at 7:00 PM, Alan Cox wrote: >> More thorough validation of the header contents is not necessarily >> hard. The following validates the address, including optional >> repeaters. >> >> static bool ax25_validate_hard_header(const char *ll_header, >>

Re: Sending short raw packets using sendmsg() broke

2016-03-01 Thread Alan Cox
> More thorough validation of the header contents is not necessarily > hard. The following validates the address, including optional > repeaters. > > static bool ax25_validate_hard_header(const char *ll_header, >unsigned short len) > { >

Re: Sending short raw packets using sendmsg() broke

2016-03-01 Thread Alan Cox
On Fri, 2016-02-26 at 12:33 -0500, Willem de Bruijn wrote: > On Fri, Feb 26, 2016 at 9:44 AM, Alan Cox > wrote: > > On Thu, 2016-02-25 at 15:26 -0500, David Miller wrote: > > > From: Heikki Hannikainen > > > Date: Thu, 25 Feb 2016 21:36:07 +0200 (EET) > >

Re: Sending short raw packets using sendmsg() broke

2016-02-27 Thread Willem de Bruijn
On Fri, Feb 26, 2016 at 12:46 PM, David Miller wrote: > From: Willem de Bruijn > Date: Fri, 26 Feb 2016 12:33:13 -0500 > >> Right. The simplest, if hacky, fix is to add something along the lines of >> >> static unsigned short

Re: Sending short raw packets using sendmsg() broke

2016-02-26 Thread David Miller
From: Willem de Bruijn Date: Fri, 26 Feb 2016 12:33:13 -0500 > Right. The simplest, if hacky, fix is to add something along the lines of > > static unsigned short netdev_min_hard_header_len(struct net_device *dev) > { > if (unlikely(dev->type

Re: Sending short raw packets using sendmsg() broke

2016-02-26 Thread David Miller
From: Alan Cox Date: Fri, 26 Feb 2016 14:44:34 + > On Thu, 2016-02-25 at 15:26 -0500, David Miller wrote: >> From: Heikki Hannikainen >> Date: Thu, 25 Feb 2016 21:36:07 +0200 (EET) >> >> > Commit 9c7077622dd9174 added a check, ll_header_truncated(),

Re: Sending short raw packets using sendmsg() broke

2016-02-26 Thread Willem de Bruijn
On Fri, Feb 26, 2016 at 9:44 AM, Alan Cox wrote: > On Thu, 2016-02-25 at 15:26 -0500, David Miller wrote: >> From: Heikki Hannikainen >> Date: Thu, 25 Feb 2016 21:36:07 +0200 (EET) >> >> > Commit 9c7077622dd9174 added a check, ll_header_truncated(), which

Re: Sending short raw packets using sendmsg() broke

2016-02-26 Thread Alan Cox
On Thu, 2016-02-25 at 15:26 -0500, David Miller wrote: > From: Heikki Hannikainen > Date: Thu, 25 Feb 2016 21:36:07 +0200 (EET) > > > Commit 9c7077622dd9174 added a check, ll_header_truncated(), which > > requires that a packet transmitted using sendmsg() with PF_PACKET, > >

Re: Sending short raw packets using sendmsg() broke

2016-02-25 Thread Willem de Bruijn
> Commit 9c7077622dd9174 added a check, ll_header_truncated(), which requires > that a packet transmitted using sendmsg() with PF_PACKET, SOCK_RAW must be > longer than dev->hard_header_len. > > https://github.com/torvalds/linux/commit/9c7077622dd9174 >

Re: Sending short raw packets using sendmsg() broke

2016-02-25 Thread David Miller
From: Heikki Hannikainen Date: Thu, 25 Feb 2016 21:36:07 +0200 (EET) > Commit 9c7077622dd9174 added a check, ll_header_truncated(), which > requires that a packet transmitted using sendmsg() with PF_PACKET, > SOCK_RAW must be longer than dev->hard_header_len. Fixed by: commit

Sending short raw packets using sendmsg() broke

2016-02-25 Thread Heikki Hannikainen
Hi, Commit 9c7077622dd9174 added a check, ll_header_truncated(), which requires that a packet transmitted using sendmsg() with PF_PACKET, SOCK_RAW must be longer than dev->hard_header_len. https://github.com/torvalds/linux/commit/9c7077622dd9174