Repository navigation
Commit af793ce
committed
virt_mshv_vtl: fix TDX legacy LGDT/LIDT descriptor decode panic
Legacy-mode LGDT/LIDT descriptors carry a 4-byte base, but the decoder
always converted the base bytes to a u64, panicking on valid input.
Zero-extend the legacy 32-bit base and validate the descriptor length.
Test changes:
- Verify a legacy 6-byte descriptor decodes without panicking.
- Verify a long-mode 10-byte descriptor keeps its full 64-bit base.1 parent 35dfc23 commit af793ce
3 files changed
Lines changed: 49 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10294 | 10294 | | |
10295 | 10295 | | |
10296 | 10296 | | |
| 10297 | + | |
10297 | 10298 | | |
10298 | 10299 | | |
10299 | 10300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3254 | 3254 | | |
3255 | 3255 | | |
3256 | 3256 | | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
3257 | 3271 | | |
3258 | 3272 | | |
3259 | 3273 | | |
| |||
3456 | 3470 | | |
3457 | 3471 | | |
3458 | 3472 | | |
3459 | | - | |
3460 | | - | |
3461 | | - | |
3462 | | - | |
| 3473 | + | |
3463 | 3474 | | |
3464 | 3475 | | |
3465 | 3476 | | |
| |||
4616 | 4627 | | |
4617 | 4628 | | |
4618 | 4629 | | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
4619 | 4660 | | |
4620 | 4661 | | |
4621 | 4662 | | |
| |||
0 commit comments