From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2] Staging: rtl8192e: array overflow in rtl92e_set_swcam()
Date: Tue, 28 Jul 2015 18:17:20 +0000 [thread overview]
Message-ID: <55B7C730.4090301@gmail.com> (raw)
In-Reply-To: <20150728154821.GA25739@mwanda>
On 28.07.2015 17:48, Dan Carpenter wrote:
> "EntryNo" is comes from the user in the ioctl and it's a number between
> 0-255. The ieee->swcamtable[] array only has 32 elements so it can
> result in memory corruption.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
> index dc8c7a8..c146b7e 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
> @@ -78,6 +78,10 @@ void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
> RT_TRACE(COMP_DBG,
> "======>%s():EntryNo is %d,KeyIndex is %d,KeyType is %d,is_mesh is %d\n",
> __func__, EntryNo, KeyIndex, KeyType, is_mesh);
> +
> + if (EntryNo >= TOTAL_CAM_ENTRY)
> + return;
> +
> if (!is_mesh) {
> ieee->swcamtable[EntryNo].bused = true;
> ieee->swcamtable[EntryNo].key_index = KeyIndex;
>
+1 for both patches - thanks for finding this.
prev parent reply other threads:[~2015-07-28 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 15:48 [patch 1/2] Staging: rtl8192e: array overflow in rtl92e_set_swcam() Dan Carpenter
2015-07-28 18:17 ` Mateusz Kulikowski [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=55B7C730.4090301@gmail.com \
--to=mateusz.kulikowski@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.