mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-26 09:04:30 +00:00
do_coredump(): make sure that descriptor table isn't shared
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
c3c073f808
commit
179e037fc1
1 changed files with 7 additions and 0 deletions
|
@ -2066,6 +2066,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
int ispipe;
|
int ispipe;
|
||||||
|
struct files_struct *displaced;
|
||||||
bool need_nonrelative = false;
|
bool need_nonrelative = false;
|
||||||
static atomic_t core_dump_count = ATOMIC_INIT(0);
|
static atomic_t core_dump_count = ATOMIC_INIT(0);
|
||||||
struct coredump_params cprm = {
|
struct coredump_params cprm = {
|
||||||
|
@ -2219,6 +2220,12 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
|
||||||
goto close_fail;
|
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);
|
retval = binfmt->core_dump(&cprm);
|
||||||
if (retval)
|
if (retval)
|
||||||
current->signal->group_exit_code |= 0x80;
|
current->signal->group_exit_code |= 0x80;
|
||||||
|
|
Loading…
Add table
Reference in a new issue