Commit 8ff4adf
committed
harden(virtio-mmio): preserve cumulative status bits across transitions
Backports the MMIO portion of upstream PR firecracker-microvm#5818 (commit 4a52198).
Replaces the match on `!self.device_status & status` with an explicit
VALID_TRANSITIONS table and equality check, so writes that drop
previously-set bits (e.g. FEATURES_OK alone after the device is in
state ACK | DRIVER | FEATURES_OK | DRIVER_OK) are rejected.
This is *not* a fix for CVE-2026-5747. Per AWS security bulletin
2026-015, that CVE is specific to the virtio PCI transport, which is
opt-in via --enable-pci and was added upstream in v1.13.0. Our fork
is based on v1.6.5 and has no PCI transport, so the CVE itself does
not apply. Upstream's PR firecracker-microvm#5818 included a parenthetical defensive
hardening of the MMIO transport ("Note: virtio MMIO transport also
didn't [enforce cumulative bits]") and that is what this commit
backports — for consistency with upstream's stricter behaviour and
defence-in-depth, not because of an active CVE.
The upstream commit could not be cherry-picked cleanly because by
v1.15.x the mmio transport lives at src/vmm/src/devices/virtio/
transport/mmio.rs, 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 audits can compare line-for-line.1 parent 138c9f9 commit 8ff4adf
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