Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp986838lql; Tue, 12 Mar 2024 04:20:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIXhqscuIbpWntvuB/pReoyJEJ2iIPMyB+vemGSZaLSqR9Pr7SuGq+n6f69WOtwTbwsxt8JCSdVATKV1vLSHumCaUJJDLBVQ/QDQrJQw== X-Google-Smtp-Source: AGHT+IF9166JoG9KCuVAkUm6dvI5qPTe/5V1WRMd5g/SufeF1LqG7oAUaFL960bQckFDPqRD6BuX X-Received: by 2002:a17:90a:6984:b0:29b:c019:907c with SMTP id s4-20020a17090a698400b0029bc019907cmr1574188pjj.6.1710242447942; Tue, 12 Mar 2024 04:20:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710242447; cv=pass; d=google.com; s=arc-20160816; b=bPpu08BcKZ1omlHVANEcpdhZXMF5NQIpYHwF6VCYhHHh5FX+/bg/zP/gCnxz0as3R0 TuxYzQU+zSNzimKHwBI7hwFoAKAmpClbPyS1H5X8cwnAfWLcO6ni5+4L7SqzkSQYTzx6 rxFsAYeZ3VKgAkKIOu00m6NJC2Ivi7I4XM9bqSBkEdI8+6hTRqj/9pT6HGmj8fyVgq4C tR9vEAip12WKNQx7gGqAf869MEB9VTNm1z/aJczcBkcoVhz4yeIxXjs7LIzi95vvdnCZ 9OtVq5FD+jASNhikShl57fqu+hlzWsImMR5beMdvnSE+RNDqZLBv0DPLwadl4lOXGz7h Fdwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=dpMXDU6h00LNqIxJflSP0Y2723+VqRc8WlTfkS05TsA=; fh=l8h+5H0SWfts6KVUO78OjOSl96Uo6lZYqfa1VlZmeB4=; b=Cf0TmMEjUMqdLClt9lqCt09c7oZQcFB7VB/Gi/EvqPQn+t2SPx7DCyEOAPqUCw3e3s DQEaPb8L+Dvgn+HbMgj5nD+wZMR7F81pJriW4rX6LwqrTwg1two8eiJdsjvV8YT25hA1 jzfdDvfNAYahfJdknSjmY0angqe0BDEA5qGl1fSe9YI+3v3HHNo2wNPaizdZWHgDCIl6 ZLWXocL0QAY2iNa3xCoEyTL5k2xVg/bRrtpFOU9hgX5uhQgWLYtoBHTyVCFJ4qD8QiBB xIaY5B+LOlWJAtbkhick1xDtmoQvhnBNqWsTDfnzRcTJSuP+hDjW29nNXm/X/O5fZ7JC JVmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-100167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100167-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q12-20020a631f4c000000b005cecd95b6besi6719601pgm.685.2024.03.12.04.20.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 04:20:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-100167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100167-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CDDF284C8C for ; Tue, 12 Mar 2024 11:20:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DC1D79B9D; Tue, 12 Mar 2024 11:20:30 +0000 (UTC) Received: from mail115-95.sinamail.sina.com.cn (mail115-95.sinamail.sina.com.cn [218.30.115.95]) (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 914F779B90 for ; Tue, 12 Mar 2024 11:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.95 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710242429; cv=none; b=rM4gv1BqLBGmz+lxSbaXwXbG5IwVjwZbKiv9LmvRqL7GP2/kftP89WCkaZKXwoTGXpps5v2rcPTSualja8+2dJlFXSe5gYjpcOgAHxU7JLlrZ7ABLZJAfDMDfJ2z0RhXMxFmfXKy0D+Oy+0sGI6MIcTt9Q1fYLFfieac/QpWfAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710242429; c=relaxed/simple; bh=byTWuqt34OfXORoLUHVL4fAoDl9wJkIacEzuSj2mCAo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IimGHllvZVruay36CWc/9bOy+LFnZ+hRl8V+s18wa34x7chI6KzRcopLKweBinxPSUxiLQbpF+4V5jwsEKthZdPFubl4j0fLLDnGZ6can0fg9fDgqjMLVY+kncsCZHAWdiU7Hw4W2Ge4iB1JUInseX43fCwTXZ7QhpEsvNDLUtY= 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=218.30.115.95 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.88.51.55]) by sina.com (172.16.235.24) with ESMTP id 65F03A6C00007782; Tue, 12 Mar 2024 19:20:15 +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: 50145845089258 X-SMAIL-UIID: 2030E6FFB47E44AABCFBD0C87F71DC1D-20240312-192015-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [serial?] KASAN: slab-use-after-free Read in tty_write_room (2) Date: Tue, 12 Mar 2024 19:20:03 +0800 Message-Id: <20240312112003.2116-1-hdanton@sina.com> In-Reply-To: <000000000000fd3d660613636f95@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 Mon, 11 Mar 2024 07:34:21 -0700 > syzbot has found a reproducer for the following issue on: > > HEAD commit: e8f897f4afef Linux 6.8 > git tree: upstream > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11f338d1180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- x/drivers/net/caif/caif_serial.c +++ y/drivers/net/caif/caif_serial.c @@ -306,8 +306,11 @@ static void ser_release(struct work_stru if (!list_empty(&list)) { rtnl_lock(); list_for_each_entry_safe(ser, tmp, &list, node) { + struct tty_struct *tty = ser->tty; + dev_close(ser->dev); unregister_netdevice(ser->dev); + tty_kref_put(tty); debugfs_deinit(ser); } 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); --