]> Git Repo - linux.git/commit - net/netlink/policy.c
netlink: policy: correct validation type check
authorJohannes Berg <[email protected]>
Mon, 31 Aug 2020 18:28:05 +0000 (20:28 +0200)
committerDavid S. Miller <[email protected]>
Mon, 31 Aug 2020 19:01:15 +0000 (12:01 -0700)
commitc30a3c957c885e618ddffc065f888be4f8d5a9bd
treee8e271fe566350c071dc5563bd3a819b7cf9ac7c
parent0f091e43310f5c292b7094f9f115e651358e8053
netlink: policy: correct validation type check

In the policy export for binary attributes I erroneously used
a != NLA_VALIDATE_NONE comparison instead of checking for the
two possible values, which meant that if a validation function
pointer ended up aliasing the min/max as negatives, we'd hit
a warning in nla_get_range_unsigned().

Fix this to correctly check for only the two types that should
be handled here, i.e. range with or without warn-too-long.

Reported-by: [email protected]
Fixes: 8aa26c575fb3 ("netlink: make NLA_BINARY validation more flexible")
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/netlink/policy.c
This page took 0.051181 seconds and 4 git commands to generate.