Re: Question about dev_validate_header used in af_packet.c

2020-09-08 Thread Willem de Bruijn
On Tue, Sep 8, 2020 at 6:23 PM Xie He wrote: > > On Tue, Sep 8, 2020 at 4:53 AM Willem de Bruijn > wrote: > > > > On Tue, Sep 8, 2020 at 1:04 PM Xie He wrote: > > > > > > I was recently looking at some drivers, and I felt that if af_packet.c > > > could help me filter out the invalid RAW frames,

Re: Question about dev_validate_header used in af_packet.c

2020-09-08 Thread Xie He
On Tue, Sep 8, 2020 at 4:53 AM Willem de Bruijn wrote: > > On Tue, Sep 8, 2020 at 1:04 PM Xie He wrote: > > > > I was recently looking at some drivers, and I felt that if af_packet.c > > could help me filter out the invalid RAW frames, I didn't need to > > check the validity of the frames myself

Re: Question about dev_validate_header used in af_packet.c

2020-09-08 Thread Willem de Bruijn
On Tue, Sep 8, 2020 at 1:04 PM Xie He wrote: > > On Tue, Sep 8, 2020 at 1:41 AM Willem de Bruijn > wrote: > > > > The intent is to bypass such validation to be able to test device > > drivers. Note that removing that may cause someone's test to start > > failing. > > > > > So there's no point in

Re: Question about dev_validate_header used in af_packet.c

2020-09-08 Thread Xie He
On Tue, Sep 8, 2020 at 1:41 AM Willem de Bruijn wrote: > > The intent is to bypass such validation to be able to test device > drivers. Note that removing that may cause someone's test to start > failing. > > > So there's no point in > > keeping the ability to test this, either. > > I don't disag

Re: Question about dev_validate_header used in af_packet.c

2020-09-08 Thread Willem de Bruijn
On Mon, Sep 7, 2020 at 11:17 PM Xie He wrote: > > On Mon, Sep 7, 2020 at 2:06 AM Willem de Bruijn > wrote: > > > > The CAP_SYS_RAWIO exception indeed was requested to be able to > > purposely test devices against bad inputs. The gmane link > > unfortunately no longer works, but this was the discu

Re: Question about dev_validate_header used in af_packet.c

2020-09-07 Thread Xie He
On Mon, Sep 7, 2020 at 2:06 AM Willem de Bruijn wrote: > > The CAP_SYS_RAWIO exception indeed was requested to be able to > purposely test devices against bad inputs. The gmane link > unfortunately no longer works, but this was the discussion thread: > https://www.mail-archive.com/netdev@vger.kern

Re: Question about dev_validate_header used in af_packet.c

2020-09-07 Thread Willem de Bruijn
On Sun, Sep 6, 2020 at 1:21 AM Xie He wrote: > > On Sat, Sep 5, 2020 at 3:24 PM Xie He wrote: > > > > Hi Willem, > > > > I have a question about the function dev_validate_header used in > > af_packet.c. Can you help me? Thanks! > > > > I see when the length of the data is smaller than hard_header

Re: Question about dev_validate_header used in af_packet.c

2020-09-05 Thread Xie He
On Sat, Sep 5, 2020 at 3:24 PM Xie He wrote: > > Hi Willem, > > I have a question about the function dev_validate_header used in > af_packet.c. Can you help me? Thanks! > > I see when the length of the data is smaller than hard_header_len, and > when the user is "capable" enough, the function will

Question about dev_validate_header used in af_packet.c

2020-09-05 Thread Xie He
Hi Willem, I have a question about the function dev_validate_header used in af_packet.c. Can you help me? Thanks! I see when the length of the data is smaller than hard_header_len, and when the user is "capable" enough, the function will accept it and pad it with 0s, without validating the header