Skip to content
Commit 7f00f388 authored by Jiri Olsa's avatar Jiri Olsa Committed by Thomas Gleixner
Browse files

x86/intel_rdt: Fix locking in rdtgroup_schemata_write()



The schemata lock is released before freeing the resource's temporary
tmp_cbms allocation. That's racy versus another write which allocates and
uses new temporary storage, resulting in memory leaks, freeing in use
memory, double a free or any combination of those.

Move the unlock after the release code.

Fixes: 60ec2440 ("x86/intel_rdt: Add schemata file")
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Shaohua Li <shli@fb.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20170411071446.15241-1-jolsa@kernel.org


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 1c99a687
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment