]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf/x86: fix sysfs type mismatches
authorSami Tolvanen <samitolvanen@google.com>
Fri, 13 Nov 2020 18:31:26 +0000 (10:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Dec 2020 07:51:51 +0000 (08:51 +0100)
commit30ffb6a74f65af09c5948c10fe5464a7a8e7650a
tree64d08d2ec9384a3e7b0f722d7e1ac5e335897d98
parent6e82639f979e71ebfe0778616ed3367ce6f4adab
perf/x86: fix sysfs type mismatches

[ Upstream commit ebd19fc372e3e78bf165f230e7c084e304441c08 ]

This change switches rapl to use PMU_FORMAT_ATTR, and fixes two other
macros to use device_attribute instead of kobj_attribute to avoid
callback type mismatches that trip indirect call checking with Clang's
Control-Flow Integrity (CFI).

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20201113183126.1239404-1-samitolvanen@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/events/intel/cstate.c
arch/x86/events/intel/uncore.c
arch/x86/events/intel/uncore.h
arch/x86/events/rapl.c