]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc86a321210a6a686c561b924714d5f870ef07842
tree1f23e9cf5066d66b207484ff6839a8e53fa6c70f
parentbe0c634f2ccb0b8d1f08bf58c6dc1a7ce4ecf4fd
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