Messages in this thread | | | From | Kees Cook <> | Date | Wed, 2 May 2018 21:50:41 -0700 | Subject | Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized |
| |
On Wed, May 2, 2018 at 6:48 PM, Yizhuo Zhai <yzhai003@ucr.edu> 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: yzhai003@ucr.edu <yzhai003@ucr.edu> > --- > kernel/exit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/exit.c b/kernel/exit.c > index f6cad39..a353bd1 100644 > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -232,7 +232,7 @@ void release_task(struct task_struct *p) > */ > struct task_struct *task_rcu_dereference(struct task_struct **ptask) > { > - struct sighand_struct *sighand; > + struct sighand_struct *sighand = NULL; > struct task_struct *task; > > /*
Better would probably be to check the return of probe_kernel_address() and take appropriate action...
-Kees
-- Kees Cook Pixel Security
| |