Commit 25697797 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Require ASLR support on non-x86 platforms.

parent 518e3947
...@@ -726,6 +726,15 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s ...@@ -726,6 +726,15 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
if (!is_machine_32bit( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT; if (!is_machine_32bit( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT;
if (!is_machine_supported( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT; if (!is_machine_supported( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT;
if (nt.FileHeader.Machine != IMAGE_FILE_MACHINE_I386) /* non-x86 platforms are more strict */
{
if (nt.opt.hdr32.SectionAlignment & page_mask)
return STATUS_INVALID_IMAGE_FORMAT;
if (!(nt.opt.hdr32.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
return STATUS_INVALID_IMAGE_FORMAT;
if (!(nt.opt.hdr32.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE))
return STATUS_INVALID_IMAGE_FORMAT;
}
if (nt.opt.hdr32.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR) if (nt.opt.hdr32.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR)
{ {
clr_va = nt.opt.hdr32.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress; clr_va = nt.opt.hdr32.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
...@@ -760,6 +769,15 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s ...@@ -760,6 +769,15 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
if (!is_machine_64bit( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT; if (!is_machine_64bit( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT;
if (!is_machine_supported( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT; if (!is_machine_supported( nt.FileHeader.Machine )) return STATUS_INVALID_IMAGE_FORMAT;
if (nt.FileHeader.Machine != IMAGE_FILE_MACHINE_AMD64) /* non-x86 platforms are more strict */
{
if (nt.opt.hdr64.SectionAlignment & page_mask)
return STATUS_INVALID_IMAGE_FORMAT;
if (!(nt.opt.hdr64.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
return STATUS_INVALID_IMAGE_FORMAT;
if (!(nt.opt.hdr64.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE))
return STATUS_INVALID_IMAGE_FORMAT;
}
if (nt.opt.hdr64.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR) if (nt.opt.hdr64.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR)
{ {
clr_va = nt.opt.hdr64.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress; clr_va = nt.opt.hdr64.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment