[ovs-dev] [netlink v4+ 2/3] datapath: Make VERIFY_NUL_STRING verify the string length too.

Jesse Gross jesse at nicira.com
Thu Jan 20 03:20:29 UTC 2011


On Wed, Jan 19, 2011 at 4:22 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Wed, Jan 19, 2011 at 12:19:28PM -0800, Jesse Gross wrote:
>> On Wed, Jan 12, 2011 at 1:23 PM, Ben Pfaff <blp at nicira.com> wrote:
>> > It turns out that just defining NLA_NUL_STRING to an innocuous value is
>> > not sufficient: Linux before 2.6.19 doesn't define a 'len' member in
>> > struct nla_policy at all (it was named 'minlen' and had different
>> > semantics), so attempting to initialize it caused compile errors.
>> >
>> > It's better to use HAVE_NLA_NUL_STRING than a version check because the
>> > Xen 2.6.18 kernels backport NLA_NUL_STRING and the nla_policy changes.
>> >
>> > Grouping things this way also makes it clearer what needs to be deleted
>> > when upstreaming.
>> >
>> > Signed-off-by: Ben Pfaff <blp at nicira.com>
>>
>> Acked-by: Jesse Gross <jesse at nicira.com>
>
> Thanks, I've now stuck appropriate bits of this into other commits and
> moved the remainder just after "datapath: Make VERIFY_NUL_STRING return
> a negative error code."  I'm appending this revised version just for
> completeness.
>
> --8<--------------------------cut here-------------------------->8--
>
> From: Ben Pfaff <blp at nicira.com>
> Date: Wed, 19 Jan 2011 16:16:08 -0800
> Subject: [PATCH] datapath: Make VERIFY_NUL_STRING verify the string length too.
>
> It's better to use HAVE_NLA_NUL_STRING than a version check because the
> Xen 2.6.18 kernels backport NLA_NUL_STRING and the nla_policy changes.
>
> Just defining NLA_NUL_STRING to an innocuous value doesn't work, because
> Linux before 2.6.19 doesn't define a 'len' member in struct nla_policy at
> all (it was named 'minlen' and had different semantics), so attempting to
> initialize it caused compile errors.
>
> Grouping things this way also makes it clearer what needs to be deleted
> when upstreaming.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> Acked-by: Jesse Gross <jesse at nicira.com>

Looks good, thanks.




More information about the dev mailing list