From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795022947; b=gH11urqLz+vU9Y1Iodz6DYfoZAB2PhenIGGO3u9zGgm27SoDpNBE4tAx6BBwKexnxwEn 1CTAWcw+qi1wDey1WYlbk+4A8TZ1IBJdN/pv9bpyUP7czaxZa8nuSGmYbd6xTp7cE2Neo wcUK95pKQEMlCkKfYK3E6UYmB8Bc987OY0P1Ua/m3k+bCEI912hKv8JkylvUylopMB9Ci FzgS502I7fO0wKhIh+HC1XTFHFaL3r0AMr7AVwyxrE3JhaQY2MgdrojDPc9sBtt517tT+ S/5BkDIlUiZVc2xUVIMyVoyTJuhIQ/FK/jW06K3TVulOmJr91t8jpaERhOYWsWKxOMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795022947; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=clwW1kaeWRNh9fIaa9ftMZ5vt+deUxtsnMqXzOcfJlA=; b=Rps6bbKvAdG4z4umbGupJUvb7/KeHVcyTtkeoRhmnqyr/k+d0rCeIucbLxf9f0kRbx9i J3NLwKI6MRnFiJwIhkZDXmotiIHOl/557Ks2qvC78UPkdrLEEc/iczxh4vWpoQSwmlj14 vuo18NEcN2qwOV78clib5DF3GneSm9hjfWGbdaK3ACs4AueJ7Uq2LOuMONg/7B//HlSvo T68Mg+DYkoOgEyUu6NEgQyRzBTG7yQUsfpoEGg1ZX+86W9kTWj2wJKQpN98iyUl7Cl+tE sqA7FYmZkhJ98URD56uFXC01oiHw/urCSQX1GuKUV9LuGegmUKTI0Y7stBg+2i+v+Nw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SkjoOX+y; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7486D606B3C6; Wed, 18 Nov 2026 17:29:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SkjoOX+y Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EE8C1F000C6; Wed, 18 Nov 2026 17:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795022947; bh=clwW1kaeWRNh9fIaa9ftMZ5vt+deUxtsnMqXzOcfJlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SkjoOX+yhTjHohepwTFMFVjErTbElszz9BAbpLilgSaEoANOM9tqvDjk80M4GkQXR ktLAbDIrhj5GizRMTA+4Eu6NcLLqqxjYJslJdtIK+SLzI+p6/FIPDFvUeD6S7Wauk9 gHQGkUz1ZilTFoyXul8fF0laQNzjr0UC3nqK6aZ8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdurrahman Karadag , Ping-Ke Shih , Sasha Levin Subject: [PATCH 6.18 0195/2151] wifi: rtw88: debugfs: dont vzalloc(0) when rsvd_page is read unconfigured Date: Wed, 18 Nov 2026 15:32:10 +0100 Message-ID: <20261118150128.882119807@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abdurrahman Karadag [ Upstream commit 81510c3d6f2199889a4a936d8cf8b9e05911b10e ] Reading the rsvd_page debugfs entry before writing a page offset and count to it calls vzalloc() with a size of zero, because rsvd_page.page_num defaults to 0. vmalloc warns about this: WARNING: mm/vmalloc.c:4019 at __vmalloc_node_range_noprof+0x9ac/0xa30 ... Call Trace: __vmalloc_node_noprof+0x4c/0x70 rtw_debugfs_get_rsvd_page+0x4c/0x110 [rtw88_core] seq_read_iter+0x132/0x4b0 seq_read+0x12e/0x1c0 full_proxy_read+0x6f/0xc0 vfs_read+0xdd/0x490 rtw_fw_dump_fifo() would reject the zero size anyway, but only after the allocation. Check for a zero buffer size first and print a short usage hint instead of allocating. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Abdurrahman Karadag Acked-by: Ping-Ke Shih Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20260827131244.35623-1-abdurrahmankaradag19@gmail.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw88/debug.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c index b67d69b01f879..84e45af26f525 100644 --- a/drivers/net/wireless/realtek/rtw88/debug.c +++ b/drivers/net/wireless/realtek/rtw88/debug.c @@ -315,6 +315,11 @@ static int rtw_debugfs_get_rsvd_page(struct seq_file *m, void *v) int i; int ret; + if (!buf_size) { + seq_puts(m, "usage: echo > rsvd_page\n"); + return 0; + } + buf = vzalloc(buf_size); if (!buf) return -ENOMEM; -- 2.53.0