From: Dan Carpenter <dan.carpenter@oracle.com>
To: luoy@marvell.com
Cc: linux-wireless@vger.kernel.org
Subject: re: mwifiex: add AES_CMAC support in key_material cmd
Date: Wed, 8 Aug 2012 17:12:14 +0300 [thread overview]
Message-ID: <20120808141213.GA28142@elgon.mountain> (raw)
Hello Ying Luo,
The patch b877f4cf5af8: "mwifiex: add AES_CMAC support in
key_material cmd" from Aug 3, 2012, leads to the following warning:
drivers/net/wireless/mwifiex/sta_cmd.c:692
mwifiex_cmd_802_11_key_material()
error: memcpy() 'param->key' too small (16 vs 32)
656 } else if (enc_key->key_len == WLAN_KEY_LEN_TKIP) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We assume a 32 byte key_len here.
657 dev_dbg(priv->adapter->dev, "cmd: WPA_TKIP\n");
658 key_material->key_param_set.key_type_id =
659 cpu_to_le16(KEY_TYPE_ID_TKIP);
660 key_material->key_param_set.key_info =
661 cpu_to_le16(KEY_ENABLED);
[snip]
686 if (le16_to_cpu(key_material->key_param_set.key_type_id) ==
687 KEY_TYPE_ID_AES_CMAC) {
688 struct mwifiex_cmac_param *param =
689 (void *)key_material->key_param_set.key;
690
691 memcpy(param->ipn, enc_key->pn, IGTK_PN_LEN);
692 memcpy(param->key, enc_key->key_material,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
693 enc_key->key_len);
^^^^^^^^^^^^^^^^
"param->key" only has space for 16 bytes.
694
regards,
dan carpenter
next reply other threads:[~2012-08-08 14:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 14:12 Dan Carpenter [this message]
2012-08-09 1:45 ` mwifiex: add AES_CMAC support in key_material cmd Bing Zhao
2012-08-09 7:09 ` Dan Carpenter
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=20120808141213.GA28142@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
--cc=luoy@marvell.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).