{"id":"CVE-2026-98719","kind":"vulnerability","aliases":["CVE-2026-98719"],"related":[],"title":"Linux kernel KVM SEV: double-free of CPU mask on guest init failure","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: SEV: Nullify \"have run CPUs\" mask pointer when freeing it\n\nNullify have_run_cpus when freeing the mask, particularly in the error path\nof __sev_guest_init(), so that KVM doesn't have to subtly use sev->active\nto track whether or not the mask has been freed.  As pointed out by Sashiko,\nblindly freeing the mask in sev_vm_destroy() results in a double-free if\nthe mask is freed if __sev_guest_init() fails.\n\nThrow the logic in a helper as nullifying the pointer is frustratingly\ndifficult and weird due to have_run_cpus being a single-entry array when\nCPUMASK_OFFSTACK=n.  Deliberately don't use CPUMASK_VAR_NULL, as it's not\ndirectly assignable when the cpumask is on-stack, e.g. requires using a\nlocal variable and a memcpy(), which is beyond ridiculous.  Furthermore,\nwhile clearing the on-stack bitmask is an unnecessary and arguably unwanted\nside effect, KVM absolutely relies on '0' being the \"null\" value given that\nthe struct is zero-allocated.\n\nOpportunistically add an alloc() helper to pair with free(); there are just\nenough call sites to make doing so worthwhile.","summary":"The Linux kernel's KVM SEV code could free the have-run-CPUs mask twice when guest initialization failed, because the pointer was not cleared after freeing. The fix nullifies the pointer when the mask is freed and routes allocation and freeing through helpers.","severity":"unknown","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["amd-sev","kvm","linux","runtime"],"not_affected_if":["no-sev-guests"],"how_to_check":null,"fix":null,"status":"open","published_at":"2026-10-18T16:17:25+00:00","first_seen_at":"2026-10-23T21:57:16+00:00","triaged_at":"2026-10-25T05:17:23+00:00","updated_at":"2026-10-25T05:17:23+00:00","category":"runtime","confidence":0.3,"triage":{"at":"2026-10-25T05:17:23Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"local","title":"Linux kernel KVM SEV: double-free of CPU mask on guest init failure","impact":"low","summary":"The Linux kernel's KVM SEV code could free the have-run-CPUs mask twice when guest initialization failed, because the pointer was not cleared after freeing. The fix nullifies the pointer when the mask is freed and routes allocation and freeing through helpers.","category":"runtime","nicknames":[],"who_cares":["linux","kvm","amd-sev"],"confidence":0.3,"needs_auth":"unknown","worst_case":"unknown","analyst_note":"Sources give only the kernel commit text; check the NVD or kernel.org stable advisory for affected and fixed kernel versions and the CVSS score.","how_to_check":"unknown","needs_analyst":true,"not_affected_if":["no-sev-guests"],"who_is_affected":"unknown","user_interaction":"no","needs_special_setup":"unknown","severity_if_unknown":"low"},"cost_usd":0.000545,"input_tokens":3668,"output_tokens":356,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'-2026':16A,19A '-98719':17A,20A '0':243C 'absolut':240C 'activ':120C 'add':257C 'alloc':67B,255C,259C 'amd':22B 'amd-sev':21B 'arguabl':235C 'array':185C 'assign':202C 'beyond':221C 'bitmask':230C 'blind':136C 'call':269C 'clear':52B,225C 'code':33B 'could':34B 'cpu':9A 'cpumask':187C,194C,205C 'cpus':40B,87C,96C,179C 'cve':15A,18A 'deliber':190C 'destroy':143C 'difficult':172C 'direct':201C 'doesn':113C 'doubl':6A,148C 'double-fre':5A,147C 'due':175C 'e.g':210C 'effect':238C 'enough':268C 'entri':184C 'error':104C 'fail':46B,159C 'failur':14A 'fix':56B 'follow':77C 'free':7A,35B,54B,69B,91C,98C,137C,149C,264C 'freed':64B,130C,154C 'frustrat':171C 'furthermor':223C 'given':248C 'guest':12A,44B,108C,157C 'have-run-cpus':37B 'helper':71B,165C,260C 'init':13A,109C,158C 'initi':45B 'kernel':2A,29B,75C 'kvm':3A,24B,31B,82C,112C,239C 'linux':1A,25B,28B,74C 'local':214C 'logic':162C 'make':272C 'mask':10A,41B,62B,88C,100C,127C,139C,152C 'memcpi':218C 'n':189C 'null':196C,246C 'nullifi':57B,84C,93C,167C 'offstack':188C 'on-stack':207C,227C 'opportunist':256C 'pair':262C 'particular':101C 'path':105C 'point':132C 'pointer':49B,59B,89C,169C 'reli':241C 'requir':211C 'resolv':81C 'result':144C 'ridicul':222C 'rout':66B 'run':39B,86C,95C,178C 'runtim':26B 'sashiko':135C 'sev':4A,23B,32B,83C,107C,119C,141C,156C 'side':237C 'singl':183C 'single-entri':182C 'site':270C 'stack':209C,229C 'struct':251C 'subt':117C 'throw':160C 'track':122C 'twice':42B 'unnecessari':233C 'unwant':236C 'use':118C,193C,212C 'valu':247C 'var':195C 'variabl':215C 'vm':142C 'vulner':78C 'weird':174C 'whether':123C 'worthwhil':275C 'zero':254C 'zero-alloc':253C","nicknames":[],"mitigations":[],"who_affected":null,"tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-18T16:17:25+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-98719","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98719","severity":null,"published_at":"2026-10-18T16:17:25+00:00","modified_at":"2026-10-19T10:19:36+00:00","first_seen_at":"2026-10-23T21:57:16+00:00","fetched_at":"2026-10-23T22:28:56+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}