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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170206172328.24674-3-insafonov@gmail.com>
Date:   Mon,  6 Feb 2017 20:23:27 +0300
From:   Ivan Safonov <insafonov@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Ivan Safonov <insafonov@...il.com>,
        Luca Ceresoli <luca@...aceresoli.net>,
        William Blough <devel@...ugh.us>,
        Kyle Kuffermann <kyle.kuffermann@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jarod Wilson <jarod@...hat.com>, Phil Sutter <phil@....cc>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/4] staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure

Original driver code uses rx_* members to store skb (pkt) fields
(instead of pkt->* members), pkt->* updated only after data
completely formed, not in process.

Update pkt->* after data buffer changed (with rx_*).

Signed-off-by: Ivan Safonov <insafonov@...il.com>
---
 drivers/staging/rtl8188eu/include/rtw_recv.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 2e5caa4..d4d8a74 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -261,6 +261,8 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
 
 	if (precvframe == NULL)
 		return NULL;
+
+	skb_pull(precvframe->pkt, sz);
 	precvframe->rx_data += sz;
 	if (precvframe->rx_data > precvframe->rx_tail) {
 		precvframe->rx_data -= sz;
@@ -278,7 +280,7 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, int sz)
 
 	if (precvframe == NULL)
 		return NULL;
-
+	skb_put(precvframe->pkt, sz);
 	precvframe->rx_tail += sz;
 
 	if (precvframe->rx_tail > precvframe->pkt->end) {
@@ -299,6 +301,7 @@ static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
 
 	if (precvframe == NULL)
 		return NULL;
+	skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
 	precvframe->rx_tail -= sz;
 	if (precvframe->rx_tail < precvframe->rx_data) {
 		precvframe->rx_tail += sz;
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ