lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 29 Apr 2019 09:26:45 -0400
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     David Laight <David.Laight@...lab.com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "ebiederm@...ssion.com" <ebiederm@...ssion.com>,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] packet: in recvmsg msg_name return at least sockaddr_ll

On Mon, Apr 29, 2019 at 9:19 AM David Laight <David.Laight@...lab.com> wrote:
>
> > Can then also change memset to zero only two bytes in the Ethernet case.
> >
> > +                       if (msg->msg_namelen < sizeof(struct sockaddr_ll)) {
> > +                               msg->msg_namelen = sizeof(struct sockaddr_ll);
> > +                               memset(msg->msg_name + copy_len, 0,
> > +                                      msg->namelen - copy_len);
>
> copy_len not defined ....

Was a quick sketch of an iteration on the above, sorry if unclear.
Intended to be defined before the branch.

>
> > +                       }
>
> Except that has to be a real memset() not an inlined direct
> write of an 8byte register (or 2 writes on a 32bit systems).

I wasn't sure whether a 2 byte store would be optimized in a similar
manner. That might even be architecture dependent, I imagine? Will
leave as is.

Thanks for the quick response!



>
>         David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)

Powered by blists - more mailing lists