1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 09:32:12 +00:00
Malaya Kumar Rout 7966cf0ebe PM: hibernate: Fix crash when freeing invalid crypto compressor
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: b03d542c3c95 ("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>
2026-01-05 19:12:56 +01:00
..
2025-12-17 15:54:58 +12:00
2025-12-11 08:14:23 +09:00
2025-12-10 17:21:30 +09:00
2025-11-09 21:19:44 -08:00
2025-12-03 13:46:48 -08:00
2025-12-03 12:18:07 -08:00
2025-12-05 17:29:04 -08:00
2025-12-03 12:18:07 -08:00
2025-12-05 17:29:04 -08:00
2025-12-19 09:30:55 +12:00
2025-12-01 13:45:41 -08:00
2025-11-11 10:01:31 +01:00
2025-11-14 18:15:49 +08:00
2025-11-04 08:30:50 +01:00
2025-10-02 18:44:54 -07:00
2025-10-29 10:29:54 +01:00
2025-09-29 11:20:29 -07:00