2.4.36-stable kernel tree
Revision | 62b548a60eaff6f986e9b3f5fd602ddae451b33e (tree) |
---|---|
Zeit | 2007-12-10 15:01:53 |
Autor | Willy Tarreau <w@1wt....> |
Commiter | Willy Tarreau |
[PATCH] vfs: coredumping fix
Backport of 2.6 commit c46f739dd39db3b07ab5deb4e3ec81e1c04a91af by Ingo Molnar.
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: Willy Tarreau <w@1wt.eu>
@@ -1167,6 +1167,12 @@ int do_coredump(long signr, struct pt_regs * regs) | ||
1167 | 1167 | |
1168 | 1168 | if (!S_ISREG(inode->i_mode)) |
1169 | 1169 | goto close_fail; |
1170 | + /* | |
1171 | + * Dont allow local users get cute and trick others to coredump | |
1172 | + * into their pre-created files: | |
1173 | + */ | |
1174 | + if (inode->i_uid != current->fsuid) | |
1175 | + goto close_fail; | |
1170 | 1176 | if (!file->f_op) |
1171 | 1177 | goto close_fail; |
1172 | 1178 | if (!file->f_op->write) |