Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2011 15:25:39 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Marcel Moolenaar <marcel@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r226349 - head/sys/compat/freebsd32
Message-ID:  <201110131525.39464.jhb@freebsd.org>
In-Reply-To: <201110131825.p9DIPAJs027201@svn.freebsd.org>
References:  <201110131825.p9DIPAJs027201@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110131525.39464.jhb>