[PATCH] hostapd: Disable VHT caps for STAs when no valid VHT MCS set

Jouni Malinen j at w1.fi
Sat Feb 28 02:46:31 EST 2015

On Fri, Feb 27, 2015 at 10:19:41PM +0530, Rajkumar Manoharan wrote:
> Disable VHT caps for STAs for which there is not even a single
> allowed MCS in any supported number of streams. i.e STA is
> advertising 3 (not supported) as VHT MCS rates for all supported
> streams.

> +	struct hostapd_hw_modes *mode = hapd->iface->current_mode;

It would be good to check that mode != NULL before dereferencing it,
e.g., by moving the new code to a helper function that is called only if
mode != NULL.

> +	struct ieee80211_vht_capabilities *vht_cap, ap_vht_cap;

> @@ -103,6 +108,35 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
> +	memcpy(&ap_vht_cap, mode->vht_mcs_set, sizeof(ap_vht_cap));

That cannot be correct. mode->vht_mcs_set is an array of eight bytes
while sizeof(ap_vht_cap) is 12 bytes.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list