Skip to content

fix(native-protocol): add O_NOFOLLOW to lock file creation - #294

Open
deepin-ci-robot wants to merge 1 commit into
deepin-community:masterfrom
deepin-ci-robot:backport/fix-native-protocol-o-nofollow-lock-file
Open

deepin-ci-robot wants to merge 1 commit into
deepin-community:masterfrom
deepin-ci-robot:backport/fix-native-protocol-o-nofollow-lock-file

Conversation

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Problem Before the Change

The lock_socket() function in the native protocol module opened the lock file with open(s->lock_addr, O_CREAT | O_CLOEXEC, ...) 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, 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_NOFOLLOW flag to the open() call in lock_socket() in src/modules/module-protocol-native.c, so the kernel rejects the path with ELOOP instead 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

  • Add debian/patches/fix-native-protocol-add-o-nofollow-to-lock-file-creation.patch
  • Modify debian/patches/series
  • Modify debian/changelog

Upstream

PipeWire/pipewire@95ef466b9bd7

Generated-By: glm-5.3-flash
Co-Authored-By: deepin-ci-robot packages@deepin.org

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>
@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign utsweetyfish for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

TAG Bot

TAG: 1.6.4-1deepin30
EXISTED: no
DISTRIBUTION: unstable

@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

/hold
因为该quilt包的上游版本号变更,详情见: deepin-community/infra-settings#134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant