diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2024-02-18 11:40:58 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-02-22 22:08:03 +0300 |
commit | f4311756a83fb01c28a9bf841cbb7eb2b318eebf (patch) | |
tree | 3d8713631aeb8c1a5848ac3078cdb3a14fa97811 /kernel/power/power.h | |
parent | 3fec6e5961b77af6a952b77f5c2ea26f7513b216 (diff) | |
download | linux-f4311756a83fb01c28a9bf841cbb7eb2b318eebf.tar.xz |
PM: hibernate: Don't ignore return from set_memory_ro()
set_memory_ro() and set_memory_rw() can fail, leaving memory
unprotected.
Take the returned value into account and abort in case of
failure.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r-- | kernel/power/power.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h index 518349272848..de0e6b1077f2 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -153,7 +153,7 @@ extern unsigned int snapshot_additional_pages(struct zone *zone); extern unsigned long snapshot_get_image_size(void); extern int snapshot_read_next(struct snapshot_handle *handle); extern int snapshot_write_next(struct snapshot_handle *handle); -extern void snapshot_write_finalize(struct snapshot_handle *handle); +int snapshot_write_finalize(struct snapshot_handle *handle); extern int snapshot_image_loaded(struct snapshot_handle *handle); extern bool hibernate_acquire(void); |