From: Michal Hocko <mhocko@kernel.org>
To: 禹舟键 <ufo19890607@gmail.com>
Cc: Wind Yu <yuzhoujian@didichuxing.com>,
rientjes@google.com, rong.a.chen@intel.com, sfr@canb.auug.org.au,
kirill.shutemov@linux.intel.com, aarcange@redhat.com,
penguin-kernel@i-love.sakura.ne.jp, guro@fb.com,
yang.s@alibaba-inc.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, lkp@01.org
Subject: Re: [LKP] [mm, oom] c1e4c54f9c: BUG:KASAN:null-ptr-deref_in_d
Date: Mon, 6 Aug 2018 08:06:49 +0200 [thread overview]
Message-ID: <20180806060649.GA19540@dhcp22.suse.cz> (raw)
In-Reply-To: <CAHCio2idn3oh55n7urkRPqkdyo+Y-0Qhg=Vc2VHXy2Wy2q1wiA@mail.gmail.com>
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
next prev parent reply other threads:[~2018-08-06 6:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-01 2:17 禹舟健(基础平台部)
2018-08-05 3:41 ` 禹舟键
2018-08-06 6:06 ` Michal Hocko [this message]
2018-08-06 10:02 ` 禹舟键
2018-08-06 21:37 ` David Rientjes
-- strict thread matches above, loose matches on Subject: below --
2018-07-30 9:03 kernel test robot
2018-07-30 9:56 ` Michal Hocko
2018-07-31 2:05 ` David Rientjes
2018-07-31 6:54 ` Michal Hocko
2018-07-31 2:06 ` Rong Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180806060649.GA19540@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=guro@fb.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=rientjes@google.com \
--cc=rong.a.chen@intel.com \
--cc=sfr@canb.auug.org.au \
--cc=ufo19890607@gmail.com \
--cc=yang.s@alibaba-inc.com \
--cc=yuzhoujian@didichuxing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®