[lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure
Serge Hallyn
serge.hallyn at ubuntu.com
Fri May 3 17:23:29 UTC 2013
Quoting Dwight Engen (dwight.engen at oracle.com):
> On Fri, 3 May 2013 11:17:08 -0500
> Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
>
> > can that be correct? That changes the value of the
> > pointer. NLMSG_DATA adds aligned sizeof(struct nlmsghdr).
>
> The current code is relying on the fact that our genlmsg looks like
> this:
>
> struct genlmsg {
> struct nlmsghdr nlmsghdr;
> struct genlmsghdr genlmsghdr;
> };
>
> so NLMSG_DATA(&request->nlmsghdr) == genlmsghdr (I think sizeof struct
> nlmsghdr will make genlmsghdr be aligned anyway?). Right now lxc doesn't
> use this code so I cannot test it in lxc, but let me write a test
> program that dumps the pointers using the old way and the new way. We
> do have a 2*PAGE_SIZE buffer these point to so I'm sure its not
> overflowing, so maybe we do just want to ignore coverity.
Thanks, I'll go ahead and apply the rest and hold off on this one.
More information about the lxc-devel
mailing list