Message ID | 20161005143854.17133-1-kilobyte@angband.pl (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Oct 05, 2016 at 04:38:54PM +0200, Adam Borowski wrote: > [fix for dedupe-vs-exec ETXTBSY] > Reviewed-by: Mark Fasheh <mfasheh@suse.de> Hi guys! May I ask if I'm doing something wrong, or barking up the wrong tree? I've sent this patch thrice (May 20, Jul 18, Oct 5), pinged once (Aug 6), yet it hasn't been taken nor NACKed yet. For fixes to vfs core I need to bother Al Viro, -fsdevel@vger, -kernel@vger, right? It's not a vital fix (strictly speaking, it only allows to fix userspace), as save for unprivileged containers, when deduping executables you usually need to be root anyway -- but it'd still be nice to have it. It has been ACKed by the original author of that code. (Sorry for being annoying, I got only 13 commits elsewhere in the kernel so please point me in the right direction when hitting :p) Meow!
diff --git a/fs/read_write.c b/fs/read_write.c index 66215a7..8ea5297 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1741,7 +1741,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same) if (info->reserved) { info->status = -EINVAL; - } else if (!(is_admin || (dst_file->f_mode & FMODE_WRITE))) { + } else if (!(is_admin || !inode_permission(dst, MAY_WRITE))) { info->status = -EINVAL; } else if (file->f_path.mnt != dst_file->f_path.mnt) { info->status = -EXDEV;