diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/core.h | 3 | ||||
-rw-r--r-- | net/wireless/radiotap.c | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index fe8d4f2be49b..aff959e5a1b3 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -958,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
958 | case NETDEV_PRE_UP: | 958 | case NETDEV_PRE_UP: |
959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) | 959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) |
960 | return notifier_from_errno(-EOPNOTSUPP); | 960 | return notifier_from_errno(-EOPNOTSUPP); |
961 | if (rfkill_blocked(rdev->rfkill)) | ||
962 | return notifier_from_errno(-ERFKILL); | ||
963 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); | 961 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); |
964 | if (ret) | 962 | if (ret) |
965 | return notifier_from_errno(ret); | 963 | return notifier_from_errno(ret); |
diff --git a/net/wireless/core.h b/net/wireless/core.h index 74beff1e926f..af10e59af2d8 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -402,6 +402,9 @@ static inline int | |||
402 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, | 402 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, |
403 | enum nl80211_iftype iftype) | 403 | enum nl80211_iftype iftype) |
404 | { | 404 | { |
405 | if (rfkill_blocked(rdev->rfkill)) | ||
406 | return -ERFKILL; | ||
407 | |||
405 | return cfg80211_can_change_interface(rdev, NULL, iftype); | 408 | return cfg80211_can_change_interface(rdev, NULL, iftype); |
406 | } | 409 | } |
407 | 410 | ||
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c index 7d604c06c3dc..a271c27fac77 100644 --- a/net/wireless/radiotap.c +++ b/net/wireless/radiotap.c | |||
@@ -97,6 +97,10 @@ int ieee80211_radiotap_iterator_init( | |||
97 | struct ieee80211_radiotap_header *radiotap_header, | 97 | struct ieee80211_radiotap_header *radiotap_header, |
98 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) | 98 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) |
99 | { | 99 | { |
100 | /* check the radiotap header can actually be present */ | ||
101 | if (max_length < sizeof(struct ieee80211_radiotap_header)) | ||
102 | return -EINVAL; | ||
103 | |||
100 | /* Linux only supports version 0 radiotap format */ | 104 | /* Linux only supports version 0 radiotap format */ |
101 | if (radiotap_header->it_version) | 105 | if (radiotap_header->it_version) |
102 | return -EINVAL; | 106 | return -EINVAL; |
@@ -131,7 +135,8 @@ int ieee80211_radiotap_iterator_init( | |||
131 | */ | 135 | */ |
132 | 136 | ||
133 | if ((unsigned long)iterator->_arg - | 137 | if ((unsigned long)iterator->_arg - |
134 | (unsigned long)iterator->_rtheader > | 138 | (unsigned long)iterator->_rtheader + |
139 | sizeof(uint32_t) > | ||
135 | (unsigned long)iterator->_max_length) | 140 | (unsigned long)iterator->_max_length) |
136 | return -EINVAL; | 141 | return -EINVAL; |
137 | } | 142 | } |