Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp106354lqs; Thu, 13 Jun 2024 05:26:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7yB3t9Xb7Ca2IcMf9oq2iPZ/QpC+B9dWNDvJa8O77GY+a9CHHbMZ9N4FSEnAg8I7fwUcm5Dn3ur5uw05cz4Crdg7dsDqWbrO5ITemzQ== X-Google-Smtp-Source: AGHT+IHdZeVkjOUCLBfeM3V/un8tExLShNjv+4OyqvjQ/50DKVbFCundNhO3FJEbyxq8hb0KGIo3 X-Received: by 2002:a17:907:7248:b0:a6f:4ae3:5324 with SMTP id a640c23a62f3a-a6f4ae35422mr311640166b.40.1718281609345; Thu, 13 Jun 2024 05:26:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718281609; cv=pass; d=google.com; s=arc-20160816; b=TQNF5wYc6nCGZ4aXkwQk92/TOJbU7+q9no9qrSbgF4GRxV8G12X4rcboBY8eDcXG0K un0kDFqKv4KuSC1ci82mF/k3izmz/i7l7nG6fAdh3lkvUSjQMKXxmm7rnsut3YemDMtP Q7MnSHYMlfCZsgYuJCkgHong/7cG2qcrOAAib7i2iOSr9jDkNYM1jg1Xgqlna2y5PBJs o4X42JSMCqmvHDiFEeDCC+rp0IQ2C05hLLm6WwRCCRZyjHa5c1EGznOJFJBieQ++nIO1 sH7C64mnW/+0TRuxL0T6QFgznMVFO00mWl+X/jM/q5HqR2Uf6gMXAwXH3hi2Q8LhgFI6 QHIA== 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=RpMR0S1q+rrCjq8Q7SCHcAFbc33anwVa/ztg6Ndus8Q=; fh=saDFzb8XH/fsyCAPCgnXHQYabHFgY8pQa56eeXK7xBY=; b=VZlmblODW85Fz/ehXhcLV86lHb0sRfH/Bi/cF5ZZHo1Ob5Fd3OH6OAzwCoyR26jNqK OuC9uhlRNcsHIIcxzFoJg2A3lpdw7DijBsAv6QrVeZq/ID3pQNr/M/y8wgNCiW7yGsb7 0Y4vZr2HY2bMqCaSoN0KLgxWrkJKriTu5pzVI9W6DxU83yN9GV1p7bgYCcqEPcy9eK4c Pb0nKMA3mSTF2APBCDLmszVQdOmCJdDOj6ASTzCJmgb7mW2Jq2/a1ph+uNZqdZnJefK1 cY7KRd5+9u14vFu9ISZOfaTRVWLbxIA4fWh9DHpR9ld+/ll+OOMBG7QHQ1lAg1GiqNzy UYyA==; 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-213196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213196-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-a6f56e8874esi64822966b.1047.2024.06.13.05.26.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 05:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213196-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-213196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213196-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 13CB01F23173 for ; Thu, 13 Jun 2024 12:26:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D20B1143C62; Thu, 13 Jun 2024 12:24:50 +0000 (UTC) Received: from mail78-59.sinamail.sina.com.cn (mail78-59.sinamail.sina.com.cn [219.142.78.59]) (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 BFDED143862 for ; Thu, 13 Jun 2024 12:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.59 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281490; cv=none; b=Ft3oLOgr/8SK8IioDGgZqa6Vq/yyR1HGYM+i0LYGMxIKhyW19u2cVDemUFQ+eZvis8VmzpzOs2cwiarXVmWcBkKLtMB2cKg8KuwQqSF64ogVcojuXcClwR+9JRggbsOr03MR7PjWE9pgusJWZF91NO852uHrEzrXzpQweoEqSvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281490; c=relaxed/simple; bh=7We2bvNl5nFvDw809iHtNB16S7nkGWtlhJVZX9TGoRs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=W3WFPvBb2dtNH7imLdmJop1FUxaBdOMrvzVnpIA0rKzup43Cg57XxqqxhJrMWzI2bip8LoX7xwOzhsR18z79zj3TgUx1GLU3Q9vk76khnZtMt7BenvugU93UB8Q92Eu6FORZb1UVg57MrNw62m5zRaa4fx2zkvxKztwC1qIM2L8= 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.59 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.164]) by sina.com (172.16.235.25) with ESMTP id 666AE50500000A9D; Thu, 13 Jun 2024 20:24:39 +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: 84370834210205 X-SMAIL-UIID: 37D6C9A50F9D47B690E611B413EC973A-20240613-202439-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [nilfs?] [mm?] KASAN: slab-use-after-free Read in lru_add_fn Date: Thu, 13 Jun 2024 20:24:28 +0800 Message-Id: <20240613122428.2455-1-hdanton@sina.com> In-Reply-To: <000000000000cae276061aa12d5e@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 On Tue, 11 Jun 2024 11:10:20 -0700 > syzbot has found a reproducer for the following issue on: > > HEAD commit: 83a7eefedc9b Linux 6.10-rc3 > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17c645e2980000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- x/fs/read_write.c +++ y/fs/read_write.c @@ -570,6 +570,7 @@ EXPORT_SYMBOL(kernel_write); ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { ssize_t ret; + struct super_block *sb; if (!(file->f_mode & FMODE_WRITE)) return -EBADF; @@ -583,6 +584,9 @@ ssize_t vfs_write(struct file *file, con return ret; if (count > MAX_RW_COUNT) count = MAX_RW_COUNT; + sb = file_inode(file)->i_sb; + if (!atomic_inc_not_zero(&sb->s_active)) + return -EINVAL; file_start_write(file); if (file->f_op->write) ret = file->f_op->write(file, buf, count, pos); @@ -596,6 +600,7 @@ ssize_t vfs_write(struct file *file, con } inc_syscw(current); file_end_write(file); + deactivate_super(sb); return ret; } --