intel / ipu6-camera-hal

Apache License 2.0
39 stars 32 forks source link

CameraShm: Fix semaphore permission issue #96

Closed hao-yao closed 7 months ago

hao-yao commented 7 months ago

When user created semaphore with mode 777, the actual mode of it may not be expected because of umask. In this case, another non-root user calling sem_open will get error EACCES then mSemLock is 0, which can cause later segment fault. To avoid this, we directly change the semaphore file mode to 0666 by chmod and add null check in lock().