kaio
[Top] [All Lists]

Re: Signal delivery suggestion

To: kaio@xxxxxxxxxxx
Subject: Re: Signal delivery suggestion
From: ananth@xxxxxxxxxxxxxxxxxxxx (Rajagopal Ananth)
Date: Tue, 9 Nov 1999 14:20:57 -0800 (PST)
In-reply-to: <Pine.LNX.4.10.9911082202550.661-100000@rhdv.cistron.nl> from "Robert de Vries" at Nov 8, 99 10:08:53 pm
Sender: owner-kaio@xxxxxxxxxxx
> 
> The following piece of code contains a few omissions:
> 
> +       if (sigev->sigev_notify == SIGEV_SIGNAL) {
> +               struct siginfo sinfo;
> + 
> +               sinfo.si_signo = sigev->sigev_signo;
> +               sinfo.si_errno = 0; 
> +               sinfo.si_code = SI_KERNEL;
> +               sinfo.si_pid = 0;
> +               sinfo.si_uid = 0;
> +  
> +               send_sig_info(sigev->sigev_signo, &sinfo, task);
> +       }
> 
> 
> First of all the struct siginfo is not cleared 
> (e.g. with memset(&sinfo, 0, sizeof(sinfo)))
> This would copy kernel data which was accidentally on the stack to the
> user. Could be perceived as a security problem.
> 
> Secondly, according to my POSIX.4 book from O'Reilly the si_code should be
> SI_ASYNCIO.
> 
> Thirdly, the sigev->sigev_value is not copied to sinfo.si_value.
> 

Thanks for catching the errors & the suggestion to use SI_ASYNCIO.
I'll correct the errors in the next revision of KAIO, and will
look into using SI_ASYNCIO.

> Keep up the good work,
> 

Thanks for your interest!

ananth.

PS: currently I'm on sabatical leave, so if you get a vacation message from my
    private mail (ananth@xxxxxxx), please ignore it - I am still reading
    more important mail.


<Prev in Thread] Current Thread [Next in Thread>