Fix the vm_map_remove and vm_map_protect calls.. Somewhere along the
line, these had got (start, length) arguments instead of (start, end) args. This could be the cause of Robert Sanders lockups with ZMAGIC binaries.
This commit is contained in:
parent
43ddca3392
commit
83a82ed770
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux_misc.c,v 1.13 1996/03/02 19:37:57 peter Exp $
|
||||
* $Id: linux_misc.c,v 1.14 1996/03/04 21:03:07 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -344,7 +344,7 @@ printf("uselib: Non page aligned binary %d\n", file_offset);
|
||||
|
||||
/* release temporary kernel space */
|
||||
vm_map_remove(kernel_map, buffer,
|
||||
round_page(a_out->a_text + a_out->a_data + file_offset));
|
||||
buffer + round_page(a_out->a_text + a_out->a_data + file_offset));
|
||||
|
||||
if (error)
|
||||
goto cleanup;
|
||||
@ -400,7 +400,7 @@ cleanup:
|
||||
* Release the kernel mapping.
|
||||
*/
|
||||
if (a_out)
|
||||
vm_map_remove(kernel_map, (vm_offset_t)a_out, PAGE_SIZE);
|
||||
vm_map_remove(kernel_map, (vm_offset_t)a_out, (vm_offset_t)a_out + PAGE_SIZE);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: imgact_linux.c,v 1.9 1996/03/02 19:37:47 peter Exp $
|
||||
* $Id: imgact_linux.c,v 1.10 1996/03/10 08:42:49 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -146,7 +146,7 @@ exec_linux_imgact(imgp)
|
||||
a_out->a_text + a_out->a_data);
|
||||
|
||||
vm_map_remove(kernel_map, buffer,
|
||||
round_page(a_out->a_text + a_out->a_data + file_offset));
|
||||
buffer + round_page(a_out->a_text + a_out->a_data + file_offset));
|
||||
|
||||
if (error)
|
||||
return error;
|
||||
@ -154,9 +154,11 @@ exec_linux_imgact(imgp)
|
||||
/*
|
||||
* remove write enable on the 'text' part
|
||||
*/
|
||||
error = vm_map_protect(&vmspace->vm_map, vmaddr,
|
||||
a_out->a_text,
|
||||
VM_PROT_EXECUTE|VM_PROT_READ, TRUE);
|
||||
error = vm_map_protect(&vmspace->vm_map,
|
||||
vmaddr,
|
||||
vmaddr + a_out->a_text,
|
||||
VM_PROT_EXECUTE|VM_PROT_READ,
|
||||
TRUE);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux_misc.c,v 1.13 1996/03/02 19:37:57 peter Exp $
|
||||
* $Id: linux_misc.c,v 1.14 1996/03/04 21:03:07 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -344,7 +344,7 @@ printf("uselib: Non page aligned binary %d\n", file_offset);
|
||||
|
||||
/* release temporary kernel space */
|
||||
vm_map_remove(kernel_map, buffer,
|
||||
round_page(a_out->a_text + a_out->a_data + file_offset));
|
||||
buffer + round_page(a_out->a_text + a_out->a_data + file_offset));
|
||||
|
||||
if (error)
|
||||
goto cleanup;
|
||||
@ -400,7 +400,7 @@ cleanup:
|
||||
* Release the kernel mapping.
|
||||
*/
|
||||
if (a_out)
|
||||
vm_map_remove(kernel_map, (vm_offset_t)a_out, PAGE_SIZE);
|
||||
vm_map_remove(kernel_map, (vm_offset_t)a_out, (vm_offset_t)a_out + PAGE_SIZE);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user