Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp143127lqe; Fri, 5 Apr 2024 16:03:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoHfQGo4YdDKZrJicbTYpsQ9K8Ha+sc1AINatsnQoEe9f4ZJSxP+/TS3/qAXBKm8GaSLUfjw3E0A8dlQd+D7Xvx+AKS9M0G5KVyyIGJA== X-Google-Smtp-Source: AGHT+IGeR8NiJXcggbUraOoi5BGe3fagPsb6nrtK12i5XN6mXTzv0XVgx5t+IY6G1i0PbWknlHdO X-Received: by 2002:ac8:7dc9:0:b0:434:45d2:43d9 with SMTP id c9-20020ac87dc9000000b0043445d243d9mr3377582qte.45.1712358195041; Fri, 05 Apr 2024 16:03:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712358195; cv=pass; d=google.com; s=arc-20160816; b=aSytQ9nziAqtKv/IeCbzFD6fh9Jv7CNV85rqL5JHSp7MyJS2fR2HHLLzHmq3sRNuGb DU/umzHffBZAiYsPzk18Tf9FVzj+3h524X+FVDOG0f3fnVG1Vv38Ky+5iZ+l3NjORWm0 Q7T2NGbtt+Ddv2ekSX6c/62sQiR8o2//eJBIlQNeQ3BcyoBNbOtiEpVK7XU4vWCUGe4a gC3GiLIbPifDEFFJkzmoyBtmRh6VeSHYk6AiGTjuE3DgVvRsNEkFWps5PF7oKBqz6QT2 KDn/qx/bjsaQC6OL1CrKP87LLAC9rJnXSN5lahD5CQXVC7AxzNdLoBtXGxk59tw6KoS1 1/5w== 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=1dsX97++1FNLrPpXqtJfiC9Qsl/U1Anqwe2tNbEt8NA=; fh=LcBAW9EghRJ8Sx6xpvL+htd+Puw+6XtDoYC73G0seDs=; b=DNJXfc2W0Z4ddnSVzO6r4dXkVMrJirEkrKFiyUMkU6jITDligZPlDpoAnPGMxo9oYf Ti0m7cyK3pCR4mjKRk6EoQkI5cz7Xk30r7fOX+/RqHoph/U5xCxPXz8xJT2loOfigKDB bCjyuiYmbb9JfTwA4YU8PuzIgSq8HPM4Xh9g+dr1OiLikJk/B2W3lwW4peswKaWJFkau FvI1B31tvMGbZSj3BbYKmaB5XfP5IxDk54ob7YN1N6FJfqiSzJSZXdJ5ZjrTPOSnsSsj TtiCz0aaQGsdvh5SjbUCShrfNU5t0LCX3w+fuUWGqPIGx4EF/MZyaFO1oUgOynR3RIn/ R+Gg==; 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-133701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133701-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 h15-20020ac87d4f000000b0043462b37291si2097542qtb.222.2024.04.05.16.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 16:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133701-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-133701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133701-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 BB5951C20ABD for ; Fri, 5 Apr 2024 23:03:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2386B36134; Fri, 5 Apr 2024 23:03:09 +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 5305225779 for ; Fri, 5 Apr 2024 23:03:02 +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=1712358188; cv=none; b=GwWL5EZJXO8CfLCmx7cqu7OzYwbdF0J2zO2C8KgwzB88WnqvSQc02WNclHOwGvqjD3Swx9nTABwSa81ZdrzqMogaNCS032TTRKjCF3lUoNQdPmpFajzy2WFtgOCgCDC4MjANhGNMZXAF/ZxQXAYNKtXJJtCwPeb0u+Pog6IoNFA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712358188; c=relaxed/simple; bh=yp8bXWKt971m/CugiQigGsvhT8uE+bI43VycNG+dneY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LGu15HgWjpK6J6gDzyXWabz2boBmyMCd9KRDJr/h6qgPP1uKLPlHc6peheoIbKd9kVMXcrBIx6yTIKmDMHupFDKAJNckbxY1UVq9SueTO15HWDfosvz1+99jB3wQ9QUbJ3IQRqK5kB863tUsUHrgFqn0DJEv6bIV6tYMlo9Y778= 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.88.50.84]) by sina.com (172.16.235.25) with ESMTP id 6610831C000068F0; Fri, 6 Apr 2024 07:02:54 +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: 27287034209900 X-SMAIL-UIID: 0F9CB25F9C5A45A8A2B4265056941BB0-20240406-070254-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [kernfs?] possible deadlock in kernfs_fop_llseek Date: Sat, 6 Apr 2024 07:02:43 +0800 Message-Id: <20240405230243.1067-1-hdanton@sina.com> In-Reply-To: <00000000000098f75506153551a1@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 Wed, 03 Apr 2024 11:23:26 -0700 > syzbot found the following issue on: > > HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel.. > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15c38139180000 Test Al's idea. #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fe46a7dd189e --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -639,6 +639,8 @@ static int kernfs_fop_open(struct inode */ if (has_mmap) mutex_init(&of->mutex); + else if (file->f_mode & FMODE_WRITE) + mutex_init(&of->mutex); else mutex_init(&of->mutex); --