]> Git Repo - linux.git/blobdiff - fs/coredump.c
spi: Make several public functions private to spi.c
[linux.git] / fs / coredump.c
index 07afb5ddb1c4e747f39b3f92a15e23d951f2fa17..3224dee44d30ed3206ec3881545a540d6c59db56 100644 (file)
@@ -782,10 +782,17 @@ void do_coredump(const kernel_siginfo_t *siginfo)
                 * filesystem.
                 */
                mnt_userns = file_mnt_user_ns(cprm.file);
-               if (!uid_eq(i_uid_into_mnt(mnt_userns, inode), current_fsuid()))
+               if (!uid_eq(i_uid_into_mnt(mnt_userns, inode),
+                           current_fsuid())) {
+                       pr_info_ratelimited("Core dump to %s aborted: cannot preserve file owner\n",
+                                           cn.corename);
                        goto close_fail;
-               if ((inode->i_mode & 0677) != 0600)
+               }
+               if ((inode->i_mode & 0677) != 0600) {
+                       pr_info_ratelimited("Core dump to %s aborted: cannot preserve file permissions\n",
+                                           cn.corename);
                        goto close_fail;
+               }
                if (!(cprm.file->f_mode & FMODE_CAN_WRITE))
                        goto close_fail;
                if (do_truncate(mnt_userns, cprm.file->f_path.dentry,
@@ -1127,8 +1134,10 @@ int dump_vma_snapshot(struct coredump_params *cprm, int *vma_count,
 
        mmap_write_unlock(mm);
 
-       if (WARN_ON(i != *vma_count))
+       if (WARN_ON(i != *vma_count)) {
+               kvfree(*vma_meta);
                return -EFAULT;
+       }
 
        *vma_data_size_ptr = vma_data_size;
        return 0;
This page took 0.034306 seconds and 4 git commands to generate.