Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp250218lqe; Fri, 5 Apr 2024 22:34:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiyOcrnSPHgYQdyLrYHvqWpoOA1FGMF5c4drvlfRVqt+0kwpbv3QYU/r+bfS77FzxBa5ov4aYdqUTRwVXt6FzsK/1npyzy4bDtz4L9rA== X-Google-Smtp-Source: AGHT+IFz5kQiuiSyQwZEJi7J+k/WYVdy9xsiic9DuEUHCdtZQngfDextv0cZxa3ugFaufWkfIBdf X-Received: by 2002:a05:6358:2191:b0:183:7d27:c07b with SMTP id v17-20020a056358219100b001837d27c07bmr3549172rwb.32.1712381673294; Fri, 05 Apr 2024 22:34:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712381673; cv=pass; d=google.com; s=arc-20160816; b=TnLNNKhN3J5UbTiDa5ELNhhvarfKDBllUnp5Robq5gbZ4E9gDOdY6J1elGFQmAkhxz tUzid63CThCfdmJYtQ/I4sEX2hMZo7xueAwXZ3+UsUqV24PCQ3OuQHCcguzqeUfiJwGU jLQ4W8lU1vVvnghS5kvmSZQESu7DLCfsTvFZERZWPVbvvWm8FewFV59xN8G0kx/uVErD hojRjzaRKgV660r0GFgAZn8qaDzOIgPeVnq08y4EX++0+LnSAb2fxXIaRhypxMjoBfgF 8hfyFezs8hf8cEUoq3zPS/2XfKTVptDOzEYhRsFGr2YPSGq7nACKKvK/INFhEL0rvoVC Bdvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=y+J2wZBHLKqPS/mVbQJu/RljYJnB9FBy3Yw/ZVeK47A=; fh=L/5a+R61TRZCmG7GkUZNLwttSa8HlWWc1NW5WYqQQSk=; b=xLedBtcHklrsIZmLFYydv/SOKLBijmfS6Uvru2QjD48Z9FupZYB7iRcusuobVruJNK 1tN6rskj2BUb1BtA3klgsbg8TxlnHndXEQRf70JhU4eCJxqQ35DjlL85wtRY+wOh44Vw qQcj7S27sdyRo6Wf0hMmxkIwpS3v0bEsnB3dSK7Q34xF79T0OooO3pbKZw6wPjH5K28G HWiLfI5jwR76iq8RmAhgQa0/lPo6Zs+VLyhds9+N0pOtZroRX7+khZWdRClT3lNidG6F XZKGS5OD1FtMY2Vyk63hjfN6vG8Zdno4YLqvpK3iJIiVUdLEXDHyt1qgg6zx/CD+dygG t10g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ctyhzgDt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-133815-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133815-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i192-20020a639dc9000000b005cdacf9065fsi2568373pgd.720.2024.04.05.22.34.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 22:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133815-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ctyhzgDt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-133815-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133815-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ABAA9B21B21 for ; Sat, 6 Apr 2024 05:34:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFE2D208BA; Sat, 6 Apr 2024 05:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ctyhzgDt" Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F494A50; Sat, 6 Apr 2024 05:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712381656; cv=none; b=Fx7uH/ElgfHrEi2s13khT/SOuP7lFlrbkJX5egu6B2nO5RTwimJp8SFf9nzex2Hc7xL75+prYxwnRe1TPuLFFVM3+PDzDHJFkJD6TvYonZEGx880uO0hced5vrNBiG3JGh0g8kqP2mRm0tbcuN8GHVYQVGoqsOtBI8X5+7TawuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712381656; c=relaxed/simple; bh=sjIb0OmKeVi5cnv4+A4sEyUIYpuAgv5LPoDxz0p0v/M=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ogM5jrtoBTx+ijyaOMiZBnLacX/oY8dk2z7C/AsxmgEk1QNTN9BjIhWCFSh5ydukCksmeog94KEOx8/cp5S5Z7e5kiCxnr2Rw3yuEBoiC2YoNOeeS2xnXKxbTDPHGXJ/i2Ix64bONLMoMaDSO1igouB/52v+SVTAT9y3SGtTQAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ctyhzgDt; arc=none smtp.client-ip=209.85.160.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-4317aff5cfdso14744211cf.2; Fri, 05 Apr 2024 22:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712381653; x=1712986453; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=y+J2wZBHLKqPS/mVbQJu/RljYJnB9FBy3Yw/ZVeK47A=; b=ctyhzgDts24n7+iNmKK/igh8ClzDTPxp6WuN7PoSANyqgMu3DgaXbcnZ2YF2RBVvWp KVOO0k/cndvbX5c3Q21GoXp3h8aKZ71qcxsXEgiqvsy6VG6b16svgcvN2GGhr054DgBd jyUOuRhP48AYAEu3GKopJjyjR8x0jeOwaUqP+yJcSG432Iir11ISlD+l+TUIIXkQc+aN 4G4chYyGayzYz2CheqwLh0NnNmUsnd3Lpvqj5DcpDQ9yjSPFbeilDB+J4YJ84lqgv9/G GgYzwhZ9QK3tKjb734iN71risLald0g4u1rKrPcHyUFcD+2QVYj7ImM7yx8wDobbwu30 Penw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712381653; x=1712986453; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y+J2wZBHLKqPS/mVbQJu/RljYJnB9FBy3Yw/ZVeK47A=; b=N8knhDhbNFvAZ4M4zoR8Y6Mo7/kEimlOumbCtw7CL9P08Ji8L2U2M82z9VIpLXMQle oNeGh63uYtmjFaaGKqmXRyXNfdleHkDFGjmJQm4wis+7M9Y/4t6Rie3PlSIioVmWU9P3 KMDPzT3mXcyj+j7AOC3ck3kX4JNy7XbUXb4d8D4BYktd6Xap41MitAbzlaR1jE/QlE1v V6uw3sF0NfsDHJ+PB+VIasyKFWjgKkD54heBEzlmJpV8viqZjXZloOj9TkaQErm2N1SH 5Vev53uaZ03Tud6Cd7klGIpEGukfBNo9HDeF4aKXTPJHzvTIiCboYJed2VEt9b6kOxOn VZGg== X-Forwarded-Encrypted: i=1; AJvYcCWCdLZ7y4AGvNDplboD8wd3Ysxa7et8tuxs/QlFhy4fe2mvZZtrIrve3YqrVssNlMk2BvV6/H+RrOrQGMKIMkBusJRtgNvyKQh7OVO0x9PI98g9jdUGznGzKye0RVFBjI7JC26Vmi6oJxh4aA== X-Gm-Message-State: AOJu0Yz4DrCX13+l0x4+4AhQTeVYgfGh0xI4cHIYX9Jn12fUauFPsScM 5hk+CXY73AnV8HP2xBxL5bov5VfuFxg7fppex/8VXhpOc19jbRZthfXc6XjLjxIrG4xBCAwyYdK j5QpyBl8VGeQ9qg6iWMyA7ItOJSc= X-Received: by 2002:ac8:7d05:0:b0:434:5897:c6f0 with SMTP id g5-20020ac87d05000000b004345897c6f0mr3018031qtb.28.1712381653464; Fri, 05 Apr 2024 22:34:13 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <00000000000039026a06155b3a12@google.com> <20240405162333.GU538574@ZenIV> In-Reply-To: <20240405162333.GU538574@ZenIV> From: Amir Goldstein Date: Sat, 6 Apr 2024 08:34:02 +0300 Message-ID: Subject: Re: [syzbot] [kernfs?] possible deadlock in kernfs_fop_llseek To: Al Viro Cc: syzbot , brauner@kernel.org, gregkh@linuxfoundation.org, hch@lst.de, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, miklos@szeredi.hu, syzkaller-bugs@googlegroups.com, tj@kernel.org, valesini@yandex-team.ru Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 5, 2024 at 7:23=E2=80=AFPM Al Viro wr= ote: > > On Fri, Apr 05, 2024 at 08:37:03AM -0700, syzbot wrote: > > Hello, > > > > syzbot tried to test the proposed patch but the build/boot failed: > > WTF? The patch is > > diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c > index e9df2f87072c6..8502ef68459b9 100644 > --- a/fs/kernfs/file.c > +++ b/fs/kernfs/file.c > @@ -636,11 +636,18 @@ static int kernfs_fop_open(struct inode *inode, str= uct file *file) > * each file a separate locking class. Let's differentiate on > * whether the file has mmap or not for now. > * > - * Both paths of the branch look the same. They're supposed to > + * For similar reasons, writable and readonly files are given dif= ferent > + * lockdep key, because the writable file /sys/power/resume may c= all vfs > + * lookup helpers for arbitrary paths and readonly files can be r= ead by > + * overlayfs from vfs helpers when sysfs is a lower layer of over= alyfs. > + * > + * All three cases look the same. They're supposed to > * look that way and give @of->mutex different static lockdep key= s. > */ > if (has_mmap) > mutex_init(&of->mutex); > + else if (file->f_mode & FMODE_WRITE) > + mutex_init(&of->mutex); > else > mutex_init(&of->mutex); > > How could it possibly trigger boot failure? Test the parent, perhaps? Let's try again, rebased on current master: #syz test: https://github.com/amir73il/linux/ vfs-fixes Thanks, Amir.