Skip to content

Commit 7534945

Browse files
author
Sean Christopherson
committed
Bug fix - mprotect may be called with wrong flags
Query si_flags instead of attributes when determining whether a layout entry should be readable/writable or not accessible. The current code magically works because all layout entries that should be marked R/W will have a non-zero value for attributes since added pages are marked with either ADD_EXTEND_PAGE or ADD_EXTEND_PAGE. Signed-off-by: Sean Christopherson <[email protected]>
1 parent dd537b7 commit 7534945

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

psw/urts/loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ int CLoader::set_context_protection(layout_t *layout_start, layout_t *layout_end
752752
if (!IS_GROUP_ID(layout->group.id))
753753
{
754754
int prot = 0 ;
755-
if(layout->entry.attributes == SI_FLAG_NONE)
755+
if(layout->entry.si_flags == SI_FLAG_NONE)
756756
{
757757
prot = SI_FLAG_NONE & SI_MASK_MEM_ATTRIBUTE;
758758
}

0 commit comments

Comments
 (0)