From 6a381f532a0a998cb464d6fdaf5956b1446014b1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 3 Apr 2015 15:23:17 -0400 Subject: [PATCH] coredump: accept any write method [ Upstream commit 86cc05840a0da1afcb6b8151b53f3b606457c91b ] Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- fs/coredump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/coredump.c b/fs/coredump.c index b5c86ffd5033..4c5866b948e7 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -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; -- 2.43.0