mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
49 lines
1.7 KiB
Diff
49 lines
1.7 KiB
Diff
Index: b/security/apparmor/apparmor.h
|
|
===================================================================
|
|
--- a/security/apparmor/apparmor.h
|
|
+++ b/security/apparmor/apparmor.h
|
|
@@ -227,7 +227,7 @@ extern int aa_perm_dir(struct aa_profile
|
|
extern int aa_link(struct aa_profile *profile,
|
|
struct dentry *link, struct vfsmount *link_mnt,
|
|
struct dentry *target, struct vfsmount *target_mnt);
|
|
-extern int aa_fork(struct task_struct *task);
|
|
+extern int aa_clone(struct task_struct *task);
|
|
extern int aa_register(struct linux_binprm *bprm);
|
|
extern void aa_release(struct task_struct *task);
|
|
extern int aa_change_hat(const char *id, u32 hat_magic);
|
|
Index: b/security/apparmor/lsm.c
|
|
===================================================================
|
|
--- a/security/apparmor/lsm.c
|
|
+++ b/security/apparmor/lsm.c
|
|
@@ -504,7 +504,7 @@ static int apparmor_file_mprotect(struct
|
|
|
|
static int apparmor_task_alloc_security(struct task_struct *task)
|
|
{
|
|
- return aa_fork(task);
|
|
+ return aa_clone(task);
|
|
}
|
|
|
|
static void apparmor_task_free_security(struct task_struct *task)
|
|
Index: b/security/apparmor/main.c
|
|
===================================================================
|
|
--- a/security/apparmor/main.c
|
|
+++ b/security/apparmor/main.c
|
|
@@ -725,14 +725,16 @@ int aa_link(struct aa_profile *profile,
|
|
*******************************/
|
|
|
|
/**
|
|
- * aa_fork - initialize the task context for a new task
|
|
+ * aa_clone - initialize the task context for a new task
|
|
* @task: task that is being created
|
|
*/
|
|
-int aa_fork(struct task_struct *child)
|
|
+int aa_clone(struct task_struct *child)
|
|
{
|
|
struct aa_task_context *cxt, *child_cxt;
|
|
struct aa_profile *profile;
|
|
|
|
+ if (!aa_task_context(current))
|
|
+ return 0;
|
|
child_cxt = aa_alloc_task_context(child);
|
|
if (!child_cxt)
|
|
return -ENOMEM;
|