aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/ptrace.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-05-01 11:59:14 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:59:14 -0400
commit7ed20e1ad521b5f5df61bf6559ae60738e393741 (patch)
tree90931724e45eaedb3445314e8b94e78253642395 /arch/x86_64/kernel/ptrace.c
parente5bdd883a189243541e7a132385580703b049102 (diff)
[PATCH] convert that currently tests _NSIG directly to use valid_signal()
Convert most of the current code that uses _NSIG directly to instead use valid_signal(). This avoids gcc -W warnings and off-by-one errors. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/ptrace.c')
-rw-r--r--arch/x86_64/kernel/ptrace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index c7011675007d..c64b9c97c745 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -18,6 +18,7 @@
18#include <linux/security.h> 18#include <linux/security.h>
19#include <linux/audit.h> 19#include <linux/audit.h>
20#include <linux/seccomp.h> 20#include <linux/seccomp.h>
21#include <linux/signal.h>
21 22
22#include <asm/uaccess.h> 23#include <asm/uaccess.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
@@ -467,7 +468,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
467 case PTRACE_CONT: /* restart after signal. */ 468 case PTRACE_CONT: /* restart after signal. */
468 469
469 ret = -EIO; 470 ret = -EIO;
470 if ((unsigned long) data > _NSIG) 471 if (!valid_signal(data))
471 break; 472 break;
472 if (request == PTRACE_SYSCALL) 473 if (request == PTRACE_SYSCALL)
473 set_tsk_thread_flag(child,TIF_SYSCALL_TRACE); 474 set_tsk_thread_flag(child,TIF_SYSCALL_TRACE);
@@ -529,7 +530,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
529 530
530 case PTRACE_SINGLESTEP: /* set the trap flag. */ 531 case PTRACE_SINGLESTEP: /* set the trap flag. */
531 ret = -EIO; 532 ret = -EIO;
532 if ((unsigned long) data > _NSIG) 533 if (!valid_signal(data))
533 break; 534 break;
534 clear_tsk_thread_flag(child,TIF_SYSCALL_TRACE); 535 clear_tsk_thread_flag(child,TIF_SYSCALL_TRACE);
535 set_singlestep(child); 536 set_singlestep(child);