lkml.org 
[lkml]   [2018]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Patch v3 07/13] x86/process Add arch_set_dumpable
Date
Add arch_set_dumpable for setting architecture specific security
modifications on processes according to its dumpable properties.
Non dumpable processes are security sensitive and they can be modified
to gain architecture specific security defenses via arch_set_dumpable.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
fs/exec.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/fs/exec.c b/fs/exec.c
index e204830..6f329fc 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1940,6 +1940,11 @@ void set_binfmt(struct linux_binfmt *new)
}
EXPORT_SYMBOL(set_binfmt);

+void __weak arch_set_dumpable(struct task_struct *tsk, unsigned int value)
+{
+ return;
+}
+
/*
* set_dumpable stores three-value SUID_DUMP_* into mm->flags.
*/
@@ -1956,6 +1961,7 @@ void set_dumpable(struct task_struct *tsk, unsigned int value)
old = READ_ONCE(tsk->mm->flags);
new = (old & ~MMF_DUMPABLE_MASK) | value;
} while (cmpxchg(&tsk->mm->flags, old, new) != old);
+ arch_set_dumpable(tsk, value);
}

SYSCALL_DEFINE3(execve,
--
2.9.4
\
 
 \ /
  Last update: 2018-10-17 20:34    [W:0.688 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site