From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
Johnny Kim <johnny.kim@atmel.com>, Tony Cho <tony.cho@atmel.com>,
Leo Kim <leo.kim@atmel.com>, Glen Lee <glen.lee@atmel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rachel Kim <rachel.kim@atmel.com>,
Chris Park <chris.park@atmel.com>
Subject: [PATCH] staging: wicl1000: fix dereference after free in wilc_wlan_cleanup()
Date: Tue, 22 Sep 2015 12:24:50 +0200 [thread overview]
Message-ID: <1442917490-26574-1-git-send-email-javier@osg.samsung.com> (raw)
The wilc_wlan_cleanup() function iterates over the list of transmission
buffers freeing all of them and then iterates over the receive buffers
list to free all of them as well.
But on the receive loop a pointer to struct txq_entry_t is dereferenced
instead of the pointer to a struct rxq_entry_t. This not only causes a
dereference to a pointer already freed but also leaks the memory in the
struct rxq_entry_t buffer.
Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4c25179c2fec..c40f143b00b7 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1746,7 +1746,7 @@ static void wilc_wlan_cleanup(void)
if (rqe == NULL)
break;
#ifdef MEMORY_DYNAMIC
- kfree(tqe->buffer);
+ kfree(rqe->buffer);
#endif
kfree(rqe);
} while (1);
--
2.4.3
next reply other threads:[~2015-09-22 10:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 10:24 Javier Martinez Canillas [this message]
2015-09-22 12:16 ` [PATCH] staging: wicl1000: fix dereference after free in wilc_wlan_cleanup() Sudip Mukherjee
2015-09-22 13:04 ` Javier Martinez Canillas
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=1442917490-26574-1-git-send-email-javier@osg.samsung.com \
--to=javier@osg.samsung.com \
--cc=chris.park@atmel.com \
--cc=devel@driverdev.osuosl.org \
--cc=glen.lee@atmel.com \
--cc=gregkh@linuxfoundation.org \
--cc=johnny.kim@atmel.com \
--cc=leo.kim@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rachel.kim@atmel.com \
--cc=tony.cho@atmel.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 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.