From nobody Mon Jun 8 21:58:56 2026 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (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 CF1352459DD for ; Tue, 26 May 2026 12:49:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779799746; cv=none; b=kNeJkLSOgLcs6nzV8pPiq/fdagrZFvzp0xnWql6VVi2hCtCmmAtBeBgK5K2rEyzUG8rM1iQ2L6+/bKPFCv9l632OKd1F/dpTOk/yqYChLnHZY0N1m8ATY+wJ2Umwi7vU4tfwSp6TsLcDQk0ViBOHI2AEoXVi7pFkuaqoU7BPu1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779799746; c=relaxed/simple; bh=uSI7UXGeUrF/zh9xEtnU6rexalAWYbLbQRbnPqojXNE=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=KYOmYH0sd8LqvBGEZfbzSbsVTmNrxPFrvLmz51UOe7Fb2TW9FTdAw774X9ejlb6oMsCz44PZv1bm0boFXE7c5ojsSD1wMlGv0yPfOefPEPv0jW/G1GQczy0k1C3fJTlNsQ2oPqmBBmJOsjJfVDtc1MGgroWDngWqjfbDOXUDPPE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-69d9070362eso4510295eaf.2 for ; Tue, 26 May 2026 05:49:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779799744; x=1780404544; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kLmmpWR/2Td2V/pO13VnlHYOf2ag7zaNkRcI14lP14o=; b=hj+bO9K4ztxQCGW9qzkNS5tNJhUKo3LJ12e0HyqdlhRsJzJHIVdOYApTyiWbqOyQBZ wo4Zsb+R5U0S1ZAhj+gpDNgW7kfH36mDUcpPKn3phYlwMAuNgYLN5eQST255UjzpU3mX 1hd0WifeFaG2KzdUb5c15uFYDYT8wHu0AJmp8jCoyX341D6x98uaj3PLUM60XwApoERR mcINZxjjOPtb9qL0sMy7OPn+cumzn9Km7Hc6D5tEmxydTXB/36sBR7xIoTVlO2nlRnLf T8SaUaG+PVzoExXm4PWQkAQqi9+ytt/A8EIblGDuL8UyQfiC8qoSzoSHEZE6DBfXJ/Oa lJsA== X-Gm-Message-State: AOJu0YxTwjQ6d8WsPs9qldYRGlQLLLCD6EJx3Ghr6M3MqZC794mwZLmx epU0VPYmCLMbhJAX5ZMFUyi4/6pbr81KweoTosOZk+o5NZk/IflkKMDTxEgy7VpU/q6i5+Pghj5 kbHNQGKraMvqOtuhlv8ko90kAhX05oFIXDSmw2CPCgXl18dwuNjkc6W+xkO8= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:e90c:0:b0:69d:82e6:69b7 with SMTP id 006d021491bc7-69d82e671b3mr8920422eaf.51.1779799743783; Tue, 26 May 2026 05:49:03 -0700 (PDT) Date: Tue, 26 May 2026 05:49:03 -0700 In-Reply-To: <6a150a33.2b0a0220.185dbd.0004.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a1596bf.820a0220.e7972.000c.GAE@google.com> Subject: Forwarded: [PATCH] media: vidtv: fix memory leak by cleaning up mux in bridge_remove From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] media: vidtv: fix memory leak by cleaning up mux in bridge= _remove Author: zhanghaotian@uniontech.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master The vidtv driver relies on stop_feed being called via the dmxdev file close path to trigger vidtv_stop_streaming() which destroys the mux. However, if the DVB core close path does not reach stop_filtering (e.g. due to race conditions), the entire mux and all channel descriptors are permanently leaked. Fix this by proactively stopping streaming and destroying the mux in vidtv_bridge_remove(), before releasing the dmxdev and dmx resources. Use the existing feed_lock mutex to synchronize with any concurrent stop_feed callback. After cleaning up the mux, set dvb->streaming to false and dvb->mux to NULL so any subsequent stop_feed will return early safely. Also fix a pre-existing bug where mutex_destroy(&dvb->feed_lock) was called before dvb_dmxdev_release(), which could cause vidtv_stop_feed to operate on a destroyed mutex if the fd close path races with module removal. Reported-by: syzbot+acc3b75c010446ad403f@syzkaller.appspotmail.com Signed-off-by: zhanghaotian --- drivers/media/test-drivers/vidtv/vidtv_bridge.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/medi= a/test-drivers/vidtv/vidtv_bridge.c index a8a76434989c..3ea8cc04571d 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c +++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c @@ -548,7 +548,13 @@ static void vidtv_bridge_remove(struct platform_device= *pdev) media_device_cleanup(&dvb->mdev); #endif /* CONFIG_MEDIA_CONTROLLER_DVB */ =20 - mutex_destroy(&dvb->feed_lock); + mutex_lock(&dvb->feed_lock); + if (dvb->streaming) { + dvb->streaming =3D false; + vidtv_mux_destroy(dvb->mux); + dvb->mux =3D NULL; + } + mutex_unlock(&dvb->feed_lock); =20 for (i =3D 0; i < NUM_FE; ++i) { dvb_unregister_frontend(dvb->fe[i]); @@ -559,6 +565,8 @@ static void vidtv_bridge_remove(struct platform_device = *pdev) dvb_dmxdev_release(&dvb->dmx_dev); dvb_dmx_release(&dvb->demux); dvb_unregister_adapter(&dvb->adapter); + + mutex_destroy(&dvb->feed_lock); dev_info(&pdev->dev, "Successfully removed vidtv\n"); } =20 --=20 2.30.2