coredump: accept any write method
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 3 Apr 2015 19:23:17 +0000 (15:23 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Apr 2015 02:29:39 +0000 (22:29 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/coredump.c

index f319926ddf8cbc5cc90a003628bf500701ce3c25..bbbe139ab28020244f62011f44869d1529cd4b05 100644 (file)
@@ -657,7 +657,7 @@ void do_coredump(const siginfo_t *siginfo)
                 */
                if (!uid_eq(inode->i_uid, current_fsuid()))
                        goto close_fail;
-               if (!cprm.file->f_op->write)
+               if (!(cprm.file->f_mode & FMODE_CAN_WRITE))
                        goto close_fail;
                if (do_truncate(cprm.file->f_path.dentry, 0, 0, cprm.file))
                        goto close_fail;