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: <20230227135241.947052-1-void0red@gmail.com>
Date:   Mon, 27 Feb 2023 21:52:41 +0800
From:   void0red <void0red@...il.com>
To:     lorenzo.bianconi@...hat.com
Cc:     angelogioacchino.delregno@...labora.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, kvalo@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-mediatek@...ts.infradead.org, linux-wireless@...r.kernel.org,
        lorenzo@...nel.org, matthias.bgg@...il.com, nbd@....name,
        netdev@...r.kernel.org, pabeni@...hat.com, ryder.lee@...iatek.com,
        sean.wang@...iatek.com, shayne.chen@...iatek.com,
        void0red@...il.com
Subject: [PATCH v2] wifi: mt76: add a check of vzalloc in mt7615_coredump_work

From: Kang Chen <void0red@...il.com>

vzalloc may fails, dump might be null and will cause
illegal address access later.

Fixes: d2bf7959d9c0 ("mt76: mt7663: introduce coredump support")
Signed-off-by: Kang Chen <void0red@...il.com>
---
v2 -> v1: add Fixes tag

 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index a95602473..73d84c301 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -2367,6 +2367,9 @@ void mt7615_coredump_work(struct work_struct *work)
 	}
 
 	dump = vzalloc(MT76_CONNAC_COREDUMP_SZ);
+	if (!dump)
+		return;
+
 	data = dump;
 
 	while (true) {
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ