lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 6 Apr 2024 08:34:02 +0300
From: Amir Goldstein <amir73il@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: syzbot <syzbot+9a5b0ced8b1bfb238b56@...kaller.appspotmail.com>, 
	brauner@...nel.org, gregkh@...uxfoundation.org, hch@....de, jack@...e.cz, 
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, 
	miklos@...redi.hu, syzkaller-bugs@...glegroups.com, tj@...nel.org, 
	valesini@...dex-team.ru
Subject: Re: [syzbot] [kernfs?] possible deadlock in kernfs_fop_llseek

On Fri, Apr 5, 2024 at 7:23 PM Al Viro <viro@...iv.linux.org.uk> wrote:
>
> 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, struct 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 different
> +        * lockdep key, because the writable file /sys/power/resume may call vfs
> +        * lookup helpers for arbitrary paths and readonly files can be read by
> +        * overlayfs from vfs helpers when sysfs is a lower layer of overalyfs.
> +        *
> +        * All three cases look the same.  They're supposed to
>          * look that way and give @of->mutex different static lockdep keys.
>          */
>         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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ