cfg80211-wext: return -E2BIG when buffer can't hold full BSS entry
authorJames Minor <james.minor@ni.com>
Tue, 24 Feb 2015 18:58:20 +0000 (12:58 -0600)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 28 Feb 2015 20:31:12 +0000 (21:31 +0100)
commit76a70e9c4b45fc1dbcbff6f7ae88ac7e1ddfb677
tree1f23e9cf5066d66b207484ff6839a8e53fa6c70f
parent36ef906ee8fefbfac3844206e66d8450e6221c69
cfg80211-wext: return -E2BIG when buffer can't hold full BSS entry

When using the wext compatibility code in cfg80211, part of the IEs
can be truncated if the passed user buffer is large enough for part
of the BSS but not large enough for all of the IEs.  This can cause
an EAP network to show up as a PSK network.

Always return -E2BIG in this case to avoid truncating data.

Since this changes the control flow, use an on-stack variable for
a small buffer instead of allocating it.

Signed-off-by: James Minor <james.minor@ni.com>
[rework patch to error out immediately, use _check wrappers]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/scan.c