Commit e6cf4061 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

restore: don't check tcore->thread_core

It is always not NULL in sigreturn_restore().

CID 164716 (#1 of 1): Dereference after null check (FORWARD_NULL)
64. var_deref_model: Passing tcore to construct_sigframe, which dereferences null tcore->thread_core. [show details]
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent dde7fae6
...@@ -2918,21 +2918,19 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns ...@@ -2918,21 +2918,19 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
rst_reloc_creds(&thread_args[i], &creds_pos_next); rst_reloc_creds(&thread_args[i], &creds_pos_next);
if (tcore->thread_core) { thread_args[i].has_futex = true;
thread_args[i].has_futex = true; thread_args[i].futex_rla = tcore->thread_core->futex_rla;
thread_args[i].futex_rla = tcore->thread_core->futex_rla; thread_args[i].futex_rla_len = tcore->thread_core->futex_rla_len;
thread_args[i].futex_rla_len = tcore->thread_core->futex_rla_len; thread_args[i].pdeath_sig = tcore->thread_core->pdeath_sig;
thread_args[i].pdeath_sig = tcore->thread_core->pdeath_sig; if (tcore->thread_core->pdeath_sig > _KNSIG) {
if (tcore->thread_core->pdeath_sig > _KNSIG) { pr_err("Pdeath signal is too big\n");
pr_err("Pdeath signal is too big\n"); goto err;
goto err;
}
ret = prep_sched_info(&thread_args[i].sp, tcore->thread_core);
if (ret)
goto err;
} }
ret = prep_sched_info(&thread_args[i].sp, tcore->thread_core);
if (ret)
goto err;
thread_args[i].mz = mz + i; thread_args[i].mz = mz + i;
sigframe = (struct rt_sigframe *)&mz[i].rt_sigframe; sigframe = (struct rt_sigframe *)&mz[i].rt_sigframe;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment