Skip to content

Commit

Permalink
PM / Hibernate: Don't let kasan instrument snapshot.c
Browse files Browse the repository at this point in the history
Kasan causes the compiler to instrument C code and is used at runtime to
detect accesses to memory that has been freed, or not yet allocated.

The code in snapshot.c saves and restores memory when hibernating. This will
access whole pages in the slab cache that have both free and allocated
areas, resulting in a large number of false positives from Kasan.

Disable instrumentation of this file.

Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
James Morse authored and Rafael J. Wysocki committed Jun 13, 2016
1 parent 5edb564 commit 6783091
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/power/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG

KASAN_SANITIZE_snapshot.o := n

obj-y += qos.o
obj-$(CONFIG_PM) += main.o
obj-$(CONFIG_VT_CONSOLE_SLEEP) += console.o
Expand Down

0 comments on commit 6783091

Please sign in to comment.