lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426861300-13286-1-git-send-email-mattew8898@gmail.com>
Date:	Fri, 20 Mar 2015 15:21:40 +0100
From:	Matteo Semenzato <mattew8898@...il.com>
To:	gregkh@...uxfoundation.org, navin.patidar@...il.com,
	hejianet@...il.com, sudipm.mukherjee@...il.com
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Matteo Semenzato <mattew8898@...il.com>
Subject: [PATCH] Staging: rtl8188eu fix buffer overflow

From: Matteo Semenzato <mattew8898@...il.com>

This patch fixes the buffer overflow caused by accessing index 4 of hwxmits.

Signed-off-by: Matteo Semenzato <mattew8898@...il.com>
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 7a71df1..7b22779 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -1631,10 +1631,12 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
 {
 	struct hw_xmit *hwxmits;
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
+	size_t size;
 
 	pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;
 
-	pxmitpriv->hwxmits = kzalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry, GFP_KERNEL);
+	size =  sizeof(struct hw_xmit) * (pxmitpriv->hwxmit_entry + 1);
+	pxmitpriv->hwxmits = kzalloc(size, GFP_KERNEL);
 
 	hwxmits = pxmitpriv->hwxmits;
 
-- 
2.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ