From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B2263EA66 for ; Wed, 15 Jul 2026 01:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784080039; cv=none; b=PP3WihgRLpOiGeCLBDNOMTyKAQ1kDIlDNTfBSwXKRJEHSFZiXeznTqxs5JzeyzLmcw0m9sZhHUUs/PvVCC6BPK4FSudBaJz5JHH80BYMVAjmEcGPFS9mWo82ZPesN70SsgoNttAyhX7k5eYAFIHT5xT0Pu2peo8322SEh6/FBvM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784080039; c=relaxed/simple; bh=VzpdxuHb8maKJVpJ29m1XvNr/HeU5CaERW0oz/1NJgY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VXtUq+TXhCHz0w/EuxxMYtwenEJl7gcoLT2CQB+ScXKLssybBd/GZoELtQMf5ayaqJNJHLwNXRxuw3IfrLRdyp0jdqdKqRLTonpNrE5x+XuXZOfC1ct6y3gD+aGgqJJ3xkKUoZ5KhrPJTf6drjIjM3CYY1/PfKhtjw8C6sxkj/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BkADfyjV; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BkADfyjV" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2cc7e86e7aeso16240335ad.2 for ; Tue, 14 Jul 2026 18:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784080037; x=1784684837; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=1G5U81Dkih/D0CAkNBfSOxVYZXTH2mys99woWjtS4JI=; b=BkADfyjVLjqY4YphKcLBlCBa6Vf7gbTT4Sk9qjFfxuPcysyOym0+7DiKcKrxpOX7va HiOImalvfWLfkCHyQLNLzn52XX3UPFpoAoEF1EnknDE3/12jHNNuLSNGrkP070c1JtIB k0SyMWNUyo4eCp934OOjRYX4gDd/5LnVF53Jz0fvplscaE4dWq1I/QbzGw+TUJOh6Q2d iVw/ZwDmGzI3oLbTGYBgZdM2IPTp+YXTI44G7uScZbYpiAieU8q2gh6QQVTx+Rwggj+e uoGfLs25K063xvjnVIGeoNV0iGrWXR7S8HR6Q1fK37j6lxWalNCt7fhGhPPrtsD5yvjP nYhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784080037; x=1784684837; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1G5U81Dkih/D0CAkNBfSOxVYZXTH2mys99woWjtS4JI=; b=UrUaJ9q65c4ibLuulpZaNykVvMnz5Ft5Ex+9xBD99fj/3dnrTFLs6tDVYRpDHW7XFH gEAfAoS3OQG1SsanXOEBGP4nub0QfZR7WlVDDQ9QtT1vsyS5EMAzqZt9/c2d25NF+F5G Uit7nxCpI0pi5gO7eLkIgGUYvwqI9WndAX0x/9MRjE4PLvG/k24TzCco2LWmY++7sJdO 8WS434IE7ehq0i/hkgU2hJ9eDDNJv1DJ54A4Pw1K7wpzoVo9F0/LcpnC7/aCwlOpcqrW sceCLnjtM899RaitVELsstSyOBQAkqxFtw0ZN5Z0Vppz1ksvkrughF6t8i6fnuxOLmBg vyeg== X-Forwarded-Encrypted: i=1; AHgh+RqGP+mI46DXv0OOeWVdYU8iJttsWV1AKCc7HJBFNfYXG/ffA4ivT40q9fOd+Fhracale/OSrlrJUcKKeKs=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9Et/fqRMtaieuWxaI01ft+aul24DKnn9f4nuBeSxikf/Ugwzp BPUYiyKXefKKgHdd0eQPNhXy/b2id2eMxptzQBAKpGbNRZ3EPKgJFn65 X-Gm-Gg: AfdE7cl+bV5zQVc74mA++2za2fbkMDkItxFSA+FdCdWG5Y8kVtWiOHZdYam/kUyYNlj QMsSfSFQEswBwlSLl6q1AGdzPdts8zR8L+8U2IzquaHzzT5Hlcii5IhJzwoNau0/Fnmg9iu6AJ+ lp6IPcoP+UkXvcC5mrAgFIYhWgsw8wmhO/lv7nvquBJxppWRD7BXh2gsW1FPi2wj1IPSKkhYiIh 77oWmx/Sv3nXMKzHoQGesmjvbFtnL4jSvZbAGhffPOvOFxXABE3XDtkEv6vaQa4mzXOC1/n3QVu Is09by5eXTpxRMMsPct7zY9YOCmL/q7gcD/KrnguCE2oGIHHPVprWgbp6DEI+Hn1Au6/UmMMDHc KN8ytNXBlqNIaNraucZpwQhuOUgj5JiBKJ38jgGlP4rt0Van0ifq/zI1ejMpOCnYKWv1CXXglRJ 90JQMnt6p52ZefICinxIxKwNZ9RAqLVABf44bGmqB+PORlvK4B6HmvzsM5u0eNuy+J5Ze3c0RqA hT381qnDmq4MmS7SdUEIMqmxnXqHpQYBJB3+gmKeQ156j9DFopJPUvEcy4DSGs3AA== X-Received: by 2002:a05:6a21:6803:b0:3b5:52b4:87a7 with SMTP id adf61e73a8af0-3c110776462mr17879764637.6.1784080037488; Tue, 14 Jul 2026 18:47:17 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311a6115e61sm70110084eec.22.2026.07.14.18.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 18:47:16 -0700 (PDT) From: Rosen Penev To: linux-wireless@vger.kernel.org Cc: Johannes Berg , "John W. Linville" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH wireless] mac80211: stop tpt LED trigger timer before freeing trigger Date: Tue, 14 Jul 2026 18:47:15 -0700 Message-ID: <20260715014715.1416183-1-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The throughput (tpt) LED trigger timer is only stopped in ieee80211_stop_tpt_led_trig(), which is reached via ieee80211_stop_device() when the interface is brought down. On a hot unplug, the device is torn down through ieee80211_unregister_hw() without ever going through ieee80211_do_stop(), so the timer is never stopped. ieee80211_led_exit() then frees local->tpt_led_trigger (which embeds the timer) without cancelling it. The still-armed timer keeps firing and dereferences the freed tpt_trig, walking local->tpt_led's LED list in led_trigger_blink() -> led_blink_set_nosleep() on the freed wifi LED class device, causing a use-after-free page fault in interrupt context. Call ieee80211_stop_tpt_led_trig() in ieee80211_led_exit(), before unregistering the trigger and freeing the struct, so the timer is always stopped and can never run after the trigger/LEDs are torn down. Fixes: e1e540685437 ("mac80211: add throughput based LED blink trigger") Assisted-by: opencode:hy3-free Signed-off-by: Rosen Penev --- net/mac80211/led.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/led.c b/net/mac80211/led.c index b5600d223452..5a7747dfbfb1 100644 --- a/net/mac80211/led.c +++ b/net/mac80211/led.c @@ -9,6 +9,8 @@ #include #include "led.h" +static void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local); + void ieee80211_led_assoc(struct ieee80211_local *local, bool associated) { if (!atomic_read(&local->assoc_led_active)) @@ -206,6 +208,7 @@ void ieee80211_led_exit(struct ieee80211_local *local) led_trigger_unregister(&local->rx_led); if (local->tpt_led_trigger) { + ieee80211_stop_tpt_led_trig(local); led_trigger_unregister(&local->tpt_led); kfree(local->tpt_led_trigger); } -- 2.55.0