diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-07-27 14:43:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:25:48 -0400 |
commit | cb66504d65e54210d7dc55a0027d309ca5f51f83 (patch) | |
tree | 0d292ced5cce778bc16387b1d928117aead52996 /arch/um/kernel/process.c | |
parent | b6b038a24a826fe22d9823722cfbbbd3ad7a3021 (diff) |
[PATCH] uml: add skas0 command-line option
This adds the "skas0" parameter to force skas0 operation on SKAS3 host and
shows which operating mode has been selected.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/process.c')
-rw-r--r-- | arch/um/kernel/process.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index c45a60e9c92d..8b01a5584e80 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -212,12 +212,26 @@ static int stop_ptraced_child(int pid, int exitcode, int mustexit) | |||
212 | 212 | ||
213 | static int force_sysemu_disabled = 0; | 213 | static int force_sysemu_disabled = 0; |
214 | 214 | ||
215 | int ptrace_faultinfo = 1; | ||
216 | int proc_mm = 1; | ||
217 | |||
218 | static int __init skas0_cmd_param(char *str, int* add) | ||
219 | { | ||
220 | ptrace_faultinfo = proc_mm = 0; | ||
221 | return 0; | ||
222 | } | ||
223 | |||
215 | static int __init nosysemu_cmd_param(char *str, int* add) | 224 | static int __init nosysemu_cmd_param(char *str, int* add) |
216 | { | 225 | { |
217 | force_sysemu_disabled = 1; | 226 | force_sysemu_disabled = 1; |
218 | return 0; | 227 | return 0; |
219 | } | 228 | } |
220 | 229 | ||
230 | __uml_setup("skas0", skas0_cmd_param, | ||
231 | "skas0\n" | ||
232 | " Disables SKAS3 usage, so that SKAS0 is used, unless you \n" | ||
233 | " specify mode=tt.\n\n"); | ||
234 | |||
221 | __uml_setup("nosysemu", nosysemu_cmd_param, | 235 | __uml_setup("nosysemu", nosysemu_cmd_param, |
222 | "nosysemu\n" | 236 | "nosysemu\n" |
223 | " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" | 237 | " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" |
@@ -359,12 +373,10 @@ void forward_pending_sigio(int target) | |||
359 | kill(target, SIGIO); | 373 | kill(target, SIGIO); |
360 | } | 374 | } |
361 | 375 | ||
362 | int ptrace_faultinfo = 0; | ||
363 | int proc_mm = 1; | ||
364 | |||
365 | extern void *__syscall_stub_start, __syscall_stub_end; | 376 | extern void *__syscall_stub_start, __syscall_stub_end; |
366 | 377 | ||
367 | #ifdef UML_CONFIG_MODE_SKAS | 378 | #ifdef UML_CONFIG_MODE_SKAS |
379 | |||
368 | static inline void check_skas3_ptrace_support(void) | 380 | static inline void check_skas3_ptrace_support(void) |
369 | { | 381 | { |
370 | struct ptrace_faultinfo fi; | 382 | struct ptrace_faultinfo fi; |
@@ -375,6 +387,7 @@ static inline void check_skas3_ptrace_support(void) | |||
375 | 387 | ||
376 | n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); | 388 | n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); |
377 | if (n < 0) { | 389 | if (n < 0) { |
390 | ptrace_faultinfo = 0; | ||
378 | if(errno == EIO) | 391 | if(errno == EIO) |
379 | printf("not found\n"); | 392 | printf("not found\n"); |
380 | else { | 393 | else { |
@@ -382,8 +395,10 @@ static inline void check_skas3_ptrace_support(void) | |||
382 | } | 395 | } |
383 | } | 396 | } |
384 | else { | 397 | else { |
385 | ptrace_faultinfo = 1; | 398 | if (!ptrace_faultinfo) |
386 | printf("found\n"); | 399 | printf("found but disabled on command line\n"); |
400 | else | ||
401 | printf("found\n"); | ||
387 | } | 402 | } |
388 | 403 | ||
389 | init_registers(pid); | 404 | init_registers(pid); |
@@ -396,13 +411,13 @@ int can_do_skas(void) | |||
396 | if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { | 411 | if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { |
397 | proc_mm = 0; | 412 | proc_mm = 0; |
398 | printf("not found\n"); | 413 | printf("not found\n"); |
399 | goto out; | 414 | } else { |
400 | } | 415 | if (!proc_mm) |
401 | else { | 416 | printf("found but disabled on command line\n"); |
402 | printf("found\n"); | 417 | else |
418 | printf("found\n"); | ||
403 | } | 419 | } |
404 | 420 | ||
405 | out: | ||
406 | check_skas3_ptrace_support(); | 421 | check_skas3_ptrace_support(); |
407 | return 1; | 422 | return 1; |
408 | } | 423 | } |