Re: [PATCH v1 1/1] fix: resource leakage when loading library using dlopen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 2015-09-07 12:42, Imran Zaman wrote:
>@@ -579,7 +580,8 @@ static void *load_extension(const char *search_path, const char *af_prefix,
> 					strerror(errno));
> 				return NULL;
> 			}
>-			if (dlopen(path, RTLD_NOW) == NULL) {
>+			handle = dlopen(path, RTLD_NOW);
>+			if (handle == NULL) {
> 				fprintf(stderr, "%s: %s\n", path, dlerror());
> 				break;
> 			}
>@@ -590,6 +592,7 @@ static void *load_extension(const char *search_path, const char *af_prefix,
> 				ptr = xtables_find_match(name,
> 				      XTF_DONT_LOAD, NULL);
> 
>+			dlclose(handle);
> 			if (ptr != NULL)
> 				return ptr;
> 

Seriously? If you close the handle, then ptr->init will point to
invalid memory and the thing should crash.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux