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

ziti-edge-tunnel segfault when missing flags on certain subcommands #368

Open
sabedevops opened this issue Jun 2, 2022 · 2 comments
Open

Comments

@sabedevops
Copy link
Contributor

Running ziti-edge-tunnel and any subcommand that leverages the unix domain socket to configure a running ziti-edge-tunnel causes the ziti-edge-tunnel program to segfault if that command is run without all the necessary flags.

Steps to reproduce:

  1. ziti-edge-tunnel run -I [/my/identities]
  2. ziti-edge-tunnel {enable,add,set_log_level,...}

Additionally, this can be replicated by directly writing to the unix socket, which implies the issue is somewhere downstream of argument parsing in the codebase (though certainly the argument parsing should enforce required flags):

printf '{"Command":"LoadIdentity","Data":{"ApiPageSize":0}}' | sudo nc --unixsock /tmp/ziti-edge-tunnel.sock

@qrkourier
Copy link
Member

I reproduced this by sending

printf '{"Command":"LoadIdentity","Data":{"ApiPageSize":0}}' | ncat --unixsock /tmp/ziti-edge-tunnel.sock

The running tunneler logged:

Nov 10 10:33:28 kpop4 ziti-edge-tunnel[3003]: (3003)[    42868.137]   DEBUG ziti-edge-tunnel:ziti-edge-tunnel.c:664 on_cmd_client() Received IPC client connection request, count: 1                                                                                                                                                          
Nov 10 10:33:28 kpop4 ziti-edge-tunnel[3003]: (3003)[    42868.137]    INFO ziti-edge-tunnel:ziti-edge-tunnel.c:637 on_cmd() received cmd <{"Command":"LoadIdentity","D
ata":{"ApiPageSize":0}}>                                                                                                                                               Nov 10 10:33:28 kpop4 systemd[1]: ziti-edge-tunnel.service: Main process exited, code=dumped, status=11/SEGV                                                           
Nov 10 10:33:28 kpop4 systemd[1]: ziti-edge-tunnel.service: Failed with result 'core-dump'.                                                                            

I was unable to obtain a crash dump.

@qrkourier
Copy link
Member

Also observed in 0.20.12 when incomplete IPC command ziti-edge-tunnel enable was issued. The result was the same as the other example: segfault.

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

No branches or pull requests

3 participants