Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
179e037f
Commit
179e037f
authored
Aug 21, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do_coredump(): make sure that descriptor table isn't shared
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c3c073f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
fs/exec.c
fs/exec.c
+7
-0
No files found.
fs/exec.c
View file @
179e037f
...
@@ -2066,6 +2066,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
...
@@ -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)
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment