android_kernel_oneplus_msm8998/kernel/power
Tetsuo Handa a4ae35d678 PM / hibernate: Fix oops at snapshot_write()
commit fc14eebfc20854a38fd9f1d93a42b1783dad4d17 upstream.

syzbot is reporting NULL pointer dereference at snapshot_write() [1].
This is because data->handle is zero-cleared by ioctl(SNAPSHOT_FREE).
Fix this by checking data_of(data->handle) != NULL before using it.

[1] https://syzkaller.appspot.com/bug?id=828a3c71bd344a6de8b6a31233d51a72099f27fd

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+ae590932da6e45d6564d@syzkaller.appspotmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-17 11:31:46 +02:00
..
autosleep.c PM / Sleep: avoid 'autosleep' in shutdown progress 2013-07-15 01:31:37 +02:00
console.c arm, pm, vmpressure: add missing slab.h includes 2014-02-03 13:24:01 -05:00
hibernate.c PM / hibernate: Restore processor state before using per-CPU variables 2016-09-30 10:18:39 +02:00
Kconfig PM / suspend: make sync() on suspend-to-RAM build-time optional 2015-07-31 23:46:05 +02:00
main.c PM / sleep: Report interrupt that caused system wakeup 2015-09-16 14:20:41 +02:00
Makefile suspend: simplify block I/O handling 2015-05-19 09:19:59 -06:00
power.h x86/power: Fix swsusp_arch_resume prototype 2018-05-30 07:48:55 +02:00
poweroff.c power/sysrq: fix inconstistent help message of sysrq key 2013-04-30 17:04:10 -07:00
process.c sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs 2017-10-12 11:27:35 +02:00
qos.c PM / QoS: Add debugfs support to view the list of constraints 2015-01-23 22:16:21 +01:00
snapshot.c PM / hibernate: Fix rtree_next_node() to avoid walking off list ends 2016-09-30 10:18:39 +02:00
suspend.c PM / sleep: Add flags to indicate platform firmware involvement 2015-10-14 02:17:33 +02:00
suspend_test.c PM / sleep: fix device reference leak in test_suspend 2016-11-26 09:54:53 +01:00
swap.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
user.c PM / hibernate: Fix oops at snapshot_write() 2018-07-17 11:31:46 +02:00
wakelock.c PM / autosleep: Use workqueue for user space wakeup sources garbage collector 2015-07-14 21:04:48 +02:00