From nobody Sat May 11 19:48:41 2024 X-Original-To: wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcGXC0rp6z5Kgt3 for ; Sat, 11 May 2024 19:48:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcGXB6wrLz4Vpt for ; Sat, 11 May 2024 19:48:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715456923; a=rsa-sha256; cv=none; b=Fmd9VD14FkL+p0SCWBoVzZk/5NXoFQ7blWtAmMNQFDoXurzkhRNY9HjskPcmLcDUQbNUaH miAiU/Vy9DmIfxEa4jVsU8nE55MAQPvwh4RAlx/CXXJRhO55LnDfjwKN33nBWQBBvejpv3 QhoLPtyziGwJfuWueLE4hqni5zwqL7muZH8I100ixk5TybNkWqcF2+K+KEE8TXhtIFYZCC Fo8MuBJdojVNIQ06Y0rOpeQY/GSA2V7PFW8IEhEFSHYi/83zwzGqtlkCL03W0p+vxN3mXg F6ADaK1ldiA8NXEIi63udK2u3byBofFZI1xh4wLeOf6iG+3paZKAD+TgFHdOOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715456923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=grcBHCZ66tsqhlD3PItEBY0JQ2IEz7AJxl9qNZko9Y0=; b=EljhxJtVDrA9zWW0OrDehd3Fkb8c6+EvFngxt1BiT1ZtksVN/EKynEVqxxgrpL3cSabfoP ukUP16gZ2wl+WiLjyOtQBTttNrailEXseE8Q87JvBkLfskTxFHvCNMFzg1Ps0tzYWxOmBN xuBOCCaTA60vrQ65rw6wfO8gAAQns6PTWvnD8GxaBQopuuuj4496h2xCj6Zk6QG8BJJP8G kNq8UXugDCaJmKPn05taCCBHHaP0C3nAu1vBVTxmEyDnPKX9aXEO8ljEXku7IB0MZzqEzg /hY+lZNgLlNJLFcz/7IzashG08C1sX2adw6VooQIqXEHCy+abCSmC5R6INqkBQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcGXB6WdXzZPr for ; Sat, 11 May 2024 19:48:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 44BJmgxi091348 for ; Sat, 11 May 2024 19:48:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 44BJmgTH091347 for wireless@FreeBSD.org; Sat, 11 May 2024 19:48:42 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: wireless@FreeBSD.org Subject: [Bug 237921] wpi: Memory leak in function wpi_free_tx_ring of sys/dev/wpi/if_wpi.c Date: Sat, 11 May 2024 19:48:41 +0000 X-Bugzilla-Reason: AssignedTo CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: needs-qa, patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bz@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: wireless@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: cc bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-wireless@freebsd.org Sender: owner-freebsd-wireless@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237921 Bjoern A. Zeeb changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bz@FreeBSD.org Status|Open |In Progress --- Comment #9 from Bjoern A. Zeeb --- (In reply to Yusuf Khan from comment #8) I cannot follow the logic. wpi_free_tx_ring() is called from device detach (ignoring the attach error path); the mbuf/ring descriptor will not be used beyond that function anym= ore at that stage so there is no need to set it to NULL anymore. That would ju= st be a NOP. If there's still a reference to a ni at that stage, then other cleanup hasn= 't worked at the beginning of wpi_detach(). There should be no more ni; in f= act that should also be no more mbuf attached on the TX ring so I would even question if that code path is ever taken. This function is basically doing the opposite of wpi_alloc_tx_ring(). wpi_reset_tx_ring() on the contrary leaves all resources in place and only cleans up any outstanding transations and resets the ring to default values= ;=20 this happens in wpi_hw_stop(). And then the resources will be re-used again after wpi_parent() goes through the bringup part again (a VAP/wlan interfac= e is brought up again). So let me ask what lead to the original assumption that there may be a memo= ry leak and a possible use-after-free. If you indeed believe that, I would love to know the code path which can trigger it. --=20 You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug.=