archive mirror
 help / color / mirror / Atom feed
* Fwd: Possible null pointer dereference caused by vmstat_start()
       [not found] <>
@ 2020-05-14  3:59 ` Dongyang Zhan
  0 siblings, 0 replies; only message in thread
From: Dongyang Zhan @ 2020-05-14  3:59 UTC (permalink / raw)
  To: linux-kernel

发件人: Dongyang Zhan <>
Date: 2020年5月3日周日 下午1:45
Subject: Possible null pointer dereference caused by vmstat_start()
To: <>
Cc: <>

In Linux 4.10.17, vmstat_start() stores the results of v =
kmalloc(stat_items_size, GFP_KERNEL) in m->private = v before security
check. If m->private is accessed, it may cause null pointer

Source code link:

Source code;
v = kmalloc(stat_items_size, GFP_KERNEL);
m->private = v; //stores v before check;
if (!v)
 return ERR_PTR(-ENOMEM);

Function rdtgroup_seqfile_show() in
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c access this pointer without
check, which is a possible bug.

Source Code
static int rdtgroup_seqfile_show(struct seq_file *m, void *arg)
struct kernfs_open_file *of = m->private;
struct rftype *rft = of->kn->priv; // without check;

if (rft->seq_show)
return rft->seq_show(of, m, arg);
return 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-14  3:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2020-05-14  3:59 ` Fwd: Possible null pointer dereference caused by vmstat_start() Dongyang Zhan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).