Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp782817lqs; Fri, 14 Jun 2024 05:48:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVgZh/CQRhOZkFdjMZfF7N+QLl8dizkqsX9tL8HthpFozgT5eyJOKWWwBb4jCnRINr71jFew3gIj+tAvqErnXoWnFiaLaz4iIwOrEQpQQ== X-Google-Smtp-Source: AGHT+IHNMdO7NE9uNFb8jCBjvrndCMwBuEwuk5Pk/NdFbDBAyRwvE1RrGfYUaL2S/bZmOWp8UWhc X-Received: by 2002:a50:cc9a:0:b0:57c:61a3:546 with SMTP id 4fb4d7f45d1cf-57cbd67c8acmr2094227a12.21.1718369323990; Fri, 14 Jun 2024 05:48:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718369323; cv=pass; d=google.com; s=arc-20160816; b=G1jTCraQtcgwqLRYdATubIjvLKBGJEC6SrCxwzawxMNKtP+0llpbx3Ih6UbsU0IDiM JeQ2XKwBCDv263HQNvQ+bFComymRXAarqLsSpSNMJ+BYmVwbGVSSHa4Q/x8xnJYyiOza +4t4obfSfoe0itj8daUv5tNBB3w1vtilcx5sB8Kr5SXKtAGKXLeeaklyV46TD0COV4co EdmIDCjjfwTTcY9SpJj44Tg3HUXs3jhcUYcdGty0tILDHxfMi+u+hJV7lHKjkZVUyC2e 0s5q76Zb0TMOadWyLwoHH5IhQPXWFUVzKaB/5vnNzS8W2eYwW90C1ZY7ioSL+rvj8lCr Mt7g== 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=KG/pLEZiqRyM4rCcP6yrlOOMP52LdpwT5srHMFJgtWI=; fh=yaXYBe9sbkmvlk2mHY0QupCsCyiBqDs07jTvbP5wp9k=; b=GZ/S4iUNRxlAewGJfYfc0LN/cp2bwA/ix6k1ZDP6lF5LqV7rPO0VY38+NMxp7qVy3w E6HjvNDZ6ucyt4I+Qp+AakaZ09LlP5lLj6T70NoiZwlUXKkbDqcuHeCls9gQRIHMA7ly OmChdCCsBaVjCl9ghxjpo4h+BLxsPAHhQEy91UX0PFuDr6tQ3oWY6QqTTE2q2OiPBS7x kf1MnLseAjo2F0/RJFXIfl86KCtds4/GOvKcHXazmxH5zPX7vnQwalYO1Q0nxz/2J3XE nnmsmxK33xBVIyZRHwZl7LkdQhY+hGuXRBwPhWqnN+EBUvmpBozHtoIeBxCemR41PJqV 6KsA==; 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-214916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214916-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 4fb4d7f45d1cf-57cb72e2162si1785208a12.156.2024.06.14.05.48.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 05:48:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214916-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-214916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214916-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 B3D9D1F2797E for ; Fri, 14 Jun 2024 12:48:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9848199E8C; Fri, 14 Jun 2024 12:48:36 +0000 (UTC) Received: from mail115-100.sinamail.sina.com.cn (mail115-100.sinamail.sina.com.cn [218.30.115.100]) (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 18B47195F1D for ; Fri, 14 Jun 2024 12:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718369316; cv=none; b=bRR2jv/8sdgdi7zha3aEUaynO3q8CXVlbDNnT7dABcag29BwiE/xpf9+K89Hq8S3AoDc+FSU+Z5b6+qSW9i4ht/O3yQ799EZQ+G/mLY5U8DQdaJByFJfpRRkzY0QEiiEo/kFKmcrw+pp54ANvgX1jU/4c2mNkna4MDgyIh0sCSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718369316; c=relaxed/simple; bh=RnmKOna3nYue/o4cvIy7xgOLKViUK5SNZJN5+9nxjrs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eQa0XnaB5VvVhawjnzWO9LGr/AFZhLYbDWhEDLa2VsTGMMbPQxh1vj7/eSURKxqYuasKegBQc7wWLwdJ63irLFk6W2q1LP4EDJHNC2pRJl4ZWlaLfkgfCtZrGRfwD3s2M1/F3TdMA5Wg1rVR031YZJygOr6uYGzHxZkexPNyEvE= 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.100 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.70.97]) by sina.com (172.16.235.24) with ESMTP id 666C3C1300007525; Fri, 14 Jun 2024 20:48:21 +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: 65500945089441 X-SMAIL-UIID: 2912F4638ABA4588BCB67CB5842AE2A2-20240614-204821-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: Fri, 14 Jun 2024 20:48:11 +0800 Message-Id: <20240614124811.689-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 @@ -952,7 +952,18 @@ 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 = -EINVAL; + for (;;) { + int a = atomic_read(&sb->s_active); + if (a < 2) + goto cleanup_all; + if (a == atomic_cmpxchg(&sb->s_active, a a+1)) + break; + } error = open(inode, f); + deactivate_super(sb); if (error) goto cleanup_all; } --