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: <20201206091618.GA22629@nautica>
Date:   Sun, 6 Dec 2020 10:16:18 +0100
From:   Dominique Martinet <asmadeus@...ewreck.org>
To:     Chengguang Xu <cgxu519@...ernel.net>
Cc:     ericvh@...il.com, lucho@...kov.net,
        v9fs-developer@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org
Subject: Re: [RFC PATCH] 9p: create writeback fid on shared mmap

Chengguang Xu wrote on Sat, Dec 05, 2020:
> If vma is shared and the file was opened for writing,
> we should also create writeback fid because vma may be
> mprotected writable even if now readonly.

Hm, I guess it makes sense.

> Signed-off-by: Chengguang Xu <cgxu519@...ernel.net>
> ---
> Caveat: Only compile tested.

Will test later and add it to next then, might be a bit.


>  fs/9p/vfs_file.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
> index b177fd3b1eb3..791839c2dd5c 100644
> --- a/fs/9p/vfs_file.c
> +++ b/fs/9p/vfs_file.c
> @@ -516,8 +516,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma)
>  	v9inode = V9FS_I(inode);
>  	mutex_lock(&v9inode->v_mutex);
>  	if (!v9inode->writeback_fid &&
> -	    (vma->vm_flags & VM_SHARED) &&
> -	    (vma->vm_flags & VM_WRITE)) {
> +	    mapping_writably_mapped(filp->f_mapping)) {
>  		/*
>  		 * clone a fid and add it to writeback_fid
>  		 * we do it during mmap instead of
-- 
Dominique

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ