projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
proc: return -ENOMEM when inode allocation failed
[firefly-linux-kernel-4.4.55.git]
/
fs
/
coredump.c
diff --git
a/fs/coredump.c
b/fs/coredump.c
index f045bbad682294330023e9a09020f16ccb9c241c..fd37facac8dc55f40281008ceb6799c667105588 100644
(file)
--- a/
fs/coredump.c
+++ b/
fs/coredump.c
@@
-14,6
+14,7
@@
#include <linux/key.h>
#include <linux/personality.h>
#include <linux/binfmts.h>
#include <linux/key.h>
#include <linux/personality.h>
#include <linux/binfmts.h>
+#include <linux/coredump.h>
#include <linux/utsname.h>
#include <linux/pid_namespace.h>
#include <linux/module.h>
#include <linux/utsname.h>
#include <linux/pid_namespace.h>
#include <linux/module.h>
@@
-39,6
+40,7
@@
#include <trace/events/task.h>
#include "internal.h"
#include <trace/events/task.h>
#include "internal.h"
+#include "coredump.h"
#include <trace/events/sched.h>
#include <trace/events/sched.h>
@@
-147,7
+149,7
@@
put_exe_file:
* name into corename, which must have space for at least
* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
*/
* name into corename, which must have space for at least
* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
*/
-static int format_corename(struct core_name *cn,
long signr
)
+static int format_corename(struct core_name *cn,
struct coredump_params *cprm
)
{
const struct cred *cred = current_cred();
const char *pat_ptr = core_pattern;
{
const struct cred *cred = current_cred();
const char *pat_ptr = core_pattern;
@@
-192,9
+194,13
@@
static int format_corename(struct core_name *cn, long signr)
case 'g':
err = cn_printf(cn, "%d", cred->gid);
break;
case 'g':
err = cn_printf(cn, "%d", cred->gid);
break;
+ case 'd':
+ err = cn_printf(cn, "%d",
+ __get_dumpable(cprm->mm_flags));
+ break;
/* signal that caused the coredump */
case 's':
/* signal that caused the coredump */
case 's':
- err = cn_printf(cn, "%ld",
signr
);
+ err = cn_printf(cn, "%ld",
cprm->siginfo->si_signo
);
break;
/* UNIX time of coredump */
case 't': {
break;
/* UNIX time of coredump */
case 't': {
@@
-451,7
+457,7
@@
static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
return 0;
}
return 0;
}
-void do_coredump(
long signr, int exit_code
, struct pt_regs *regs)
+void do_coredump(
siginfo_t *siginfo
, struct pt_regs *regs)
{
struct core_state core_state;
struct core_name cn;
{
struct core_state core_state;
struct core_name cn;
@@
-466,7
+472,7
@@
void do_coredump(long signr, int exit_code, struct pt_regs *regs)
bool need_nonrelative = false;
static atomic_t core_dump_count = ATOMIC_INIT(0);
struct coredump_params cprm = {
bool need_nonrelative = false;
static atomic_t core_dump_count = ATOMIC_INIT(0);
struct coredump_params cprm = {
- .sig
nr = signr
,
+ .sig
info = siginfo
,
.regs = regs,
.limit = rlimit(RLIMIT_CORE),
/*
.regs = regs,
.limit = rlimit(RLIMIT_CORE),
/*
@@
-477,7
+483,7
@@
void do_coredump(long signr, int exit_code, struct pt_regs *regs)
.mm_flags = mm->flags,
};
.mm_flags = mm->flags,
};
- audit_core_dumps(sig
nr
);
+ audit_core_dumps(sig
info->si_signo
);
binfmt = mm->binfmt;
if (!binfmt || !binfmt->core_dump)
binfmt = mm->binfmt;
if (!binfmt || !binfmt->core_dump)
@@
-501,7
+507,7
@@
void do_coredump(long signr, int exit_code, struct pt_regs *regs)
need_nonrelative = true;
}
need_nonrelative = true;
}
- retval = coredump_wait(
exit_code
, &core_state);
+ retval = coredump_wait(
siginfo->si_signo
, &core_state);
if (retval < 0)
goto fail_creds;
if (retval < 0)
goto fail_creds;
@@
-513,7
+519,7
@@
void do_coredump(long signr, int exit_code, struct pt_regs *regs)
*/
clear_thread_flag(TIF_SIGPENDING);
*/
clear_thread_flag(TIF_SIGPENDING);
- ispipe = format_corename(&cn,
signr
);
+ ispipe = format_corename(&cn,
&cprm
);
if (ispipe) {
int dump_count;
if (ispipe) {
int dump_count;