linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
To: Joe Perches <joe@perches.com>
Cc: <kvalo@qca.qualcomm.com>, <linux-wireless@vger.kernel.org>,
	<ath6kl-devel@qualcomm.com>,
	Subramania Sharma <sharmat@qca.qualcomm.com>
Subject: Re: [PATCH V2] ath6kl: Fix 4-way handshake failure in AP and P2P GO mode
Date: Tue, 10 Apr 2012 13:20:37 +0530	[thread overview]
Message-ID: <4F83E64D.4010102@qca.qualcomm.com> (raw)
In-Reply-To: <1333987238.2152.5.camel@joe2Laptop>

>> +static int ath6kl_get_rsn_capab(struct cfg80211_beacon_data *beacon,
>> +				u8 *rsn_capab)
>> +{
>> +	const u8 *rsn_ie;
>> +	size_t rsn_ie_len;
>> +	u16 cnt;
>> +
>> +	if (!beacon->tail)
>> +		return -EINVAL;
>> +
>> +	rsn_ie = cfg80211_find_ie(WLAN_EID_RSN, beacon->tail, beacon->tail_len);
>> +	if (!rsn_ie)
>> +		return -EINVAL;
>> +
>> +	rsn_ie_len = *(rsn_ie + 1);
>> +	/* skip element id and length */
>> +	rsn_ie += 2;
>> +
>> +	/* skip version, group cipher */
>> +	if (rsn_ie_len<  6)
>> +		return -EINVAL;
>> +	rsn_ie +=  6;
>> +	rsn_ie_len -= 6;
>> +
>> +	/* skip pairwise cipher suite */
>> +	if (rsn_ie_len<  2)
>> +		return -EINVAL;
>> +	cnt = *((u16 *) rsn_ie);
>
> Any endian or alignment issues?

Indeed this can pretty much result in unaligned memory access.
I'll fix that. Thanks for pointing this out.
>
>> +	rsn_ie += (2 + cnt * 4);
>> +	rsn_ie_len -= (2 + cnt * 4);
>> +
>> +	/* skip akm suite */
>> +	if (rsn_ie_len<  2)
>> +		return -EINVAL;
>> +	cnt = *((u16 *) rsn_ie);

This too.

Vasanth

      reply	other threads:[~2012-04-10  7:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <\>
2012-04-09 15:21 ` [PATCH V2] ath6kl: Fix 4-way handshake failure in AP and P2P GO mode Vasanthakumar Thiagarajan
2012-04-09 15:34   ` Kalle Valo
2012-04-09 16:00   ` Joe Perches
2012-04-10  7:50     ` Vasanthakumar Thiagarajan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F83E64D.4010102@qca.qualcomm.com \
    --to=vthiagar@qca.qualcomm.com \
    --cc=ath6kl-devel@qualcomm.com \
    --cc=joe@perches.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sharmat@qca.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).