devlink: validate length of param values
authorJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2020 05:05:11 +0000 (21:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:17:43 +0000 (07:17 +0100)
commit4136c4ee4159df8cb8e78a1cb583ba0b709696c2
treed68a734f8464db577af1433e569c0d2588afd0cb
parentc0a7416a5403df10136a74d9b52a84b0f2471272
devlink: validate length of param values

[ Upstream commit 8750939b6ad86abc3f53ec8a9683a1cded4a5654 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/devlink.c