Re: [PATCH] posix-timers: fix stack info leak in timer_create()

From: Oleg Nesterov
Date: Sun Oct 05 2014 - 18:32:18 EST


On 10/05, Mathias Krause wrote:
>
> On 5 October 2014 23:06, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > On 10/04, Mathias Krause wrote:
> >>
> >> Cc: <stable@xxxxxxxxxxxxxxx> # v2.6.28+
> >
> > not sure this is -stable material but I won't really argue.
> >
>
> This should fall into the class "security fixes". Info leaks like that
> -- if flagged as such -- got backported regularly in the past. They
> tend to get CVE IDs, even.

And imo, very often we do this for absolutely no reason. Like this fix
tries to do ;) But again, I won't really argue.

> >> --- a/kernel/time/posix-timers.c
> >> +++ b/kernel/time/posix-timers.c
> >> @@ -636,6 +636,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
> >> goto out;
> >> }
> >> } else {
> >> + memset(&event.sigev_value, 0, sizeof(event.sigev_value));
> >> event.sigev_notify = SIGEV_SIGNAL;
> >> event.sigev_signo = SIGALRM;
> >> event.sigev_value.sival_int = new_timer->it_id;
> >
> > How about
> >
> > - event.sigev_value.sival_int = new_timer->it_id;
> > + event.sigev_value = (sigval_t) { .sival_int = new_timer_id };
> >
> > ?
>
> Oh, well. It's a matter of taste, I guess.

Sure.

> It won't fit mine ;) I
> think it makes it slightly less readable.

To me it looks more readable, that is why I suggested this change.
But of course, of course, this is subjective, so I won't insist.

So I think this patch is fine.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/