]> git.baikalelectronics.ru Git - kernel.git/commit
PM / hibernate: Fix oops at snapshot_write()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Sat, 26 May 2018 00:59:36 +0000 (09:59 +0900)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 27 May 2018 10:00:02 +0000 (12:00 +0200)
commite98e7e60524df12e2357da475ea27a36cb3b41a2
tree73bc72332cabb63fb0497ae2f9a6e4b4f93e1a5f
parentd06d9cb305cdbf950a375e5360d4811066d52991
PM / hibernate: Fix oops at snapshot_write()

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>
kernel/power/user.c