Repository navigation
fix(native-protocol): add O_NOFOLLOW to lock file creation - #294
Open
deepin-ci-robot wants to merge 1 commit into
Open
deepin-ci-robot wants to merge 1 commit into
deepin-ci-robot wants to merge 1 commit into
Conversation
The lock_socket() function opens the lock file without O_NOFOLLOW. If an attacker places a symlink at the lock file path, open() follows it and creates or truncates a file at the symlink target with the caller's privileges. While the lock path is typically in a user-owned runtime directory, adding O_NOFOLLOW is a low-cost defense-in-depth measure that prevents symlink attacks in case the directory permissions are misconfigured or the path is influenced by untrusted input. Changes: - Add debian/patches/fix-native-protocol-add-o-nofollow-to-lock-file-creation.patch - Modify debian/patches/series - Modify debian/changelog Upstream: PipeWire/pipewire@95ef466 Generated-By: glm-5.3-flash Co-Authored-By: deepin-ci-robot <packages@deepin.org>
Contributor
Author
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
TAG Bot TAG: 1.6.4-1deepin30 |
Contributor
Author
|
/hold |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Before the Change
The
lock_socket()function in the native protocol module opened the lock file withopen(s->lock_addr, O_CREAT | O_CLOEXEC, ...)withoutO_NOFOLLOW. If an attacker places a symlink at the lock file path,open()follows it and creates or truncates a file at the symlink target with the caller's privileges. While the lock path is typically in a user-owned runtime directory, this leaves a symlink-attack window when directory permissions are misconfigured or the path is influenced by untrusted input.What This PR Changes
Backport upstream PipeWire commit 95ef466b9bd7: add the
O_NOFOLLOWflag to theopen()call inlock_socket()insrc/modules/module-protocol-native.c, so the kernel rejects the path withELOOPinstead of following a symlink at the lock file location.Problem Solved After the Change
Symlink attacks against the native protocol lock file are blocked as a low-cost defense-in-depth measure, without affecting the normal file locking logic.
Changes
Upstream
PipeWire/pipewire@95ef466b9bd7
Generated-By: glm-5.3-flash
Co-Authored-By: deepin-ci-robot packages@deepin.org