[haiku-commits] Re: BRANCH pdziepak-github.aslr - src/system/kernel/vm headers/os/kernel

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 27 Feb 2013 16:10:17 +0100

Am 26/02/2013 22:47, schrieb Pawel Dziepak:
2013/2/26 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
The scheduler is already using its own random function; maybe it makes sense
to put that all into some utility code.
Besides that, we keep the methods in declaration order, and keep class
methods together; IOW that helper functions should go to some place before
the class methods.
I am afraid it is not that easy. [...]
Nevertheless, there is not point in making scheduler and ASLR use the
same PRNG since they have different requirements.

Note that I did not suggested to merge the two - I agree with you that they should stay separated. I merely wanted to suggest to move such utility functions to a common place -- where others might use it as they see fit.

I don't see where you change the size requirements of areas with a
randomized start pointer - it might need a page more.
_RandomizeAddress randomizes address with page granularity so that
there is no reason to adjust the area size. Inside the page
randomization is only performed in special cases and is not handled
here (like initial stack pointer randomization from previous commit).

That's exactly why the size requirements change. If you want to create a 4K area with a randomized base, you will now most probably need an 8K area. I wonder why to put that logic into the client if the kernel already supports randomizing the base (which could be done by the client, too).

Bye,
   Axel.


Other related posts: