No description
Find a file
Xiaochen Shen 1677a0e549 x86/resctrl: Prevent NULL pointer dereference when reading mondata
[ Upstream commit 26467b0f84 ]

When a mon group is being deleted, rdtgrp->flags is set to RDT_DELETED
in rdtgroup_rmdir_mon() firstly. The structure of rdtgrp will be freed
until rdtgrp->waitcount is dropped to 0 in rdtgroup_kn_unlock() later.

During the window of deleting a mon group, if an application calls
rdtgroup_mondata_show() to read mondata under this mon group,
'rdtgrp' returned from rdtgroup_kn_lock_live() is a NULL pointer when
rdtgrp->flags is RDT_DELETED. And then 'rdtgrp' is passed in this path:
rdtgroup_mondata_show() --> mon_event_read() --> mon_event_count().
Thus it results in NULL pointer dereference in mon_event_count().

Check 'rdtgrp' in rdtgroup_mondata_show(), and return -ENOENT
immediately when reading mondata during the window of deleting a mon
group.

Fixes: d89b737901 ("x86/intel_rdt/cqm: Add mon_data")
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: pei.p.jia@intel.com
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/1572326702-27577-1-git-send-email-xiaochen.shen@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-05 09:19:40 +01:00
arch x86/resctrl: Prevent NULL pointer dereference when reading mondata 2019-12-05 09:19:40 +01:00
block block: call rq_qos_exit() after queue is frozen 2019-12-01 09:17:06 +01:00
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() 2018-08-22 23:21:44 +09:00
crypto crypto: testmgr - fix sizeof() on COMP_BUF_SIZE 2019-12-01 09:16:13 +01:00
Documentation x86/speculation: Fix incorrect MDS/TAA mitigation status 2019-12-01 09:17:37 +01:00
drivers clk: sunxi-ng: a80: fix the zero'ing of bits 16 and 18 2019-12-05 09:19:39 +01:00
firmware kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
fs ocfs2: remove ocfs2_is_o2cb_active() 2019-12-01 09:17:36 +01:00
include idr: Fix integer overflow in idr_for_each_entry 2019-12-05 09:19:39 +01:00
init initramfs: don't free a non-existent initrd 2019-10-01 08:26:09 +02:00
ipc ipc/mqueue.c: only perform resource calculation if user valid 2019-08-06 19:06:52 +02:00
kernel futex: Prevent robust futex exit race 2019-12-01 09:17:38 +01:00
lib idr: Fix idr_alloc_u32 on 32-bit systems 2019-12-05 09:19:40 +01:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm mm/memory_hotplug: don't access uninitialized memmaps in shrink_zone_span() 2019-12-01 09:17:36 +01:00
net cfg80211: call disconnect_wk when AP stops 2019-12-01 09:17:34 +01:00
samples samples/bpf: fix build by setting HAVE_ATTR_TEST to zero 2019-12-05 09:19:39 +01:00
scripts scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks 2019-11-06 13:05:27 +01:00
security ima: fix freeing ongoing ahash_request 2019-10-11 18:21:11 +02:00
sound ASoC: kirkwood: fix device remove ordering 2019-12-05 09:19:37 +01:00
tools usbip: tools: fix fd leakage in the function of read_attr_usbip_status 2019-12-01 09:17:40 +01:00
usr kbuild: clean compressed initramfs image 2019-10-07 18:57:16 +02:00
virt KVM: MMU: Do not treat ZONE_DEVICE pages as being reserved 2019-12-01 09:17:35 +01:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS USB: rio500: Remove Rio 500 kernel driver 2019-10-17 13:44:47 -07:00
Makefile Linux 4.19.87 2019-12-01 09:17:47 +01:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.