Skip to content

Commit 37bfe3e

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 13a3eee commit 37bfe3e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/nested-svm-vmrun/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,16 @@ static void build_l2_vmcb(void)
9595
* Flat 64-bit segments, mirroring how XTF sets up L1.
9696
* Encoded segment attributes (P|DPL|S|Type|...|G|D/B|L|AVL):
9797
* CS: present, ring 0, code, exec/read, L=1 -> 0xa9b
98-
* DS/ES/SS/FS/GS: present, ring 3, data, read/write, G=1 -> 0xcf3 (DPL3)
98+
* DS/ES/FS/GS: present, ring 3, data, read/write, G=1 -> 0xcf3 (DPL3)
99+
* SS: NULL selector in hvm64, so mark it unusable/null.
99100
*/
100101
l2_vmcb.cs.sel = __KERN_CS;
101102
l2_vmcb.cs.attr = 0xa9b;
102103
l2_vmcb.cs.limit = ~0u;
103104

104105
l2_vmcb.ss.sel = __KERN_DS;
105-
l2_vmcb.ss.attr = 0xcf3;
106-
l2_vmcb.ss.limit = ~0u;
106+
l2_vmcb.ss.attr = 0;
107+
l2_vmcb.ss.limit = 0;
107108

108109
l2_vmcb.ds.sel = __USER_DS;
109110
l2_vmcb.ds.attr = 0xcf3;

0 commit comments

Comments
 (0)