Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-03 Thread Chengyu Song
Right. Should have checked the commit history ... this has been brought up before: > Peter Zijlstra - May 18, 2016, 5:02 p.m. > > > +struct task_struct *task_rcu_dereference(struct task_struct **ptask) > > +{ > > + struct task_struct *task; > > + struct sighand_struct *sighand; > > I think

Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-03 Thread Chengyu Song
Right. Should have checked the commit history ... this has been brought up before: > Peter Zijlstra - May 18, 2016, 5:02 p.m. > > > +struct task_struct *task_rcu_dereference(struct task_struct **ptask) > > +{ > > + struct task_struct *task; > > + struct sighand_struct *sighand; > > I think

Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-02 Thread Al Viro
On Wed, May 02, 2018 at 06:48:57PM -0700, Yizhuo Zhai wrote: > Variable 'sighand' could be uninitialized if probe_kernel_address fails > (-EFAULT). The later use in the if statement may lead to undefined behavior. Excuse me, but that's nonsense. The value *copied* into it (in case

Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-02 Thread Al Viro
On Wed, May 02, 2018 at 06:48:57PM -0700, Yizhuo Zhai wrote: > Variable 'sighand' could be uninitialized if probe_kernel_address fails > (-EFAULT). The later use in the if statement may lead to undefined behavior. Excuse me, but that's nonsense. The value *copied* into it (in case

Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-02 Thread Kees Cook
On Wed, May 2, 2018 at 6:48 PM, Yizhuo Zhai wrote: > Variable 'sighand' could be uninitialized if probe_kernel_address fails > (-EFAULT). The later use in the if statement may lead to undefined behavior. > > Signed-off-by: yzhai...@ucr.edu > --- >

Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-02 Thread Kees Cook
On Wed, May 2, 2018 at 6:48 PM, Yizhuo Zhai wrote: > Variable 'sighand' could be uninitialized if probe_kernel_address fails > (-EFAULT). The later use in the if statement may lead to undefined behavior. > > Signed-off-by: yzhai...@ucr.edu > --- > kernel/exit.c | 2 +- > 1 file changed, 1