Skip to content

helper: spell out datum_b so clang builds the helper - #73

Merged
fxd0h merged 1 commit into
mainfrom
fix/helper-clang-init
Nov 8, 2026
Merged

fxd0h merged 1 commit into
mainfrom
fix/helper-clang-init

Conversation

@fxd0h

@fxd0h fxd0h commented Nov 8, 2026

Copy link
Copy Markdown
Owner

clang 21 stops the helper build at helper/drmtap-helper.c:251 with -Wmissing-field-initializers: SCMP_A1 expands to a compound literal and the EQ rule for DMA_BUF_IOCTL_SYNC left datum_b out.

datum_b was already zero, so the seccomp filter does not change. In the gcc build the rule still gets the same 0x40086200, 0 pair, only loaded differently.

1- clang 21 debug, and clang -march=native release, with the helper: builds with werror, 14/14
2- gcc release with the helper: 14/14
3- sync-crate --check and check-version pass

clang 21 stops the helper build with -Wmissing-field-initializers on the
DMA_BUF_IOCTL_SYNC seccomp rule: SCMP_A1 is a compound literal and the
EQ comparison left datum_b out. It was already zero, so the filter is
unchanged (same 0x40086200, 0 pair in the gcc build). gcc and clang now
build the helper with werror, 14/14 tests on both.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Tightened handling of DMA buffer synchronization requests: only requests with the expected options are now permitted. Requests with other options are rejected. This helps ensure synchronization operations follow the supported behavior.

The seccomp allow rule for DMA_BUF_IOCTL_SYNC now requires an exact request match and a third ioctl argument of 0 in both helper implementations.

Changes: DMA-BUF seccomp rule

Layer / File(s) Summary
Tighten ioctl allow rule
bindings/rust/libdrmtap-sys/csrc/drmtap-helper.c, helper/drmtap-helper.c
Both implementations now match DMA_BUF_IOCTL_SYNC only when the third ioctl argument equals 0.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Minimal · up to ca97e

The seccomp rule’s behavior is unchanged. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the change: it explicitly initializes datum_b in the seccomp rule so that clang builds the helper. The PR objectives describe the same fix in helper/drmtap-helper.c. The title is short…
Description check Passed The description states the cause: clang 21 reports -Wmissing-field-initializers at helper/drmtap-helper.c:251 because the EQ rule for DMA_BUF_IOCTL_SYNC omits datum_b. It explains that the filter beha…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: it explicitly initializes datum_b in the seccomp rule so that clang builds the helper. The PR objectives describe the same fix in helper/drmtap-helper.c. The title is short, specific, and matches the main change, so it passes.

Full details: Description check

Explanation

The description states the cause: clang 21 reports -Wmissing-field-initializers at helper/drmtap-helper.c:251 because the EQ rule for DMA_BUF_IOCTL_SYNC omits datum_b. It explains that the filter behavior does not change, and it lists the build and check results. It matches the changeset, so it passes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the ioctl gate,
The request must match, the third must be zero.
Two helpers now apply the rule,
A quiet check guards each path.
I nibble clover and hop away!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 257c4d8f-c81d-48f6-a18a-6fd178ec2d20
Commits

Reviewing files that changed from the base of the PR and between f811bd8 and ca97ec0.

Files selected for processing: 2

  • bindings/rust/libdrmtap-sys/csrc/drmtap-helper.c
  • helper/drmtap-helper.c

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 2

  • GitHub Check: CodeRabbit
  • GitHub Check: Analyze (rust)
Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 1

Source excerpt: | Rule | Convention | |---|---| | Indent | 4 spaces, never tabs | Source excerpt: | Rule | Convention | |---|---| | Naming: functions | `snake_case`, prefixed `drmtap_` for public API | Source excerpt: | Rule | Convention |...

CodeRabbit inference engine (AGENTS.md)

Files:

  • bindings/rust/libdrmtap-sys/csrc/drmtap-helper.c
  • helper/drmtap-helper.c
Additional comments: 2

bindings/rust/libdrmtap-sys/csrc/drmtap-helper.c: 1

252-253: LGTM!

helper/drmtap-helper.c: 1

252-253: LGTM!

@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

Makes datum_b explicitly zero in the DMA_BUF_IOCTL_SYNC rule so Clang can build the helper without a missing-field warning.

  • Both helper builds now spell out the sync rule's zero value.

Reviews (1) · Last reviewed commit: "helper: spell out datum_b so clang build..." · Reviewed by Greptile

@fxd0h
fxd0h merged commit 1aa18dd into main Nov 8, 2026
11 checks passed
fxd0h added a commit that referenced this pull request Nov 8, 2026
…clang

Bumps every version site to 0.5.14 and adds the CHANGELOG section for #72
(cursor copy with MOVNTDQA on x86, also in the helper) and #73 (clang build
of the helper).
@fxd0h
fxd0h deleted the fix/helper-clang-init branch November 30, 2026 05:18
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