Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1774017lqs; Sun, 16 Jun 2024 04:16:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIGMHcx7ijZb/w5snCieSAULAcorqg8R8dGpRNksLm5d56RgBpyAlOBmyNTGMKn2BXPd4qAh10sjb/HY7rTl2zhgrdxRajx/DvXE+cnQ== X-Google-Smtp-Source: AGHT+IFpa0m0nmK1b192u9Z7Mx5jQnOQUkNpyeVQZjR8rMwCR193emCDjoZ2g5oDM3KMwwYnXNAT X-Received: by 2002:a17:906:3853:b0:a6f:5192:6f4d with SMTP id a640c23a62f3a-a6f60cefd46mr470710866b.8.1718536573613; Sun, 16 Jun 2024 04:16:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718536573; cv=pass; d=google.com; s=arc-20160816; b=IyU9Ody8lPIdpAFIUy9xfv4Nsx1GgV0hta4d249Vv/sTwittB+l44XM+dgb4RpYbnw aNLrKMhfxK+yvrB4/ni+ZpnvowlB8rebdSSw4gsjW7qrAOvYJntr9ImNfu8k7k4x2PQm 6gg7NhaRdogFtS9CO51DAPiykB0niXAZHfzsy3mJdaMy3kZw0DSwdF5S/upu0NzDqqut nX2bJCRh1ENMizmHu6NhDO/fDPkXhKKpfUfdAPeMpHmoLvYFDEwIMeLKSFuooG+TbGA3 D/Ts30g65yEWfNQi7JXHArPaUHNKxj8sAAP93ZyB6TTBbQg1SCQ5gM1tMPQByL0O3Ijh Xivg== 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=UxLcAVpitaMmr0tIycMD4I4y/P4gyHikhmeqNPtLphY=; fh=yaXYBe9sbkmvlk2mHY0QupCsCyiBqDs07jTvbP5wp9k=; b=LssC4VOTE1zaUXneG5GIDKJ3A9A96HUB7yNS29H1SXqylkcVcED4gYCQSduoKlP4LO 9FG8LY2uGzwXW/ssnO9FxZlpvZVc1zOU9mkqe/BqFD/sAqxb2v5TYxA7qdnps/WdT7Bo rUsnRR82UbnnfZb7TW6kGBa0IBzn51Oi2EXSRVmWDu3G1nPGjxX9BVcSGjWTPDV9QHOL eyqdELjHLxg+HdeNVDixWyZJd/bfSPbY1C/nX6+2war2VQ9LclMZ0KnlyAUXqlwS/Prd IF/dzRN2BEIAzIc5BCs5VX7gFK3jtCVhGJaiwHkMYvAZDPHNGmD3kSo6/KWzam+FMU93 Abmg==; 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-216248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216248-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f5a7cdfecsi332010866b.124.2024.06.16.04.16.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 04:16:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-216248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216248-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 41F301F20E9B for ; Sun, 16 Jun 2024 11:16:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3392C187320; Sun, 16 Jun 2024 11:16:06 +0000 (UTC) Received: from mail78-58.sinamail.sina.com.cn (mail78-58.sinamail.sina.com.cn [219.142.78.58]) (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 7FA0FC152 for ; Sun, 16 Jun 2024 11:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.58 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718536565; cv=none; b=kP1N871yVULvyq8W2OTLUERJ4rRp224bbSp2zeTLCFUqQvvWXhJQcuYXbRv5yi8E0X8QprP1a8lE81JWVkaNe127tzT07L4e0Lxpltj2RaXWg0EHdr4wlWfegCLzXnd15SyPywwOnjcLE+hL3N8IdCQwjnnVA7rdzueI+c06/Zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718536565; c=relaxed/simple; bh=yRkvWUcyYD85QzvXjqsicOKjXeT9KTNyhEAcAFqT3Y4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b+3dBwez0eKS5xCG3kQ/aZ0NfkavXge5x52qzeP6TKH3H4VDeXzh19vOfl+EtppEM4spFcczipAA1hZG57unO88QI/S34Ip/h6VmmkIQSuXhpXbmqXab3FmId8VT7ZlB4yYbqNxsptJlgKnzPJasfkMFCEIjjw5OElSaiyoAcCY= 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.58 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)([116.24.9.2]) by sina.com (172.16.235.25) with ESMTP id 666EC94100001C09; Sun, 16 Jun 2024 19:15: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: 31080534210374 X-SMAIL-UIID: 9F37067A3CB646B48E3E5A2BABADC89A-20240616-191515-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [ntfs3?] KASAN: slab-use-after-free Read in chrdev_open Date: Sun, 16 Jun 2024 19:15:02 +0800 Message-Id: <20240616111502.1435-1-hdanton@sina.com> In-Reply-To: <000000000000f386f90616fea5ef@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 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 83a7eefedc9b --- x/fs/open.c +++ y/fs/open.c @@ -35,6 +35,8 @@ #include #include "internal.h" +#include "mount.h" +#include "pnode.h" int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry, loff_t length, unsigned int time_attrs, struct file *filp) @@ -952,6 +954,12 @@ static int do_dentry_open(struct file *f if (!open) open = f->f_op->open; if (open) { + struct mount *mnt = real_mount(f->f_path.mnt); + error = -ENODEV; + if (mnt->mnt.mnt_flags & MNT_DOOMED) + goto cleanup_all; + if (mnt_get_count(mnt) < 2) + goto cleanup_all; error = open(inode, f); if (error) goto cleanup_all; --