Remap all preloaded executables read-only and executable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19180 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -820,6 +820,10 @@ insert_preloaded_image(struct preloaded_image *preloadedImage, bool kernel)
|
|||||||
preloadedImage->id = image->id;
|
preloadedImage->id = image->id;
|
||||||
// modules_init() uses this information to get the preloaded images
|
// modules_init() uses this information to get the preloaded images
|
||||||
|
|
||||||
|
// we now no longer need to write to the text area anymore
|
||||||
|
set_area_protection(image->text_region.id,
|
||||||
|
B_KERNEL_READ_AREA | B_KERNEL_EXECUTE_AREA);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
error1:
|
error1:
|
||||||
|
|||||||
@@ -2167,6 +2167,8 @@ create_preloaded_image_areas(struct preloaded_image *image)
|
|||||||
image->text_region.id = create_area(name, &address, B_EXACT_ADDRESS,
|
image->text_region.id = create_area(name, &address, B_EXACT_ADDRESS,
|
||||||
PAGE_ALIGN(image->text_region.size), B_ALREADY_WIRED,
|
PAGE_ALIGN(image->text_region.size), B_ALREADY_WIRED,
|
||||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
||||||
|
// this will later be remapped read-only/executable by the
|
||||||
|
// ELF initialization code
|
||||||
|
|
||||||
strcpy(name + length, "_data");
|
strcpy(name + length, "_data");
|
||||||
address = (void *)ROUNDOWN(image->data_region.start, B_PAGE_SIZE);
|
address = (void *)ROUNDOWN(image->data_region.start, B_PAGE_SIZE);
|
||||||
|
|||||||
Reference in New Issue
Block a user