Comment 21 for bug 2016908

Revision history for this message
Paolo Pisati (p-pisati) wrote : Re: Unable to deploy hosts with lunar images after 20230319 - fails to connect and download squashfs

Kernel side:

kernel/sys.c::SYSCALL_DEFINE5(prctl, int, option,...):

{
        struct task_struct *me = current;
        unsigned char comm[sizeof(me->comm)];
        long error;

        error = security_task_prctl(option, arg2, arg3, arg4, arg5);
        if (error != -ENOSYS)
                return error;

        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

I wonder about security_task_prctl() though.