Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp286125lqb; Tue, 28 May 2024 15:59:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUh/r35oD/GAhmVsy8AgefEp0PmT+PxIlhnTmhK21//2nav5+y/R17UaaehIXDKXrQUdKd3YlCXyS8VmkWqDbrGe1eIvt8GiW0c1pR6Gg== X-Google-Smtp-Source: AGHT+IFSUG2eUymads+MbG3DbXJxBQX3+3+PIXzwE6iAoUk95OXVMqsFBE5Zg774zpMSjdZ7M/nc X-Received: by 2002:a05:620a:258d:b0:793:18be:39d1 with SMTP id af79cd13be357-794ab08a5ebmr1617488685a.32.1716937175982; Tue, 28 May 2024 15:59:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716937175; cv=pass; d=google.com; s=arc-20160816; b=HUtIBPnZsorw3tRd/rGiGZkk6VYsjA5jE3aHJfS64gNx8LNphf33iSJAv879XM2XYU xPrnMojchY75K7iXdA/DuB7ospWMtLdHFc85iPejofxIA/KvGDeNR/P362Zs8pJinpau B6iY2VQFCWxPFMJjP/uk0eurriIRvBy6Y9EFrAyE6KqL9OxCbQ4nLFohYvlYoAs8GC7I FewUJQRQ1tC5p/2q0MbwoV0yJwey0plOuYSZXuf69RuM/1zz63NLkJ1Jt9hJtGL+Az0y H/VUiB73jZOOUpw5hwoeWWzklUJ/alplKCPNrexvFIffcb+mFQ0vX5DOz/71Vf+KykWG 98fg== 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=dT/kh1VUUXc7qvHMsGXh4/6VjJyZl/Wv3lp5j5Mf3ic=; fh=yaXYBe9sbkmvlk2mHY0QupCsCyiBqDs07jTvbP5wp9k=; b=c4p3AFZj68hw9bzUyudbcFBR363zKPpQR1DF9+n8F6ei2nAJppdRkMGYX8J5vP0+lS no8SZhm6V9m90rodCHdBQiyUc4rLv9ZzQOpxOvR8LlOtVI2liUnqwAjARk/XfrwJWL/Z hWR9rwUEvwVEqUrVd2B/ts++9ItgXBTAgIH1mWNj+kxQsjlHRybKdBhqCgYoJfIH1Lfk 1GuK+C/h9HOOiz5mRU6y1UXGQYJH60XItQbHs7otYHecDg6k+PXU6zWSXzPgvX98juwr TuOysI/wHO7d3CNa+MNHPyXG2JZbtSr27B9pKuRvYwADlGBpnELIbAz8fVD7WPyGH/zn zC/g==; 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-193215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193215-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcc7c0asi1101352085a.209.2024.05.28.15.59.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 15:59:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-193215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193215-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A79971C269EB for ; Tue, 28 May 2024 22:59:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7EE313E8B0; Tue, 28 May 2024 22:59:30 +0000 (UTC) Received: from smtp134-24.sina.com.cn (smtp134-24.sina.com.cn [180.149.134.24]) (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 532B013E883 for ; Tue, 28 May 2024 22:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=180.149.134.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716937170; cv=none; b=Az0hLuTxIA6TvMoktwnpTmgQLkTuQk3hQ4VPHCxgAiLfo/RnvAEbLShOoQbpfCNxITTd0aa6UQyzKyc9kEQz8bm3/6cNeHOpWnpcGqSvuPvOiMZFtkqxrPoLd5wJzDQcEtY9wslhJZ5wbWK2Mw1GRGW+ws2kVAedRrXL+XajUrI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716937170; c=relaxed/simple; bh=NqJ/UMQkZGlKTIONR9WfxT2XuYsnYeOIUcFIMUXRbvc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dsdOBE4zHzGfA6MFC3EA3jLPuVPVjy5fAvJfzgAdgB2aBM2VjbvtJKtnJztrrEhd1+/Xz9WeAJwj2J0QapkJnfi2ProXIuH0G6L75ZCnim2u4hdRTZhxD92igzEpPenvJ21rEIYt31h9+dZDrUpZmRYez44l1qjsFRR7HZtF/h4= 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=180.149.134.24 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.5]) by sina.com (10.185.250.21) with ESMTP id 6656619F00004699; Tue, 29 May 2024 06:58:42 +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: 1510693408344 X-SMAIL-UIID: 7A527889F08F47F487945A12D61DA18F-20240529-065842-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: Wed, 29 May 2024 06:58:29 +0800 Message-Id: <20240528225829.2818-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 master --- x/fs/open.c +++ y/fs/open.c @@ -952,7 +952,13 @@ static int do_dentry_open(struct file *f if (!open) open = f->f_op->open; if (open) { + struct super_block *sb = inode->i_sb; + + error = -ENODEV; + if (!super_trylock_shared(sb)) + goto cleanup_all; error = open(inode, f); + up_read(&sb->s_umount); if (error) goto cleanup_all; } --- x/fs/super.c +++ y/fs/super.c @@ -503,6 +503,7 @@ void deactivate_super(struct super_block { if (!atomic_add_unless(&s->s_active, -1, 1)) { __super_lock_excl(s); + s->s_flags |= SB_DYING; deactivate_locked_super(s); } } --