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
a64e6494
Commit
a64e6494
authored
Nov 12, 2008
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] return records for fork() both to child and parent
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
a3f07114
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
include/linux/audit.h
include/linux/audit.h
+2
-0
kernel/auditsc.c
kernel/auditsc.c
+17
-0
kernel/fork.c
kernel/fork.c
+1
-0
No files found.
include/linux/audit.h
View file @
a64e6494
...
...
@@ -391,6 +391,7 @@ extern int audit_classify_arch(int arch);
#ifdef CONFIG_AUDITSYSCALL
/* These are defined in auditsc.c */
/* Public API */
extern
void
audit_finish_fork
(
struct
task_struct
*
child
);
extern
int
audit_alloc
(
struct
task_struct
*
task
);
extern
void
audit_free
(
struct
task_struct
*
task
);
extern
void
audit_syscall_entry
(
int
arch
,
...
...
@@ -504,6 +505,7 @@ static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
extern
int
audit_n_rules
;
extern
int
audit_signals
;
#else
#define audit_finish_fork(t)
#define audit_alloc(t) ({ 0; })
#define audit_free(t) do { ; } while (0)
#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
...
...
kernel/auditsc.c
View file @
a64e6494
...
...
@@ -1548,6 +1548,23 @@ void audit_syscall_entry(int arch, int major,
context
->
ppid
=
0
;
}
void
audit_finish_fork
(
struct
task_struct
*
child
)
{
struct
audit_context
*
ctx
=
current
->
audit_context
;
struct
audit_context
*
p
=
child
->
audit_context
;
if
(
!
p
||
!
ctx
||
!
ctx
->
auditable
)
return
;
p
->
arch
=
ctx
->
arch
;
p
->
major
=
ctx
->
major
;
memcpy
(
p
->
argv
,
ctx
->
argv
,
sizeof
(
ctx
->
argv
));
p
->
ctime
=
ctx
->
ctime
;
p
->
dummy
=
ctx
->
dummy
;
p
->
auditable
=
ctx
->
auditable
;
p
->
in_syscall
=
ctx
->
in_syscall
;
p
->
filterkey
=
kstrdup
(
ctx
->
filterkey
,
GFP_KERNEL
);
p
->
ppid
=
current
->
pid
;
}
/**
* audit_syscall_exit - deallocate audit context after a system call
* @tsk: task being audited
...
...
kernel/fork.c
View file @
a64e6494
...
...
@@ -1398,6 +1398,7 @@ long do_fork(unsigned long clone_flags,
init_completion
(
&
vfork
);
}
audit_finish_fork
(
p
);
tracehook_report_clone
(
trace
,
regs
,
clone_flags
,
nr
,
p
);
/*
...
...
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