Re: [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check

From: Lin Ma
Date: Sun Jul 23 2023 - 05:49:00 EST



> Sure, that is another undergoing task I'm working on. If the nlattr is parsed with
> NL_VALIDATE_UNSPEC, any forgotten nlattr will be rejected, therefore (which is the default
> for modern nla_parse).

For the general netlink interface, the deciding flag should be genl_ops.validate defined in
each ops. The default validate flag is strict, while the developer can overwrite the flag
with GENL_DONT_VALIDATE_STRICT to ease the validation. That is to say, safer code should
enforce NL_VALIDATE_STRICT by not overwriting the validate flag.

Regrads
Lin