Re: [lxc-devel] [PATCH] check for data in nla_put() to avoid invalid memcpy() calls

2018-07-29 Thread Rafał Miłecki
On Sun, 29 Jul 2018 at 18:39, Christian Brauner wrote: > On Sun, Jul 29, 2018 at 05:44:06PM +0200, Rafał Miłecki wrote: > > From: Rafał Miłecki > > > > It's a valid case to call nla_put() with NULL data and 0 len. It's done > > e.g. in the nla_put_attr(). > > > > There has to be a check for data

Re: [lxc-devel] [PATCH] check for data in nla_put() to avoid invalid memcpy() calls

2018-07-29 Thread Christian Brauner
On Sun, Jul 29, 2018 at 05:44:06PM +0200, Rafał Miłecki wrote: > From: Rafał Miłecki > > It's a valid case to call nla_put() with NULL data and 0 len. It's done > e.g. in the nla_put_attr(). > > There has to be a check for data in nla_put() as passing NULL to the > memcpy() is not allowed. Even

[lxc-devel] [PATCH] check for data in nla_put() to avoid invalid memcpy() calls

2018-07-29 Thread Rafał Miłecki
From: Rafał Miłecki It's a valid case to call nla_put() with NULL data and 0 len. It's done e.g. in the nla_put_attr(). There has to be a check for data in nla_put() as passing NULL to the memcpy() is not allowed. Even if length is 0, both pointers have to be valid. For a reference see C99 stan