Check for unknown flags passed to dlopen(3).

Change-Id: I56f4aab0e5a1487bc32d2c4d231e8bd15c4ac8da
This commit is contained in:
Elliott Hughes
2012-12-18 15:57:55 -08:00
parent 4c4b08a32e
commit e66190d2a9
6 changed files with 46 additions and 21 deletions

View File

@@ -966,7 +966,11 @@ static int soinfo_unload(soinfo* si) {
return 0;
}
soinfo* do_dlopen(const char* name) {
soinfo* do_dlopen(const char* name, int flags) {
if ((flags & ~(RTLD_NOW|RTLD_LAZY|RTLD_LOCAL|RTLD_GLOBAL)) != 0) {
DL_ERR("invalid flags to dlopen: %x", flags);
return NULL;
}
set_soinfo_pool_protection(PROT_READ | PROT_WRITE);
soinfo* si = find_library(name);
if (si != NULL) {