devlink: validate length of param values
authorJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2020 05:05:11 +0000 (21:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Mar 2020 21:28:48 +0000 (13:28 -0800)
commit8750939b6ad86abc3f53ec8a9683a1cded4a5654
tree0f6f8c7b5bc96f5a373dbeadb7510674dbd3b0ac
parentab124d580ad40b0666d7892ceccd8c4ac1ce4c79
devlink: validate length of param values

DEVLINK_ATTR_PARAM_VALUE_DATA may have different types
so it's not checked by the normal netlink policy. Make
sure the attribute length is what we expect.

Fixes: e3b7ca18ad7b ("devlink: Add param set command")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c