{"id":"CVE-2026-98644","state":"PUBLISHED","title":"bpf: Avoid soft lockup in __htab_map_lookup_and_delete_batch()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Avoid soft lockup in __htab_map_lookup_and_delete_batch()\n\n__htab_map_lookup_and_delete_batch() has no rescheduling point. The\nbatch count bounds how many entries are copied out, not how many\nbuckets are visited, so one BPF_MAP_LOOKUP_BATCH call can walk the\nmap end to end. The empty-bucket fast path is worse: it stays inside\na single rcu_read_lock() / bpf_disable_instrumentation() section for\nany run of consecutive empty buckets.\n\nThat holds up on small maps, but it falls apart at scale. On a\n144-CPU arm64 host running a CONFIG_PREEMPT_NONE kernel, periodic\nBPF_MAP_LOOKUP_BATCH calls against an LRU hash map with 16,777,216\nbuckets held a CPU inside the batch op for 77+ seconds and triggered\nthe soft lockup watchdog.\n\nCommit 75134f16e7dd (\"bpf: Add schedule points in batch ops\") fixed this\nsame problem in the generic batch ops, but not in this htab-native path,\nwhich every htab-based hash map variant uses for its lookup[_and_delete]\nbatch ops.\n\nComplete that fix here. Leave the critical section after 64 consecutive\nempty buckets, call cond_resched_tasks_rcu_qs(), and resume at the saved\nbucket cursor. No locks are held at that point, and resuming from the\ncursor is already the function's behavior for non-empty buckets. Add the\nsame call to the per-bucket loop after copy_to_user(), where every lock\nhas been dropped. cond_resched_rcu() is not enough here: sleeping with\nbpf_prog_active elevated makes tracing programs on that CPU silently\nskip their invocations.\n\nPlain cond_resched() is not enough either. It is a no-op under PREEMPT\nand PREEMPT_LAZY, the only models arm64 and x86 have offered since\ncommit 7dadeaa6e851 (\"sched: Further restrict the preemption modes\").\nIt is also never a Tasks RCU quiescent state, in any model: the\nreschedule counts as a preemption. The walking task stays a holdout and\nstalls every synchronize_rcu_tasks() caller, ftrace and BPF trampoline\nteardown included, until the syscall returns [1].\ncond_resched_tasks_rcu_qs() is the usual tool for that [2]. It reports\nthe quiescent state at each yield and still reschedules as\ncond_resched() does on PREEMPT_NONE and PREEMPT_VOLUNTARY kernels.","publishedAt":"2026-10-18T15:20:15.380Z","updatedAt":"2026-10-19T09:23:13.963Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"5c8b1869cb99a32a962388848cd19604fb41263e","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"ca5bd55fc508fbb5c08c62206d02237a5b6fc7e8","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"77a3b52b4455e6377e549539e757bc55eedefb51","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"f0c09de08ec077098b7e1563f2285f1c136cd816","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"44f9bcb5ab2b268bc763ed3ebec83308b4972936","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"4e48fe9b1c77966bede0a73feb3059d7595f642d","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"85136bf22404474a815fc0ed26ec0d1cbc1bc3f9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/hashtab.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.6","versionType":"semver"},{"version":"5.15.222","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.189","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.158","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.112","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.55","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.9","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/hashtab.c"]}],"references":["https://git.kernel.org/stable/c/5c8b1869cb99a32a962388848cd19604fb41263e","https://git.kernel.org/stable/c/ca5bd55fc508fbb5c08c62206d02237a5b6fc7e8","https://git.kernel.org/stable/c/77a3b52b4455e6377e549539e757bc55eedefb51","https://git.kernel.org/stable/c/f0c09de08ec077098b7e1563f2285f1c136cd816","https://git.kernel.org/stable/c/44f9bcb5ab2b268bc763ed3ebec83308b4972936","https://git.kernel.org/stable/c/4e48fe9b1c77966bede0a73feb3059d7595f642d","https://git.kernel.org/stable/c/85136bf22404474a815fc0ed26ec0d1cbc1bc3f9"],"weaknesses":[],"ingestedAt":"2026-10-29T20:13:43.249Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/98xxx/CVE-2026-98644.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-98644","state":"PUBLISHED","datePublished":"2026-10-18T15:20:15.380Z","dateUpdated":"2026-10-19T09:23:13.963Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.362Z"},"containers":{"cna":{"title":"bpf: Avoid soft lockup in __htab_map_lookup_and_delete_batch()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Avoid soft lockup in __htab_map_lookup_and_delete_batch()\n\n__htab_map_lookup_and_delete_batch() has no rescheduling point. The\nbatch count bounds how many entries are copied out, not how many\nbuckets are visited, so one BPF_MAP_LOOKUP_BATCH call can walk the\nmap end to end. The empty-bucket fast path is worse: it stays inside\na single rcu_read_lock() / bpf_disable_instrumentation() section for\nany run of consecutive empty buckets.\n\nThat holds up on small maps, but it falls apart at scale. On a\n144-CPU arm64 host running a CONFIG_PREEMPT_NONE kernel, periodic\nBPF_MAP_LOOKUP_BATCH calls against an LRU hash map with 16,777,216\nbuckets held a CPU inside the batch op for 77+ seconds and triggered\nthe soft lockup watchdog.\n\nCommit 75134f16e7dd (\"bpf: Add schedule points in batch ops\") fixed this\nsame problem in the generic batch ops, but not in this htab-native path,\nwhich every htab-based hash map variant uses for its lookup[_and_delete]\nbatch ops.\n\nComplete that fix here. Leave the critical section after 64 consecutive\nempty buckets, call cond_resched_tasks_rcu_qs(), and resume at the saved\nbucket cursor. No locks are held at that point, and resuming from the\ncursor is already the function's behavior for non-empty buckets. Add the\nsame call to the per-bucket loop after copy_to_user(), where every lock\nhas been dropped. cond_resched_rcu() is not enough here: sleeping with\nbpf_prog_active elevated makes tracing programs on that CPU silently\nskip their invocations.\n\nPlain cond_resched() is not enough either. It is a no-op under PREEMPT\nand PREEMPT_LAZY, the only models arm64 and x86 have offered since\ncommit 7dadeaa6e851 (\"sched: Further restrict the preemption modes\").\nIt is also never a Tasks RCU quiescent state, in any model: the\nreschedule counts as a preemption. The walking task stays a holdout and\nstalls every synchronize_rcu_tasks() caller, ftrace and BPF trampoline\nteardown included, until the syscall returns [1].\ncond_resched_tasks_rcu_qs() is the usual tool for that [2]. It reports\nthe quiescent state at each yield and still reschedules as\ncond_resched() does on PREEMPT_NONE and PREEMPT_VOLUNTARY kernels."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"5c8b1869cb99a32a962388848cd19604fb41263e","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"ca5bd55fc508fbb5c08c62206d02237a5b6fc7e8","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"77a3b52b4455e6377e549539e757bc55eedefb51","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"f0c09de08ec077098b7e1563f2285f1c136cd816","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"44f9bcb5ab2b268bc763ed3ebec83308b4972936","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"4e48fe9b1c77966bede0a73feb3059d7595f642d","versionType":"git"},{"version":"057996380a42bb64ccc04383cfa9c0ace4ea11f0","status":"affected","lessThan":"85136bf22404474a815fc0ed26ec0d1cbc1bc3f9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/hashtab.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.6","versionType":"semver"},{"version":"5.15.222","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.189","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.158","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.112","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.55","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.9","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/hashtab.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/5c8b1869cb99a32a962388848cd19604fb41263e"},{"url":"https://git.kernel.org/stable/c/ca5bd55fc508fbb5c08c62206d02237a5b6fc7e8"},{"url":"https://git.kernel.org/stable/c/77a3b52b4455e6377e549539e757bc55eedefb51"},{"url":"https://git.kernel.org/stable/c/f0c09de08ec077098b7e1563f2285f1c136cd816"},{"url":"https://git.kernel.org/stable/c/44f9bcb5ab2b268bc763ed3ebec83308b4972936"},{"url":"https://git.kernel.org/stable/c/4e48fe9b1c77966bede0a73feb3059d7595f642d"},{"url":"https://git.kernel.org/stable/c/85136bf22404474a815fc0ed26ec0d1cbc1bc3f9"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-19T09:23:13.963Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"5.15.222"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"6.1.189"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"6.6.158"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"6.12.112"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"6.18.55"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"7.2.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.6","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}