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

Pinning related APIs should treat names as paths and canonicalize them #4239

Open
lmb opened this issue Feb 24, 2025 · 2 comments
Open

Pinning related APIs should treat names as paths and canonicalize them #4239

lmb opened this issue Feb 24, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request P2 triaged Discussed in a triage meeting
Milestone

Comments

@lmb
Copy link
Collaborator

lmb commented Feb 24, 2025

Describe the feature you'd like supported

Pinning a map / program currently takes an uninterpreted string as the key for the ebpf pinning table. On Linux, pinning works on paths. So applications may rely on behaviour such as:

  • . and .. special cases
  • normalizing slashes when joining paths
  • case sensitivity

Applications ported from Linux might therefore expect that foo/../map and foo/map or foo\map refer to the same object. They also might assume that foo/Map is distinct from foo/map.

If the goal is to expose objects via something similar to a file-system it would be great to start canonicalizing names now when the breakage potential is still low.

Proposed solution

Start interpreting pinning keys as paths, and canonicalize them according to Windows conventions.

Additional context

No response

@lmb lmb added the enhancement New feature or request label Feb 24, 2025
@shankarseal
Copy link
Collaborator

@dthaler suggests using https://learn.microsoft.com/en-us/windows/win32/api/pathcch/nf-pathcch-pathcchcanonicalize in ebpfapi.dll. The path canonicalization needs to be only in user mode.

@shankarseal shankarseal added the triaged Discussed in a triage meeting label Mar 3, 2025
@shankarseal shankarseal added this to the 2503 milestone Mar 3, 2025
@shankarseal shankarseal added the P2 label Mar 3, 2025
@lmb
Copy link
Collaborator Author

lmb commented Mar 3, 2025

There is an extended version which supports flags: https://learn.microsoft.com/en-us/windows/win32/api/pathcch/nf-pathcch-pathalloccanonicalize once of which is PATHCCH_CANONICALIZE_SLASHES that seems relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 triaged Discussed in a triage meeting
Projects
None yet
Development

No branches or pull requests

3 participants