lkml.org 
[lkml]   [2024]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V2 26/50] signal: Get rid of resched_timer logic
On 04/18, Oleg Nesterov wrote:
>
> On 04/11, Thomas Gleixner wrote:
> >
> > There is no reason for handing the *resched pointer argument through
> > several functions just to check whether the signal is related to a self
> > rearming posix timer.
>
> Agreed, these changes looks good to me.

I meant the intent.

But this is not simple, collect_signal() checks SIGQUEUE_PREALLOC exactly
because (iiuc) we need to ensure that SI_TIMER didn't come from userspace.

perhaps we should disallow SI_TIMER with _sys_private != 0 from userspace,
I dunno...

And I don't really understand the "not to be passed to user" comment in
include/uapi/asm-generic/siginfo.h. copy_siginfo_to_user() just copies
the whole kernel_siginfo.

Confused.

> But,
>
> > SI_TIMER is only used by the posix timer code and cannot be queued from
> > user space.
>
> Why? I think sigqueueinfo() can certainly use si_code = SI_TIMER, so
>
> > @@ -1011,6 +1001,9 @@ static int __send_signal_locked(int sig,
> >
> > lockdep_assert_held(&t->sighand->siglock);
> >
> > + if (WARN_ON_ONCE(!is_si_special(info) && info->si_code == SI_TIMER))
> > + return 0;
>
> this can be easily triggered by userspace and thus looks wrong.
>
> Oleg.


\
 
 \ /
  Last update: 2024-04-18 20:20    [W:1.561 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site