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

client segfault with crafted arguments #73

Open
tamird opened this issue Nov 10, 2024 · 2 comments
Open

client segfault with crafted arguments #73

tamird opened this issue Nov 10, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers priority/low

Comments

@tamird
Copy link

tamird commented Nov 10, 2024

tamird@Mac socket_vmnet % $(brew --prefix socket_vmnet)/bin/socket_vmnet_client $(brew --prefix)/var/run/socket_vmnet --               
zsh: segmentation fault  $(brew --prefix socket_vmnet)/bin/socket_vmnet_client  --

this is caused by the special handling of --:

if (strcmp(child_argv[0], "--") == 0)

I think the cleanest thing is to remove this. Typically -- is used to separate positional arguments from flags e.g. <cmd> --foo --bar -- pos1 pos2 but that is not how it works for the client.

@nirs
Copy link
Member

nirs commented Nov 10, 2024

-- is typically used to separate the command arguments from sub command arguments. For example kubectl exec pod -- command to exec inside the pod.

This is not really needed in the client, since our command is trivial, but it is nice to support this since users may already using this format. You are correct that the issue is not considering the special -- option - when we consume it we need to decrease argc, and fail if no argument left for execve().

@AkihiroSuda AkihiroSuda added bug Something isn't working good first issue Good for newcomers priority/low labels Nov 15, 2024
@tamird
Copy link
Author

tamird commented Nov 17, 2024

This issue is possibly obsoleted by #76. The client can be removed after a deprecation period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers priority/low
Projects
None yet
Development

No branches or pull requests

3 participants