]> Git Repo - linux.git/commitdiff
coredump: call do_unlinkat directly instead of sys_unlink
authorChristoph Hellwig <[email protected]>
Sat, 4 Nov 2017 10:44:46 +0000 (13:44 +0300)
committerAl Viro <[email protected]>
Fri, 10 Nov 2017 13:48:49 +0000 (08:48 -0500)
And stop messing with the address limit.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Al Viro <[email protected]>
fs/coredump.c

index 0eec03696707f03d498d1e4596c1c2cfdbb66873..cd72a4ca0cecc8723ca0114814fc8d3fd8a19367 100644 (file)
@@ -679,16 +679,11 @@ void do_coredump(const siginfo_t *siginfo)
                 * privs and don't want to unlink another user's coredump.
                 */
                if (!need_suid_safe) {
-                       mm_segment_t old_fs;
-
-                       old_fs = get_fs();
-                       set_fs(KERNEL_DS);
                        /*
                         * If it doesn't exist, that's fine. If there's some
                         * other problem, we'll catch it at the filp_open().
                         */
-                       (void) sys_unlink((const char __user *)cn.corename);
-                       set_fs(old_fs);
+                       do_unlinkat(AT_FDCWD, getname_kernel(cn.corename));
                }
 
                /*
This page took 0.063942 seconds and 4 git commands to generate.