error = 0;
switch (option) {
case PR_SET_PDEATHSIG:
if (!valid_signal(arg2)) { error = -EINVAL; break;
} me->pdeath_signal = arg2; break;
...
return error;
}
and include/linux/signal.h::valid_signal():
/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */
static inline int valid_signal(unsigned long sig)
{
return sig <= _NSIG ? 1 : 0;
}
and arch/x86/include/asm/signal.h:#define _NSIG 64
Kernel side:
kernel/ sys.c:: SYSCALL_ DEFINE5( prctl, int, option,...):
{ me->comm) ];
struct task_struct *me = current;
unsigned char comm[sizeof(
long error;
error = security_ task_prctl( option, arg2, arg3, arg4, arg5);
return error;
if (error != -ENOSYS)
error = 0; signal( arg2)) {
error = -EINVAL;
break;
me->pdeath_ signal = arg2;
break;
switch (option) {
case PR_SET_PDEATHSIG:
if (!valid_
}
...
return error;
}
and include/ linux/signal. h::valid_ signal( ):
/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ unsigned long sig)
static inline int valid_signal(
{
return sig <= _NSIG ? 1 : 0;
}
and arch/x86/ include/ asm/signal. h:#define _NSIG 64
I wonder about security_ task_prctl( ) though.