lkml.org 
[lkml]   [2018]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kernel/exit.c: pointer sighand could be uninitialized
From
Date
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 that needs: ' = NULL',

and led to the comments added there.

Sorry for wasting your time.

-chengyu

> On May 2, 2018, at 10:06 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> 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
> probe_kernel_address() has not failed) may be just as uninitialized.
> If mere "compare uninitialized pointer value to NULL" can cause nasal demons to fly,
> * we are screwed anyway
> * the piece of crap compiler should be printed on sandpaper and used to
> polish its authors.
>
> Read the comments in there, please. Especially the one regarding the second case.

\
 
 \ /
  Last update: 2018-05-03 09:44    [W:1.223 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site