On Thursday, October 13, 2011 2:25:10 pm Marcel Moolenaar wrote:
> Author: marcel
> Date: Thu Oct 13 18:25:10 2011
> New Revision: 226349
> URL: http://svn.freebsd.org/changeset/base/226349
> 
> Log:
>   Wrap mprotect(2) so that we can add execute permissions when read
>   permissions are requested. This is needed on amd64 and ia64 for
>   JDK 1.4.x
> 
> Modified:
>   head/sys/compat/freebsd32/freebsd32_misc.c
>   head/sys/compat/freebsd32/freebsd32_proto.h
>   head/sys/compat/freebsd32/freebsd32_syscall.h
>   head/sys/compat/freebsd32/freebsd32_syscalls.c
>   head/sys/compat/freebsd32/freebsd32_sysent.c
>   head/sys/compat/freebsd32/freebsd32_systrace_args.c
> 
> Modified: head/sys/compat/freebsd32/freebsd32_misc.c
> ==============================================================================
> --- head/sys/compat/freebsd32/freebsd32_misc.c        Thu Oct 13 18:21:11 
> 2011        (r226348)
> +++ head/sys/compat/freebsd32/freebsd32_misc.c        Thu Oct 13 18:25:10 
> 2011        (r226349)
> @@ -437,6 +437,21 @@ freebsd32_mmap_partial(struct thread *td
>  #endif
>  
>  int
> +freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap)
> +{
> +     struct mprotect_args ap;
> +
> +     ap.addr = (void *)(uintptr_t)uap->addr;

Maybe use PTRIN() here?

> +     ap.len = uap->len;
> +     ap.prot = uap->prot;
> +#if defined(__amd64__) || defined(__ia64__)
> +     if (ap.prot & PROT_READ)
> +             ap.prot |= PROT_EXEC;
> +#endif
> +     return (sys_mprotect(td, &ap));
> +}
> +
> +int

-- 
John Baldwin
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to