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]
Message-ID: <02214d48-6aee-40f7-9a40-60b4091b5bfa@kernel.org>
Date: Wed, 14 Aug 2024 11:33:32 +0800
From: Chao Yu <chao@...nel.org>
To: Edward Adam Davis <eadavis@...com>,
 syzbot+78ff2855f26377625419@...kaller.appspotmail.com
Cc: jaegeuk@...nel.org, linux-f2fs-devel@...ts.sourceforge.net,
 linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [f2fs?] WARNING: lock held when returning to user space
 in f2fs_commit_atomic_write

On 2024/8/14 8:48, Edward Adam Davis wrote:
> unlock i_gc_rwsem[WRITE] before quiting f2fs_commit_atomic_write
> 
> Fixes: 7566a155c666 ("f2fs: atomic: fix to not allow GC to pollute atomic_file")

Since original patch has not been merged, if you don't mind, I'd like to
fix this issue in original patch.

Thanks,

> Reported-by: syzbot+78ff2855f26377625419@...kaller.appspotmail.com
> 
> #syz test: net-next 9e6869691724
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 741e46f9d0fd..a43054ab0cf1 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -389,13 +389,13 @@ int f2fs_commit_atomic_write(struct inode *inode)
>   
>   	err = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
>   	if (err)
> -		return err;
> +		goto out;
>   
>   	/* writeback GCing page of cow_inode */
>   	err = filemap_write_and_wait_range(fi->cow_inode->i_mapping,
>   							0, LLONG_MAX);
>   	if (err)
> -		return err;
> +		goto out;
>   
>   	filemap_invalidate_lock(inode->i_mapping);
>   
> @@ -407,6 +407,7 @@ int f2fs_commit_atomic_write(struct inode *inode)
>   	f2fs_unlock_op(sbi);
>   
>   	filemap_invalidate_unlock(inode->i_mapping);
> +out:
>   	f2fs_up_write(&fi->i_gc_rwsem[WRITE]);
>   
>   	return err;
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ