Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Nov 2009 11:42:32 +0000
From:      "Robert N. M. Watson" <rwatson@freebsd.org>
To:        Sharad Chandra <sharadc@in.niksun.com>
Cc:        Kostik Belousov <kostikbel@gmail.com>, freebsd-hackers@freebsd.org, Manprit Singh <manprits@in.niksun.com>, Jung-uk Kim <jkim@freebsd.org>
Subject:   Re: mprotect(2) clears the flag for whole page which causes program crash.
Message-ID:  <80FAFE47-C19C-4666-A279-6AF6DA8B6127@freebsd.org>
In-Reply-To: <200911191627.34076.sharadc@in.niksun.com>
References:  <200911171529.20098.sharadc@in.niksun.com> <alpine.BSF.2.00.0911181849460.12162@fledge.watson.org> <200911181433.52557.jkim@FreeBSD.org> <200911191627.34076.sharadc@in.niksun.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 19 Nov 2009, at 10:57, Sharad Chandra wrote:

> Thanks everyone. mmap(2) worked and program did not crash. Only =
problem with=20
> it I use only fraction of allocated memory (each request alocate =
minimum of=20
> one page and my request is in hundreds), rest is waste of it so no one =
else=20
> will get this memory to use. And if a process runs as daemon and makes =
many=20
> request, It can hold a lot of it. Just a question floated in mind.


One of the defining properties of pages is that they are the granularity =
at which access protections are controlled in hardware, so your choices =
are a minimum of one page per object, or having multiple objects that =
share the same protection properties. However, it could be that you =
could accomplish whatever your goals may be using techniques other than =
paging; for example, using ptrace(2) to instrument individual accesses, =
binary rewriting, a virtual machine, source code instrumentation, or =
other methods along those lines that have been used for debugging and =
security over the years.

Robert=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?80FAFE47-C19C-4666-A279-6AF6DA8B6127>