CVE-2024-26880: dm: call the resume method on internal suspend

Description

In the Linux kernel, the following vulnerability has been resolved:

dm: call the resume method on internal suspend

There is this reported crash when experimenting with the lvm2 testsuite.
The list corruption is caused by the fact that the postsuspend and resume
methods were not paired correctly; there were two consecutive calls to the
origin_postsuspend function. The second call attempts to remove the
"hash_list" entry from a list, while it was already removed by the first
call.

Fix __dm_internal_resume so that it calls the preresume and resume
methods of the table's targets.

If a preresume method of some target fails, we are in a tricky situation.
We can't return an error because dm_internal_resume isn't supposed to
return errors. We can't return success, because then the "resume" and
"postsuspend" methods would not be paired correctly. So, we set the
DMF_SUSPENDED flag and we fake normal suspend - it may confuse userspace
tools, but it won't cause a kernel crash.

------------[ cut here ]------------
kernel BUG at lib/list_debug.c:56!
invalid opcode: 0000 [#1] PREEMPT SMP
CPU: 1 PID: 8343 Comm: dmsetup Not tainted 6.8.0-rc6 #4
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
RIP: 0010:__list_del_entry_valid_or_report+0x77/0xc0

RSP: 0018:ffff8881b831bcc0 EFLAGS: 00010282
RAX: 000000000000004e RBX: ffff888143b6eb80 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff819053d0 RDI: 00000000ffffffff
RBP: ffff8881b83a3400 R08: 00000000f...

Classification

CVE ID: CVE-2024-26880

Affected Products

Vendor: Linux

Product: Linux

Exploit Prediction Scoring System (EPSS)

EPSS Score: 0.04% (probability of being exploited)

EPSS Percentile: 15.23% (scored less or equal to compared to others)

EPSS Date: 2025-02-03 (when was this score calculated)

References

https://git.kernel.org/stable/c/69836d9329f0b4c58faaf3d886a7748ddb5bf718
https://git.kernel.org/stable/c/da7ece2197101b1469853e6b5e915be1e3896d52
https://git.kernel.org/stable/c/f89bd27709376d37ff883067193320c58a8c1d5a
https://git.kernel.org/stable/c/03ad5ad53e51abf3a4c7538c1bc67a5982b41dc5
https://git.kernel.org/stable/c/ad10289f68f45649816cc68eb93f45fd5ec48a15
https://git.kernel.org/stable/c/15a3fc5c8774c17589dabfe1d642d40685c985af
https://git.kernel.org/stable/c/ef02d8edf738557af2865c5bfb66a03c4e071be7
https://git.kernel.org/stable/c/360a7d1be8112654f1fb328ed3862be630bca3f4
https://git.kernel.org/stable/c/65e8fbde64520001abf1c8d0e573561b4746ef38

Timeline