Skip to content

Conversation

@Molter73
Copy link
Collaborator

Description

Since paths can be in non UTF-8 formats, we should strive to use types that are able to handle this situation when possible. In the case of the exe_path and filename fields that come from the kernel, handling has been changed to treat them as binary blobs (same way the kernel d_path function does) and the length is now being sent to userspace.

With this change, userspace is able to reconstruct a path in a fully safe way from the path buffer, treating it as a slice and using the first len - 1 (exclude the null terminator) bytes. This way we are able to preserve the path all the way to the gRPC event, which requires UTF-8 compliant strings. In a future change we might want to change path handling in our protobuffs to use byte blobs instead, but this will probably also require an effort from front end to properly display the data.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

CI should be enough.

@Molter73 Molter73 force-pushed the mauro/feat/better-path-handling branch 4 times, most recently from 0318093 to 7d66849 Compare December 22, 2025 11:11
Since paths can be in non UTF-8 formats, we should strive to use types
that are able to handle this situation when possible. In the case of the
exe_path and filename fields that come from the kernel, handling has
been changed to treat them as binary blobs (same way the kernel d_path
function does) and the length is now being sent to userspace.

With this change, userspace is able to reconstruct a path in a fully
safe way from the path buffer, treating it as a slice and using the
first len - 1 (exclude the null terminator) bytes. This way we are able
to preserve the path all the way to the gRPC event, which requires UTF-8
compliant strings. In a future change we might want to change path
handling in our protobuffs to use byte blobs instead, but this will
probably also require an effort from front end to properly display the
data.
@Molter73 Molter73 force-pushed the mauro/feat/better-path-handling branch from 7d66849 to 535fd8c Compare December 22, 2025 11:12
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