Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CameraShm: Fix semaphore permission issue #96

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

hao-yao
Copy link
Contributor

@hao-yao hao-yao commented Mar 5, 2024

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().

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().

Signed-off-by: Hao Yao <hao.yao@intel.com>
@hao-yao hao-yao merged commit 6718c25 into intel:dfsg Mar 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant