On 12/01/2013 04:44 PM, Pawel Dziepak wrote:
2013/12/1 Ingo Weinhold <ingo_weinhold@xxxxxx>:I'd suggest to replace B_RANDOMIZED_{ANY,BASE}_ADDRESS by B_{ANY,BASE}_ADDRESS_DETERMINISTIC, make B_{ANY,BASE}_ADDRESS randomize by default, and don't map the address spec constants in _user_create_area() anymore. The advantages would be consistency and a simple way to avoid randomization, if needed.We are not able to guarantee that an area will be created at deterministic location once at least one randomized area (e.g. main thread stack) has been created. If an application for some reason needs deterministic addresses then all areas have to be created with ASLR disabled. However, the possibility to disable ASLR for a specific team makes things much easier. If it is enabled then even if we don't perform any explicit randomization for an area its address is non-deterministic due to randomized locations of already created areas. When, it is disabled, well, then we have all locations deterministic. That's why I think we don't need neither B_RANDOMIZED_{ANY,BASE}_ADDRESS nor B_{ANY,BASE}_ADDRESS_DETERMINISTIC, disabling ASLR for specific team should suffice.
You're right wrt. B_ANY_ADDRESS_DETERMINISTIC. When the caller isn't interested in a specific address anyway, it can as well be randomized. B_BASE_ADDRESS_DETERMINISTIC, however, does make sense when used for optimization purposes (e.g. if an adjoining allocation is preferred).
CU, Ingo