aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2015-04-11 15:45:22 -0400
committerRichard Weinberger <richard@nod.at>2015-04-12 15:03:31 -0400
commit9058f3b326dbe8cd2ebea7f3cfe367b0d101039b (patch)
tree3d41d3cde25579460f291b4bd4f9d3060b1b8e6e
parentfa41b1c7dfa0453931afb32c9988af67a2ee28ae (diff)
Remove rest of exec domains.
It is gone from all archs, now we can remove the final bits. Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--include/linux/personality.h40
-rw-r--r--include/linux/sched.h6
-rw-r--r--kernel/exec_domain.c37
3 files changed, 1 insertions, 82 deletions
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 646c0a7d50fa..aeb7892b2468 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -3,52 +3,14 @@
3 3
4#include <uapi/linux/personality.h> 4#include <uapi/linux/personality.h>
5 5
6
7/*
8 * Handling of different ABIs (personalities).
9 */
10
11struct exec_domain;
12struct pt_regs;
13
14extern int register_exec_domain(struct exec_domain *);
15extern int unregister_exec_domain(struct exec_domain *);
16extern int __set_personality(unsigned int);
17
18
19/*
20 * Description of an execution domain.
21 *
22 * The first two members are refernced from assembly source
23 * and should stay where they are unless explicitly needed.
24 */
25typedef void (*handler_t)(int, struct pt_regs *);
26
27struct exec_domain {
28 const char *name; /* name of the execdomain */
29 handler_t handler; /* handler for syscalls */
30 unsigned char pers_low; /* lowest personality */
31 unsigned char pers_high; /* highest personality */
32 unsigned long *signal_map; /* signal mapping */
33 unsigned long *signal_invmap; /* reverse signal mapping */
34 struct map_segment *err_map; /* error mapping */
35 struct map_segment *socktype_map; /* socket type mapping */
36 struct map_segment *sockopt_map; /* socket option mapping */
37 struct map_segment *af_map; /* address family mapping */
38 struct module *module; /* module context of the ed. */
39 struct exec_domain *next; /* linked list (internal) */
40};
41
42/* 6/*
43 * Return the base personality without flags. 7 * Return the base personality without flags.
44 */ 8 */
45#define personality(pers) (pers & PER_MASK) 9#define personality(pers) (pers & PER_MASK)
46 10
47
48/* 11/*
49 * Change personality of the currently running process. 12 * Change personality of the currently running process.
50 */ 13 */
51#define set_personality(pers) \ 14#define set_personality(pers) (current->personality = (pers))
52 ((current->personality == (pers)) ? 0 : __set_personality(pers))
53 15
54#endif /* _LINUX_PERSONALITY_H */ 16#endif /* _LINUX_PERSONALITY_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a419b65770d6..14d9117ac463 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -125,7 +125,6 @@ struct sched_attr {
125 u64 sched_period; 125 u64 sched_period;
126}; 126};
127 127
128struct exec_domain;
129struct futex_pi_state; 128struct futex_pi_state;
130struct robust_list_head; 129struct robust_list_head;
131struct bio_list; 130struct bio_list;
@@ -2288,11 +2287,6 @@ extern void set_curr_task(int cpu, struct task_struct *p);
2288 2287
2289void yield(void); 2288void yield(void);
2290 2289
2291/*
2292 * The default (Linux) execution domain.
2293 */
2294extern struct exec_domain default_exec_domain;
2295
2296union thread_union { 2290union thread_union {
2297 struct thread_info thread_info; 2291 struct thread_info thread_info;
2298 unsigned long stack[THREAD_SIZE/sizeof(long)]; 2292 unsigned long stack[THREAD_SIZE/sizeof(long)];
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index b2fb57d6b9b2..6873bb3e6b7e 100644
--- a/kernel/exec_domain.c
+++ b/kernel/exec_domain.c
@@ -20,43 +20,6 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/fs_struct.h> 21#include <linux/fs_struct.h>
22 22
23static void default_handler(int, struct pt_regs *);
24static unsigned long ident_map[32] = {
25 0, 1, 2, 3, 4, 5, 6, 7,
26 8, 9, 10, 11, 12, 13, 14, 15,
27 16, 17, 18, 19, 20, 21, 22, 23,
28 24, 25, 26, 27, 28, 29, 30, 31
29};
30
31struct exec_domain default_exec_domain = {
32 .name = "Linux", /* name */
33 .handler = default_handler, /* lcall7 causes a seg fault. */
34 .pers_low = 0, /* PER_LINUX personality. */
35 .pers_high = 0, /* PER_LINUX personality. */
36 .signal_map = ident_map, /* Identity map signals. */
37 .signal_invmap = ident_map, /* - both ways. */
38};
39
40
41static void
42default_handler(int segment, struct pt_regs *regp)
43{
44 set_personality(0);
45
46 if (current_thread_info()->exec_domain->handler != default_handler)
47 current_thread_info()->exec_domain->handler(segment, regp);
48 else
49 send_sig(SIGSEGV, current, 1);
50}
51
52int __set_personality(unsigned int personality)
53{
54 current->personality = personality;
55
56 return 0;
57}
58EXPORT_SYMBOL(__set_personality);
59
60#ifdef CONFIG_PROC_FS 23#ifdef CONFIG_PROC_FS
61static int execdomains_proc_show(struct seq_file *m, void *v) 24static int execdomains_proc_show(struct seq_file *m, void *v)
62{ 25{