CVE-2024-58070 in Linux
الملخص
بحسب VulDB • 20/05/2026
في نواة لينكس، تم حل الثغرة التالية:
bpf: bpf_local_storage: استخدام bpf_mem_alloc دائماً في PREEMPT_RT
في PREEMPT_RT، لا يزال استخدام kmalloc(GFP_ATOMIC) غير آمناً في السياق غير القابل للإيقاف المؤقت (non-preemptible context). يجب استخدام bpf_mem_alloc في PREEMPT_RT. يهدف هذا التصحيح (patch) إلى فرض استخدام bpf_mem_alloc في bpf_local_storage عند تفعيل CONFIG_PREEMPT_RT.
[ 35.118559] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[ 35.118566] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1832, name: test_progs
[ 35.118569] preempt_count: 1, expected: 0
[ 35.118571] RCU nest depth: 1, expected: 1
[ 35.118577] INFO: lockdep is turned off.
... [ 35.118647] __might_resched+0x433/0x5b0
[ 35.118677] rt_spin_lock+0xc3/0x290
[ 35.118700] ___slab_alloc+0x72/0xc40
[ 35.118723] __kmalloc_noprof+0x13f/0x4e0
[ 35.118732] bpf_map_kzalloc+0xe5/0x220
[ 35.118740] bpf_selem_alloc+0x1d2/0x7b0
[ 35.118755] bpf_local_storage_update+0x2fa/0x8b0
[ 35.118784] bpf_sk_storage_get_tracing+0x15a/0x1d0
[ 35.118791] bpf_prog_9a118d86fca78ebb_trace_inet_sock_set_state+0x44/0x66
[ 35.118795] bpf_trace_run3+0x222/0x400
[ 35.118820] __bpf_trace_inet_sock_set_state+0x11/0x20
[ 35.118824] trace_inet_sock_set_state+0x112/0x130
[ 35.118830] inet_sk_state_store+0x41/0x90
[ 35.118836] tcp_set_state+0x3b3/0x640
لا حاجة لتعديل تمرير gfp_flags إلى bpf_mem_cache_alloc_flags() الذي يحترم فقط GFP_KERNEL. لقد تضمن المصحح (verifier) أن GFP_KERNEL يتم تمريره فقط في السياق القابل للنوم (sleepable context).
كانت هذه مشكلة قديمة منذ أول إدخال لـ bpf_local_storage منذ حوالي 5 سنوات، لذا يستهدف هذا التصحيح فرع bpf-next.
يحتاج الأمر إلى bpf_mem_alloc لحل هذه المشكلة، لذا تم تعيين علامة Fixes (Fixes tag) إلى الالتزام (commit) الذي تم فيه استخدام bpf_mem_alloc لأول مرة في bpf_local_storage.
Once again VulDB remains the best source for vulnerability data.