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]
Date:   Tue, 10 Aug 2021 20:53:14 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <linux-staging@...ts.linux.dev>
CC:     <Larry.Finger@...inger.net>, <phil@...lpotter.co.uk>,
        <gregkh@...uxfoundation.org>
Subject: [PATCH -next] staging: r8188eu: Use GFP_ATOMIC under spin lock

A spin lock is taken in __nat25_db_network_insert() and
update_BCNTIM() is called under spin lock so we should
use GFP_ATOMIC in both place.

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/staging/r8188eu/core/rtw_ap.c     | 2 +-
 drivers/staging/r8188eu/core/rtw_br_ext.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_ap.c b/drivers/staging/r8188eu/core/rtw_ap.c
index ad37f1f02ee2..0586e4a4cbcb 100644
--- a/drivers/staging/r8188eu/core/rtw_ap.c
+++ b/drivers/staging/r8188eu/core/rtw_ap.c
@@ -98,7 +98,7 @@ static void update_BCNTIM(struct adapter *padapter)
 		}
 
 		if (remainder_ielen > 0) {
-			pbackup_remainder_ie = kmalloc(remainder_ielen, GFP_KERNEL);
+			pbackup_remainder_ie = kmalloc(remainder_ielen, GFP_ATOMIC);
 			if (pbackup_remainder_ie && premainder_ie)
 				memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
 		}
diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 28f0452d6ccb..e3ff059ce224 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -394,7 +394,7 @@ static void __nat25_db_network_insert(struct adapter *priv,
 		}
 		db = db->next_hash;
 	}
-	db = kmalloc(sizeof(*db), GFP_KERNEL);
+	db = kmalloc(sizeof(*db), GFP_ATOMIC);
 	if (!db) {
 		spin_unlock_bh(&priv->br_ext_lock);
 		return;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ