Commit fb81c21
committed
fix(virtio-mmio): preserve cumulative status bits (CVE-2026-5747)
The previous match-based state machine validated which new bit was being
set against the current device_status, but then assigned
self.device_status = status using the raw guest-supplied value. A guest
could write FEATURES_OK alone instead of ACKNOWLEDGE | DRIVER |
FEATURES_OK, dropping previously-set bits and breaking the virtio state
machine invariants.
Replace the match with a VALID_TRANSITIONS table and an explicit
equality check. Anything not in the table (including bit-drop attacks
and skip-step writes) is rejected with a warning.
Manual port of upstream commit 4a52198 (PR firecracker-microvm#5818). The upstream
commit could not be cherry-picked cleanly because by v1.15.x the
mmio transport lives in a different file, the activate() signature
gained an interrupt argument, and the failure path uses
DEVICE_NEEDS_RESET / VirtioInterruptType, none of which exist in
v1.6.5. The control flow and the VALID_TRANSITIONS contents are
deliberately kept identical to upstream so future security audits
can compare line-for-line.
CVE: CVE-2026-57471 parent cd30568 commit fb81c21
1 file changed
Lines changed: 43 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
182 | 200 | | |
183 | | - | |
184 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
185 | 206 | | |
186 | | - | |
187 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
188 | 215 | | |
189 | 216 | | |
190 | 217 | | |
191 | 218 | | |
192 | 219 | | |
193 | 220 | | |
194 | 221 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
| |||
0 commit comments