Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp145820lqe; Fri, 5 Apr 2024 16:09:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWs+5Jyw6veMPQyzYqpWUAHXBc1BMJ2UCKDztXcYex4ZjceU2qcGI3oKD6Ax0clZqxmeT+SWn7eyR2kyyyjHHCtbdZPAKnXdb87iqo8kw== X-Google-Smtp-Source: AGHT+IHhrV8eLiAB+Wgp3900HMLRmlX5AZaMDzQzIRY+JCoK5OStsC8/cKRU6A5n8X9p1fxrW6yR X-Received: by 2002:a17:90a:ce:b0:2a2:9658:7cfa with SMTP id v14-20020a17090a00ce00b002a296587cfamr2540075pjd.28.1712358550295; Fri, 05 Apr 2024 16:09:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712358550; cv=pass; d=google.com; s=arc-20160816; b=fbyGFENIhF5P69HolzoeuNYTLeWItx+Nk+bj98kIOKkUqZvf+6MZ88Dyx+541oludx ZR6PZA08H3YWn16o4UyZmBIBeJBGhQYdfkLpJh0iO14n2GYW0QYzUeaEFMDJtDCDQWYd N6KoDyNzEhs64rbBIWMtrk+9klg3867ieZ0BEY0HZt05IxNcpTnYjkYFwEWyGEVEdH4f wsXaM3ki+8FmapPBRcKjOxcuts5nV/0QJf4/ZqYLpTwPSgFjz9EcO8WZzP8dD3dsMJGM ZIf/QHqI/5eM/MsS4Zbo5CBIlIlqzR43E7Q4b4ypatXCGObuVzTUmsWjChraV7OKG/nb hzeQ== 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=0T2F5hJaiDhht/5CF7b+lbMF0Z2B6L94MU3xEMlltSI=; fh=LcBAW9EghRJ8Sx6xpvL+htd+Puw+6XtDoYC73G0seDs=; b=zHx+SzdO6wlVUcSK84l+X4NaJ68Et+rxG4wGBOmPqyvek8cgWRVnMmfFDCl5oSgo/c Wi4Hq9xq2oTKR3C6WPq83RFrd7vtEUmwmeJbUgzdSL4ySzueuICJbslb7n/7XxCcP2eJ NZOd4AC00RK/8Vwj51TTpLdvVY/MdtlMTFYsMXdOVlAw9G1JCoX5ybgwdwvH8KJ+4F9R X1kgkiq08xID195qA3zu5nfDkrfPyfeiPEbNCYtZT6Uv95JIFxfT2Dez0GUaeRWk0I1h EucXRmdNQsudhK8YynZPQrolxUtJ7MR8r7vza+w39ne5XKI9mY4Ry2A3L9CYlF8zk3us iFeg==; 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-133698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133698-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id qe2-20020a17090b4f8200b0029c762ab90asi2250223pjb.98.2024.04.05.16.09.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 16:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-133698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133698-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0F001B252CA for ; Fri, 5 Apr 2024 23:01:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6ABE5374EA; Fri, 5 Apr 2024 23:00:54 +0000 (UTC) Received: from mail78-36.sinamail.sina.com.cn (mail78-36.sinamail.sina.com.cn [219.142.78.36]) (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 BF49E339A8 for ; Fri, 5 Apr 2024 23:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712358054; cv=none; b=rcqwU5rl6HJGPqgOvEK99e0y4GY4vzvJXCnKlkRNFw24XifA/Nzvy9muaPd/KIs1ybru8WaMnZ2mo1c9oRpJqafquJzx+xHEusE6Lrqa+MGUp4NKHTUbqJ/7w3203dGEzVUw4kMsRNFpiT5a7ahBTv6meT/Y6/U7pv/kBY19RqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712358054; c=relaxed/simple; bh=fDaacRuJjZ0W6CSEWRuV5+rg4i4M0HC6nt/XMdAZ54I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lHoSMISmbcFSrQTbCC5JOBXqRhTKby2TFU8llUlIoBiTSDxNrvaOAxYSBmPNb0eHq6+/Ub6VYhrMJp1Zfcl7BMQuop2RaDSr8OcRwHI2CO1DD1/GZkkc+Q89uRK/M0mUBpj1NqWnN3l3QtXYvBTQwW+3Ux00tA2VcQsBEcvPcrk= 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.36 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 6610829B000035E8; Fri, 6 Apr 2024 07:00:45 +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: 67406234210258 X-SMAIL-UIID: AA7551CE4CBD429480E43B05BE660891-20240406-070045-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:00:34 +0800 Message-Id: <20240405230034.1015-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 --- x/fs/overlayfs/util.c +++ y/fs/overlayfs/util.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); --