diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-11-28 07:59:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-28 13:58:01 -0500 |
commit | c46f739dd39db3b07ab5deb4e3ec81e1c04a91af (patch) | |
tree | caa3688a25bdfab7671c465496e90ac2e5feea8f /fs | |
parent | a531a141089714efe39eca89593524fdf05104f2 (diff) |
vfs: coredumping fix
fix: http://bugzilla.kernel.org/show_bug.cgi?id=3043
only allow coredumping to the same uid that the coredumping
task runs under.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Alan Cox <alan@redhat.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1780,6 +1780,12 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
1780 | but keep the previous behaviour for now. */ | 1780 | but keep the previous behaviour for now. */ |
1781 | if (!ispipe && !S_ISREG(inode->i_mode)) | 1781 | if (!ispipe && !S_ISREG(inode->i_mode)) |
1782 | goto close_fail; | 1782 | goto close_fail; |
1783 | /* | ||
1784 | * Dont allow local users get cute and trick others to coredump | ||
1785 | * into their pre-created files: | ||
1786 | */ | ||
1787 | if (inode->i_uid != current->fsuid) | ||
1788 | goto close_fail; | ||
1783 | if (!file->f_op) | 1789 | if (!file->f_op) |
1784 | goto close_fail; | 1790 | goto close_fail; |
1785 | if (!file->f_op->write) | 1791 | if (!file->f_op->write) |