lkml.org 
[lkml]   [2018]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [LKP] [mm, oom] c1e4c54f9c: BUG:KASAN:null-ptr-deref_in_d
On Sun 05-08-18 11:41:50, 禹舟键 wrote:
> Hi Michal and David,
> AFAICS, the null pointer is the task_struct of p in the dump_header.
> Why don't we just add a if before printing the victim task's
> informaiton.

See http://lkml.kernel.org/r/alpine.DEB.2.21.1807301854040.198273@chino.kir.corp.google.com

> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -438,14 +438,6 @@ static void dump_header(struct oom_control *oc,
> struct task_struct *p)
>
> cpuset_print_current_mems_allowed();
> mem_cgroup_print_oom_context(oc->memcg, p);
> - pr_cont(",task=%s,pid=%d,uid=%d\n", p->comm, p->pid,
> - from_kuid(&init_user_ns, task_uid(p)));
> + if (p)
> + pr_cont(",task=%s,pid=%d,uid=%d", p->comm, p->pid,
> + from_kuid(&init_user_ns, task_uid(p)));
> + pr_cont("\n");
> if (is_memcg_oom(oc))
> mem_cgroup_print_oom_meminfo(oc->memcg);
>
> Thanks
> Zhoujian

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-08-06 08:07    [W:0.053 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site