Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1238459lqs; Fri, 14 Jun 2024 23:49:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsG1fm54ie04ti66ihnaUQix1ET7L/FJ4ZQ7Ty9YmZyAgCgukIPjZq+KwhYCHdZ5RTcA+KT45eQaxc8t9zjyRYTcMs+oTQM6fC9q2naA== X-Google-Smtp-Source: AGHT+IFD6hiyLqU/+tScMd7ITMFO35+JQZsejuqDalRwS+abXvov0TipfaIEB/qINglFp4zzD3Jp X-Received: by 2002:a0c:c481:0:b0:6b2:b9c7:da6a with SMTP id 6a1803df08f44-6b2b9c7db66mr27905326d6.41.1718434190081; Fri, 14 Jun 2024 23:49:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718434190; cv=pass; d=google.com; s=arc-20160816; b=bwycwqhgMuQOJeuPPj6bZ3CUZ+EgJ2zgsiEuJ/sKmC8f7RO2qL95FnQPouHbJPyXTj xAfFx9RvCkGJpagS68+bGKhi8aMC6gRU91AZ7F6WNZoBryaXGs/KLKk83f+ZHxri8KwP jZ6TYLm4k33nqEH+o2vyO0hGMKEUFgxMDCgmS4ibiUTVGd0hg9OOEVi5vs97KwJHmXuK meUUAsLESd0zv6b5MKEDevjHNz3CezTj4Be+iJTMXNNHtIW+P40jl/6VYva8J9Dd7H1a L54C7xKJ32jl6wev1pJtRNoZmshX619VMgCk0SLVcFyzfThtAHE/6DvCP3tSUalZlhMr cPAQ== 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=mh+zfqiYOUbHOKp5WNlcLsbENQYCC3QfdIAZUpRp8Tw=; fh=yaXYBe9sbkmvlk2mHY0QupCsCyiBqDs07jTvbP5wp9k=; b=UZsf/PxkhnxXX9w/67pRsiD/2yOA812e7qyJ+fCL+t14TIne1mvikS4eWDyxGWzicG EZ8BkbV/Kjn5rsiWcKa9n0ech1/RC2Y8uYezwD20l/D+2upwyaoDcKMaKI8MP+MjM2wH p6hWzf+7rXn9nbZI3Ix0gdY1sDpWq4pyYhiD1oHsHlP3te9R13ISVduCNO/sORie18dD Xt9axKLZhJu516Rt+P0w2IsvriNFivI9KGoNhy7xGa8O0GEUD/G66OLeTRAUhDHLm++7 OvN7NOk5qYCT+We3Dd5WmGUlnHWStRj1N5V7SPYnggwPC9EeEa9Wbj1SEkWxGoSCYu38 S+Qg==; 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-215732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215732-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 6a1803df08f44-6b2a5b89686si54305136d6.572.2024.06.14.23.49.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 23:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215732-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-215732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215732-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 CE6421C2194E for ; Sat, 15 Jun 2024 06:48:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94470171A7; Sat, 15 Jun 2024 06:48:47 +0000 (UTC) Received: from smtp134-33.sina.com.cn (smtp134-33.sina.com.cn [180.149.134.33]) (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 48F8EDDBE for ; Sat, 15 Jun 2024 06:48:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=180.149.134.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718434127; cv=none; b=e1Te5i+DCcTlVK1T7BClxzbPzThFChhjYbrlwQXzDzAaTTriW9I5vCE9cQi3Kmce4YlyWMVT1nD2hAjhrGCMIQHtXaxwSHaCRxAC4NkIfMLr0FqvbAOK5L5M3pVrdOLdOLxXVL4n0WmiBo6nBW1xFi0jkiBPaS57EHm2cvIe9Nw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718434127; c=relaxed/simple; bh=VCqHrKLRo7upK5Vo2G01ygKx2d1eckndZ0nekF0lCoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=by7Oirl89065tJZgTTgaucaVq/tpg3UduRpX6gHFD0fUv3t6uKXTKubkhawwNURFzklCHW9C15rt5lwgJF563zUdwn6fPXFTqD7ohywP7VsxfG7h22QiCA6ZYHpxtxewm3mF55C5KEs4FOuRua5g3qsKpdJX12A/bIvBx46rW5U= 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.33 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.64.228]) by sina.com (10.185.250.21) with ESMTP id 666D3919000012C2; Sat, 15 Jun 2024 14:47:56 +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: 2166303408544 X-SMAIL-UIID: DB5260639031462D90B6A8AA36523E06-20240615-144756-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: Sat, 15 Jun 2024 14:47:46 +0800 Message-Id: <20240615064746.915-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 < 1) + 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; } --