Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1133858lqs; Fri, 14 Jun 2024 17:05:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrNLKmpok3Ohh9jKuDhbzhigwaiXXmmni001XVjESv3gJRYNS9/TwHg4MhF1WVcLh63ETkLHZZVffFXjlFE7kDEtf+o/+M02aRrf6pNQ== X-Google-Smtp-Source: AGHT+IGOsIs9ewM/Ai/IeGIf3aU3TRjBY0U+XAXcgtHYRminr4s/lQQ+jMdz2O6sZx37VG/m7tmR X-Received: by 2002:ac8:7d95:0:b0:440:583c:6e1b with SMTP id d75a77b69052e-442168ad9d0mr41449701cf.25.1718409945003; Fri, 14 Jun 2024 17:05:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718409944; cv=pass; d=google.com; s=arc-20160816; b=rUTor+WbtTiNVQNwnap7VLDBPbDPdfNpjSnef+c8CIqQkLGqZ+U/nMAlmRqzZ209R8 HovuIOAMFEzS7DC3TJbos1SZeMacFTUDwWk0v5k3tQQPfNWZHhuq5j82+8dEM8unzHoV kJeczfTHo19YRM2fBbZ4dfBPg4+4oxYkjfx92p7eYsn9+8dChe0KC+pkktuIIeCzldw7 zDYOVDWnLnPhfLt7tIydSmCjsM0jSKthmviAzYUd9k2hchdrTPvJMYn26qiu2HKgYlYf H+Uj1ZmC3NccL8JYSrhCRLTuKYtqutXMGSi79TdkjV6kFgOc/SQQLLbv2YxZ0+uh/pLf SJTA== 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=kHdqxFYOCvpoDqQD2H46cmN5+mroAJVXJaoOQ6cvsFw=; fh=yaXYBe9sbkmvlk2mHY0QupCsCyiBqDs07jTvbP5wp9k=; b=PuexzVNLbqNvTaghlJONdy/IML1V+mcgSnMVg2yy7pXMOP962xZ5exlCcMdwRN7a8t fsTp5OX3F+f2IFdIVqp+woevdBJkxo2IGUZ/URrKg0U8wVwq7U6LjorM3rxqe1UKd69x WIPH62bQgJjy6UTGZ7VgDjsayvDV+DEirveb+mLDWNECg7iOZMeGUXKOGoX5YWl1Z3lD 9sVHej8rFdjpoFLEYv23qjSFpH/7hrNKG2S9nfZeIbiUKVpnZcvxcie7S4/v+2SUZubg OQm3PrBc5JDQItBUSIn0SvHzunN5E8SnsGSQGZDlkVDKk017mIrwuBZptUOS8Ks2+zZe BfNg==; 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-215615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215615-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-441f3129861si47793141cf.790.2024.06.14.17.05.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 17:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-215615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215615-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 B5CDD1C20D61 for ; Sat, 15 Jun 2024 00:05:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B19D9645; Sat, 15 Jun 2024 00:05:38 +0000 (UTC) Received: from mail114-241.sinamail.sina.com.cn (mail114-241.sinamail.sina.com.cn [218.30.114.241]) (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 12250624 for ; Sat, 15 Jun 2024 00:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.114.241 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718409938; cv=none; b=ceXktShEa68lNn2s3OnIM3qKEQ9x3XpCTF6DwD4Ac1jxNbn57XvgSQNC3WN0juq9SvuqpTmbK18cp+/SvsqPPM3p+XUbP1G1FLWe4X1et7B9Sn+5mM2UZO86wwBKbQo5O5QmTVPDrikejut+W/+xdaFkxbd7Mdp+Kz1mE0E35f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718409938; c=relaxed/simple; bh=Txqx05lA5LCNNLfiBhVlh+gJ8bDP80qJQBV6kbq9pbA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EMpsiFV2GvsVxRGeae/HWLJEuz2Jk3K4CPBLS6618KCUV1Riu3808vQP0IEkY6uiWMJsTtGpcujhEox7K0i0BtrtFu1quH4W/2kBZTV4mBYPrD2SJbNirK7YO6+CIvQVOAUlP4JxabRuIbNeFOyicp5XZNYafN0SN+wfTk7BizM= 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.114.241 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.71.75]) by sina.com (172.16.235.24) with ESMTP id 666CDAA1000029F8; Sat, 15 Jun 2024 08:04:51 +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: 22004145089287 X-SMAIL-UIID: D5AD2C2BE59F4C98BAAE19EB3E4F858D-20240615-080451-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 08:04:41 +0800 Message-Id: <20240615000441.861-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; } --