From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail78-59.sinamail.sina.com.cn (mail78-59.sinamail.sina.com.cn [219.142.78.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4DB27FD for ; Sat, 18 Jan 2025 11:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.59 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737198385; cv=none; b=ZM2q4DF9uPKIMQKq8SQe/8K6uSETXsMPycn4Ao7GRAuP8aDHCC2C+6mZP3cULUe0r10xDPpaYg/X1jh3jskh5OMJJlDqEmiX6oenCW1SxTar+ZwkFAMB3G2a/YXHChQaCIl6Hp8jyw1azbOAYs3bLjPRGtkrgt/CAa+/zVbkVYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737198385; c=relaxed/simple; bh=MYDoLNnHF18D4flriPMipxUZeI5X1PpY3xhXAt/Ytcs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gqFzndZKdORT2K+zT7OLXD2LxrCwJwh85moCmVLTaKS0rW6/FWNxYwVav8ai3wz6f0UeTdkQ8R0aUN9x4GJn0zV52AZeJc7UfYT5lm9Viy5kTd0bDHiD7Sg//ZT3lFZeY8zBvwWhx5gR7T4WrW1T8FnWavuBP/0HDyzK0t2BG5g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=219.142.78.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.67.155]) by sina.com (10.185.250.24) with ESMTP id 678B8B1B00005F7B; Sat, 18 Jan 2025 19:06:08 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 81549510748364 X-SMAIL-UIID: 27F56805E68244E0A2D2CFB02F95655B-20250118-190608-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [net?] KASAN: slab-use-after-free Read in handle_tx (2) Date: Sat, 18 Jan 2025 19:05:54 +0800 Message-ID: <20250118110555.1978-1-hdanton@sina.com> In-Reply-To: <678a8f3d.050a0220.303755.000f.GAE@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 17 Jan 2025 09:11:25 -0800 > syzbot has found a reproducer for the following issue on: > > HEAD commit: 9bffa1ad25b8 Merge tag 'drm-fixes-2025-01-17' of https://g.. > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17d6c2b0580000 #syz test --- x/drivers/net/caif/caif_serial.c +++ y/drivers/net/caif/caif_serial.c @@ -304,11 +304,14 @@ static void ser_release(struct work_stru spin_unlock(&ser_lock); if (!list_empty(&list)) { + struct tty_struct *tty; rtnl_lock(); list_for_each_entry_safe(ser, tmp, &list, node) { + tty = ser->tty; dev_close(ser->dev); unregister_netdevice(ser->dev); debugfs_deinit(ser); + tty_kref_put(tty); } rtnl_unlock(); } @@ -369,8 +372,6 @@ static void ldisc_close(struct tty_struc { struct ser_device *ser = tty->disc_data; - tty_kref_put(ser->tty); - spin_lock(&ser_lock); list_move(&ser->node, &ser_release_list); spin_unlock(&ser_lock); --