Skip to content
Commit c30a3c95 authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller
Browse files

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: default avatar <syzbot+353df1490da781637624@syzkaller.appspotmail.com>
Fixes: 8aa26c57

 ("netlink: make NLA_BINARY validation more flexible")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f091e43
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment