Prior to that, pass_get_hal_info() checks whether filename is
accessible or not wiht access() and then load the library through
dlopen(). This sequence between access() and dlopen() has the
TOCTOU (Time of Check to Time Of Use) issue. So, this patch just
removes the calling of access() and then only use dlopen()
in order to TOCTOU issue.
Change-Id: I510eb7bcd2e91a5bacd743ef22af92298f72b4ae
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
if (!info || !name)
return -EINVAL;
- /* Find matched module path */
- snprintf(path, sizeof(path), "%s/%s.so", MODULE_PATH, name);
- if (access(path, R_OK) != 0) {
- _E("there is no %s device", name);
- return -ENODEV;
- }
-
/* Load module */
+ snprintf(path, sizeof(path), "%s/%s.so", MODULE_PATH, name);
handle = dlopen(path, RTLD_NOW);
if (!handle) {
_E("fail to open module : %s", dlerror());