From 70983a5f3956881f8832eb4a4c1ad19c1b59c8ea Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 21 Aug 2012 22:43:47 -0400 Subject: [PATCH] --- yaml --- r: 328981 b: refs/heads/master c: 179e037fc1370288188cb1f90b81156d75a3cb2d h: refs/heads/master i: 328979: 349d9fd3800b27fc34245bbffa6f1ac3065c4b04 v: v3 --- [refs] | 2 +- trunk/fs/exec.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 85c63655a041..0e7dc210903d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c3c073f808b22dfae15ef8412b6f7b998644139a +refs/heads/master: 179e037fc1370288188cb1f90b81156d75a3cb2d diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 3fc74681cc6c..beb05a95e4a3 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -2066,6 +2066,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) int retval = 0; int flag = 0; int ispipe; + struct files_struct *displaced; bool need_nonrelative = false; static atomic_t core_dump_count = ATOMIC_INIT(0); struct coredump_params cprm = { @@ -2219,6 +2220,12 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) goto close_fail; } + /* get us an unshared descriptor table; almost always a no-op */ + retval = unshare_files(&displaced); + if (retval) + goto close_fail; + if (displaced) + put_files_struct(displaced); retval = binfmt->core_dump(&cprm); if (retval) current->signal->group_exit_code |= 0x80;