Re: [PATCH 1/1] NET: llc, zero sockaddr_llc struct

From: Arnaldo Carvalho de Melo
Date: Sun Aug 23 2009 - 22:20:40 EST


Em Sun, Aug 23, 2009 at 06:56:17PM -0700, David Miller escreveu:
> From: Jiri Slaby <jirislaby@xxxxxxxxx>
> Date: Sat, 22 Aug 2009 20:58:55 +0200
>
> > sllc_arphrd member of sockaddr_llc might not be set. Zero sllc
> > before copying it to the above layers.
> >
> > Signed-off-by: Jiri Slaby <jirislaby@xxxxxxxxx>
> > Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxxxx>
>
> I know it seems arbitrary, but could you please memset() on the
> structure instead of using an empty initializer so that it's
> consistent with how all other ->getname() implementations deal with
> this issue?
>
> It's easier to audit that way.

Or just set the uninitialized field to zero. But yeah, if what other
implementations are doing is to memset it to zero... maybe its more
clear from a quick glance :-)

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/