{"id":"CVE-2026-98040","aliases":["CVE-2026-98040"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Mark the zero register precise for a register-form NULL check","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Mark the zero register precise for a register-form NULL check\n\ncheck_cond_jmp_op() accepts \"if rA <op> rB\" as a NULL check for a\nnullable pointer rA when rB is a scalar known to be zero,\nlifts PTR_MAYBE_NULL from rA in the corresponding branch and does not\nmark rB precise. Consider the following program:\n\n  r0 = bpf_get_prandom_u32();\n  r6 = 1;                  /* the r6 == 0 path is explored first */\n  if (r0 == 0) goto 1f;\n  r6 = 0;\n1:\n  r0 = bpf_map_lookup_elem(map, &0);  /* absent, NULL at runtime */\n  if (r0 == r6) goto 2f;   /* taken as a NULL check for r0       */\n  *(u8 *)(r0 + 0);         /* verifier: map value; runtime: zero */\n2:\n  return 0;\n\nThe r6 == 0 path is explored first and the dereference is accepted.\nThe r6 == 1 path is pruned at the checkpoint recorded for (1),\nso the comparison is never verified with a non-zero r6. At runtime a\nfailed lookup returns NULL, NULL != 1 takes the non-NULL edge and the\nprogram dereferences a pointer that is zero.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Mark the zero register precise for a register-form NULL check\n\ncheck_cond_jmp_op() accepts \"if rA <op> rB\" as a NULL check for a\nnullable pointer rA when rB is a scalar known to be zero,\nlifts PTR_MAYBE_NULL from rA in the corresponding branch and does not\nmark rB precise. Consider the following program:\n\n  r0 = bpf_get_prandom_u32();\n  r6 = 1;                  /* the r6 == 0 path is explored first */\n  if (r0 == 0) goto 1f;\n  r6 = 0;\n1:\n  r0 = bpf_map_lookup_elem(map, &0);  /* absent, NULL at runtime */\n  if (r0 == r6) goto 2f;   /* taken as a NULL check for r0       */\n  *(u8 *)(r0 + 0);         /* verifier: map value; runtime: zero */\n2:\n  return 0;\n\nThe r6 == 0 path is explored first and the dereference is accepted.\nThe r6 == 1 path is pruned at the checkpoint recorded for (1),\nso the comparison is never verified with a non-zero r6. At runtime a\nfailed lookup returns NULL, NULL != 1 takes the non-NULL edge and the\nprogram dereferences a pointer that is zero.","source":"cvelist"}],"published":"2026-09-25T10:23:53.001Z","modified":"2026-10-19T10:17:57.910Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2f4cb53eed448c1aeb6f4b40cf9c810716d8218c","fixed":"ddca9a3b8833168dda3e62676648a636fb3f221c","status":"affected"},{"type":"git","introduced":"2f4cb53eed448c1aeb6f4b40cf9c810716d8218c","fixed":"6aed0134d3cda6382385a734ae0158eb7df6b142","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"7.1","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.1","status":"unaffected"},{"type":"semver","introduced":"7.2.7","lastAffected":"7.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.3","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/ddca9a3b8833168dda3e62676648a636fb3f221c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6aed0134d3cda6382385a734ae0158eb7df6b142","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-98040","url":"https://www.cve.org/CVERecord?id=CVE-2026-98040","licence":"CVE Terms of Use","modified":"2026-10-19T09:12:46.084Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-98040","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98040","licence":"Public domain","modified":"2026-10-19T10:17:57.910Z"}],"updatedAt":"2026-11-25T22:59:41.033Z","epss":{"score":0.00198,"percentile":0.05453,"date":"2026-11-30T12:00:22.000Z"}}