]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.27.46/coredump-suppress-uid-comparison-test-if-core-output-files-are-pipes.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.46 / coredump-suppress-uid-comparison-test-if-core-output-files-are-pipes.patch
CommitLineData
d9fdd6fb
GKH
1From 76595f79d76fbe6267a51b3a866a028d150f06d4 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@tuxdriver.com>
3Date: Fri, 5 Mar 2010 13:44:16 -0800
4Subject: coredump: suppress uid comparison test if core output files are pipes
5
6From: Neil Horman <nhorman@tuxdriver.com>
7
8commit 76595f79d76fbe6267a51b3a866a028d150f06d4 upstream.
9
10Modify uid check in do_coredump so as to not apply it in the case of
11pipes.
12
13This just got noticed in testing. The end of do_coredump validates the
14uid of the inode for the created file against the uid of the crashing
15process to ensure that no one can pre-create a core file with different
16ownership and grab the information contained in the core when they
17shouldn' tbe able to. This causes failures when using pipes for a core
18dumps if the crashing process is not root, which is the uid of the pipe
19when it is created.
20
21The fix is simple. Since the check for matching uid's isn't relevant for
22pipes (a process can't create a pipe that the uermodehelper code will open
23anyway), we can just just skip it in the event ispipe is non-zero
24
25Reverts a pipe-affecting change which was accidentally made in
26
27: commit c46f739dd39db3b07ab5deb4e3ec81e1c04a91af
28: Author: Ingo Molnar <mingo@elte.hu>
29: AuthorDate: Wed Nov 28 13:59:18 2007 +0100
30: Commit: Linus Torvalds <torvalds@woody.linux-foundation.org>
31: CommitDate: Wed Nov 28 10:58:01 2007 -0800
32:
33: vfs: coredumping fix
34
35Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
36Cc: Andi Kleen <andi@firstfloor.org>
37Cc: Oleg Nesterov <oleg@redhat.com>
38Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
39Cc: Al Viro <viro@zeniv.linux.org.uk>
40Cc: Ingo Molnar <mingo@elte.hu>
41Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
42Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
43Cc: maximilian attems <max@stro.at>
44Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
45
46---
47 fs/exec.c | 3 ++-
48 1 file changed, 2 insertions(+), 1 deletion(-)
49
50--- a/fs/exec.c
51+++ b/fs/exec.c
52@@ -1826,8 +1826,9 @@ int do_coredump(long signr, int exit_cod
53 /*
54 * Dont allow local users get cute and trick others to coredump
55 * into their pre-created files:
56+ * Note, this is not relevant for pipes
57 */
58- if (inode->i_uid != current->fsuid)
0fa428d6 59+ if (!ispipe && (inode->i_uid != current->fsuid))
d9fdd6fb
GKH
60 goto close_fail;
61 if (!file->f_op)
62 goto close_fail;