linux-yocto/kernel/power
Malaya Kumar Rout b7a883b013 PM: hibernate: Fix crash when freeing invalid crypto compressor
commit 7966cf0ebe32c981bfa3db252cb5fc3bb1bf2e77 upstream.

When crypto_alloc_acomp() fails, it returns an ERR_PTR value, not NULL.

The cleanup code in save_compressed_image() and load_compressed_image()
unconditionally calls crypto_free_acomp() without checking for ERR_PTR,
which causes crypto_acomp_tfm() to dereference an invalid pointer and
crash the kernel.

This can be triggered when the compression algorithm is unavailable
(e.g., CONFIG_CRYPTO_LZO not enabled).

Fix by adding IS_ERR_OR_NULL() checks before calling crypto_free_acomp()
and acomp_request_free(), similar to the existing kthread_stop() check.

Fixes: b03d542c3c ("PM: hibernate: Use crypto_acomp interface")
Signed-off-by: Malaya Kumar Rout <mrout@redhat.com>
Cc: 6.15+ <stable@vger.kernel.org> # 6.15+
[ rjw: Added 2 empty code lines ]
Link: https://patch.msgid.link/20251230115613.64080-1-mrout@redhat.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-17 16:35:14 +01:00
..
autosleep.c PM: sleep: autosleep: don't include 'pm_wakeup.h' directly 2024-12-05 12:14:26 +01:00
console.c PM: sleep: console: Fix the black screen issue 2025-07-03 15:58:33 +02:00
energy_model.c PM: EM: Fix late boot with holes in CPU topology 2025-09-15 12:02:24 +02:00
hibernate.c vfs-6.18-rc7.fixes 2025-11-17 09:11:27 -08:00
Kconfig PM: EM: Rework the depends on for CONFIG_ENERGY_MODEL 2025-03-07 15:23:46 +01:00
main.c PM: sleep: Allow pm_restrict_gfp_mask() stacking 2025-10-29 18:55:32 +01:00
Makefile PM: sleep: Narrow down -DDEBUG on kernel/power/ files 2022-04-13 16:34:01 +02:00
power.h PM: Restrict swap use to later in the suspend sequence 2025-06-26 20:39:34 +02:00
poweroff.c tty: sysrq: switch sysrq handlers from int to u8 2023-07-25 19:21:03 +02:00
process.c Revert "PM: sleep: Make pm_wakeup_clear() call more clear" 2025-10-23 12:48:04 +02:00
qos.c PM: QoS: Add check to make sure CPU latency is non-negative 2023-08-22 21:37:29 +02:00
snapshot.c PM: hibernate: Fix typo in memory bitmaps description comment 2025-09-01 11:55:53 +02:00
suspend_test.c rtc: class: make rtc_class constant 2024-03-08 12:05:10 +01:00
suspend.c vfs-6.18-rc7.fixes 2025-11-17 09:11:27 -08:00
swap.c PM: hibernate: Fix crash when freeing invalid crypto compressor 2026-01-17 16:35:14 +01:00
user.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
wakelock.c PM: wakeup: Delete space in the end of string shown by pm_show_wakelocks() 2025-05-09 15:48:39 +02:00