Commit 7599da6
CKI KWF Bot
Merge: CVE-2025-39843 kernel: mm: slub: avoid wake up kswapd in set_track_prepare
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7548
JIRA: https://issues.redhat.com/browse/RHEL-125520
CVE: CVE-2025-39843
mm: slub: avoid wake up kswapd in set_track_prepare
set_track_prepare() can incur lock recursion.
The issue is that it is called from hrtimer_start_range_ns
holding the per_cpu(hrtimer_bases)[n].lock, but when enabled
CONFIG_DEBUG_OBJECTS_TIMERS, may wake up kswapd in set_track_prepare,
and try to hold the per_cpu(hrtimer_bases)[n].lock.
Avoid deadlock caused by implicitly waking up kswapd by passing in
allocation flags, which do not contain __GFP_KSWAPD_RECLAIM in the
debug_objects_fill_pool() case. Inside stack depot they are processed by
gfp_nested_mask().
Since ___slab_alloc() has preemption disabled, we mask out
__GFP_DIRECT_RECLAIM from the flags there.
Signed-off-by: Audra Mitchell <audra@redhat.com>
Approved-by: Rafael Aquini <raquini@redhat.com>
Approved-by: Herton R. Krzesinski <herton@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>1 file changed
+34
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | | - | |
| 900 | + | |
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
907 | | - | |
| 907 | + | |
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
| 912 | + | |
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
| 934 | + | |
935 | 935 | | |
936 | | - | |
| 936 | + | |
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| |||
1826 | 1826 | | |
1827 | 1827 | | |
1828 | 1828 | | |
1829 | | - | |
| 1829 | + | |
1830 | 1830 | | |
1831 | | - | |
| 1831 | + | |
1832 | 1832 | | |
1833 | 1833 | | |
1834 | 1834 | | |
| |||
3514 | 3514 | | |
3515 | 3515 | | |
3516 | 3516 | | |
3517 | | - | |
3518 | | - | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
3519 | 3537 | | |
3520 | 3538 | | |
3521 | 3539 | | |
| |||
3535 | 3553 | | |
3536 | 3554 | | |
3537 | 3555 | | |
3538 | | - | |
| 3556 | + | |
| 3557 | + | |
3539 | 3558 | | |
3540 | 3559 | | |
3541 | 3560 | | |
| |||
3551 | 3570 | | |
3552 | 3571 | | |
3553 | 3572 | | |
3554 | | - | |
3555 | | - | |
3556 | | - | |
3557 | | - | |
3558 | | - | |
3559 | | - | |
3560 | | - | |
3561 | | - | |
3562 | | - | |
3563 | | - | |
3564 | | - | |
3565 | | - | |
3566 | | - | |
3567 | | - | |
3568 | 3573 | | |
3569 | 3574 | | |
3570 | 3575 | | |
| |||
4027 | 4032 | | |
4028 | 4033 | | |
4029 | 4034 | | |
| 4035 | + | |
| 4036 | + | |
| 4037 | + | |
| 4038 | + | |
4030 | 4039 | | |
4031 | | - | |
| 4040 | + | |
4032 | 4041 | | |
4033 | 4042 | | |
4034 | 4043 | | |
| |||
0 commit comments