halapi: Fix svace issue when accessing hal-backend file 48/259948/1 accepted/tizen/unified/20210617.124845 submit/tizen/20210617.022719
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 17 Jun 2021 02:13:13 +0000 (11:13 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 17 Jun 2021 02:14:09 +0000 (11:14 +0900)
Fix savce TOCTOU[1] issue

[1] https://wiki.sei.cmu.edu/confluence/display/c/FIO45-C.+Avoid+TOCTOU+race+conditions+while+accessing+files

Change-Id: I20e8724afd5d27eb466223315fab11ebc9faf77c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-api-common.c

index 7a98878..8f17557 100644 (file)
@@ -155,14 +155,6 @@ static int __open_backend(struct __hal_module_info *info)
                goto err;
        }
 
-       ret = access(backend_library_name, F_OK);
-       if (ret < 0) {
-               _E("%s: Failed to find backend library (%s)\n",
-                               info->module_name, backend_library_name);
-               ret = TIZEN_ERROR_INVALID_PARAMETER;
-               goto err;
-       }
-
        info->handle = dlopen(backend_library_name, RTLD_LAZY);
        if (!info->handle) {
                _E("%s: Failed to load backend library (%s)\n",