SIGSEGV with SSH built-in server #2804

Closed
opened 2025-11-02 04:49:01 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @HorlogeSkynet on GitHub (Jan 23, 2019).

Hi 👋

  • Gitea version (or commit ref): v1.7.0
  • Git version: v2.11.0
  • Operating system: Debian 9
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x872bbc]
goroutine 853 [running]:
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newPacketCipher(0x2808d77, 0x1, 0x1, 0x2808d78, 0x1, 0x1, 0x2808d79, 0x1, 0x1, 0xc0026c6040, ...)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:245 +0x15c
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*transport).prepareKeyChange(0xc0000b87e0, 0xc001285500, 0xc000908200, 0xc001285500, 0xc00258ac00)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:80 +0xeb
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).enterKeyExchange(0xc0000f62c0, 0xc00233b800, 0x588, 0x588, 0x1, 0x1)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:598 +0x3d0
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).kexLoop(0xc0000f62c0)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:301 +0x1d6
created by code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newServerTransport
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:143 +0x105

Description

When using the built-in SSH server, the application is crashing when SSH connections occurred.

It was already the case on the v1.6.X branch.
If needed, I can run further tests on my own.

Thanks, bye 🙇

EDIT : Maybe related to #5460 (?). The OP didn't precise whether its instance crashed or not though.

Originally created by @HorlogeSkynet on GitHub (Jan 23, 2019). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> Hi :wave: - Gitea version (or commit ref): v1.7.0 - Git version: v2.11.0 - Operating system: Debian 9 - Database (use `[x]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x872bbc] goroutine 853 [running]: code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newPacketCipher(0x2808d77, 0x1, 0x1, 0x2808d78, 0x1, 0x1, 0x2808d79, 0x1, 0x1, 0xc0026c6040, ...) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:245 +0x15c code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*transport).prepareKeyChange(0xc0000b87e0, 0xc001285500, 0xc000908200, 0xc001285500, 0xc00258ac00) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:80 +0xeb code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).enterKeyExchange(0xc0000f62c0, 0xc00233b800, 0x588, 0x588, 0x1, 0x1) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:598 +0x3d0 code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).kexLoop(0xc0000f62c0) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:301 +0x1d6 created by code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newServerTransport /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:143 +0x105 ``` ## Description When using the built-in SSH server, the application is crashing when SSH connections occurred. It was already the case on the v1.6.X branch. If needed, I can run further tests on my own. Thanks, bye :bow: EDIT : Maybe related to #5460 (?). The OP didn't precise whether its instance crashed or not though.
GiteaMirror added the issue/confirmedissue/needs-feedback labels 2025-11-02 04:49:01 -06:00
Author
Owner

@lafriks commented on GitHub (Jan 23, 2019):

It would need a bit more info on how to reproduce this

@lafriks commented on GitHub (Jan 23, 2019): It would need a bit more info on how to reproduce this
Author
Owner

@HorlogeSkynet commented on GitHub (Jan 25, 2019):

Hi again,

I've got a prety non-standard SSH setup, but even "regular" actions fail.

Gitea runs within an unprivileged LXC container.
The setup works very well with the OpenSSH server.

Client-side debug logs (I've truncated the whole verification part that is OK) :

[...]
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
Connection reset by XXX.X.X.XX port XXXX

Server-side debug logs :

[I] Log Mode: File(Info)
[I] XORM Log Mode: File(Info)
[I] Cache Service Enabled
[I] Session Service Enabled
[I] Git Version: 2.11.0
[I] SQLite3 Supported
[I] Run Mode: Production
[I] SSH server started on :XXXX. Cipher list ([chacha20-poly1305@openssh.com aes256-gcm@openssh.com aes128-gcm@openssh.com aes256-ctr aes192-ctr aes128-ctr]), key exchange algorithms ([curve25519-sha256@libssh.org diffie-hellman-group-exchange-sha256]), MACs ([hmac-sha2-512-etm@openssh.com hmac-sha2-256-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-512 hmac-sha2-256 umac-128@openssh.com])
[I] Listen: http://0.0.0.0:YYYY

... and silently crash when testing, fetching, etc., just after SSH2_MSG_NEWKEYS is being emitted, with the journalctl -xe dump attached in the OP.

So I've to admit now it might be related to the SSH2.0-Go dependency Gitea uses.
How do you wanna play it ? Do you need further information ? Should the issue be opened up elsewhere ?

Thanks, bye 👋

@HorlogeSkynet commented on GitHub (Jan 25, 2019): Hi again, I've got [a prety non-standard SSH setup](https://blog.samuel.domains/blog/security/ssh-forwarding-between-host-and-container-for-gitea), but even "regular" actions fail. Gitea runs within an unprivileged LXC container. The setup works very well with the OpenSSH server. Client-side debug logs (I've truncated the whole verification part that is OK) : ``` [...] debug3: send packet: type 21 debug2: set_newkeys: mode 1 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS Connection reset by XXX.X.X.XX port XXXX ``` Server-side debug logs : ``` [I] Log Mode: File(Info) [I] XORM Log Mode: File(Info) [I] Cache Service Enabled [I] Session Service Enabled [I] Git Version: 2.11.0 [I] SQLite3 Supported [I] Run Mode: Production [I] SSH server started on :XXXX. Cipher list ([chacha20-poly1305@openssh.com aes256-gcm@openssh.com aes128-gcm@openssh.com aes256-ctr aes192-ctr aes128-ctr]), key exchange algorithms ([curve25519-sha256@libssh.org diffie-hellman-group-exchange-sha256]), MACs ([hmac-sha2-512-etm@openssh.com hmac-sha2-256-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-512 hmac-sha2-256 umac-128@openssh.com]) [I] Listen: http://0.0.0.0:YYYY ``` ... and silently crash when testing, fetching, etc., just after `SSH2_MSG_NEWKEYS` is being emitted, with the `journalctl -xe` dump attached in the OP. So I've to admit now it might be related to the SSH2.0-Go dependency Gitea uses. How do you wanna play it ? Do you need further information ? Should the issue be opened up elsewhere ? Thanks, bye :wave:
Author
Owner

@nicoulaj commented on GitHub (Feb 15, 2019):

I think I can reproduce this when using chacha20 cipher, the server segfaults.

Relevant settings in app.ini:

SSH_SERVER_CIPHERS = chacha20-poly1305@openssh.com, aes256-gcm@openssh.com, aes128-gcm@openssh.com,     aes256-ctr, aes192-ctr, aes128-ctr
SSH_SERVER_KEY_EXCHANGES = curve25519-sha256@libssh.org, ecdh-sha2-nistp521, ecdh-sha2-nistp384, ec    dh-sha2-nistp256, diffie-hellman-group-exchange-sha256
SSH_SERVER_MACS = hmac-sha2-512-etm@openssh.com, hmac-sha2-256-etm@openssh.com, umac-128-etm@openss    h.com, hmac-sha2-512, hmac-sha2-256, umac-128@openssh.com

Client side logs:

$ GIT_SSH_COMMAND="ssh -vvv" git pull [...] master                                          
OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018
debug1: Reading configuration data /home/[...]/.ssh/config
debug1: /home/[...]/.ssh/config line 41: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: auto-mux: Trying existing master
debug1: Control socket "/home/[...]/.cache/ssh-git@[...]:22" does not exist
debug2: resolving "[...]" port 22
debug2: ssh_connect_direct
debug1: Connecting to [...] [[...]] port 22.
debug1: Connection established.
debug1: identity file /home/[...]/.ssh/id_[...]_ed25519 type 3
debug1: identity file /home/[...]/.ssh/id_[...]_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version Go
debug1: no match: Go
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to [...]:22 as 'git'
debug3: hostkeys_foreach: reading file "/home/[...]/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/[...]/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from [...]
debug3: order_hostkeyalgs: prefer hostkeyalgs: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: zlib@openssh.com,zlib,none
debug2: compression stoc: zlib@openssh.com,zlib,none
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:CDcQidKLgFlNFIm13LTchXGdQk8DyzE7baX1tM+KPGE
debug3: hostkeys_foreach: reading file "/home/[...]/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/[...]/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from [...]
debug3: hostkeys_foreach: reading file "/home/[...]/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/[...]/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from [...]
debug1: Host '[...]' is known and matches the RSA host key.
debug1: Found key in /home/[...]/.ssh/known_hosts:16
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
Connection closed by [...] port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Server log:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x87ca7c]

goroutine 867 [running]:
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newPacketCipher(0x27648b9, 0x1, 0x1, 0x27648ba, 0x1, 0x1, 0x27648bb, 0x1, 0x1, 0xc001414640, ...)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:245 +0x15c
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*transport).prepareKeyChange(0xc001c76120, 0xc002b8e800, 0xc003f99800, 0xc002b8e800, 0xc002b46900)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:80 +0xeb
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).enterKeyExchange(0xc000530420, 0xc002a86000, 0x567, 0x567, 0x1, 0x8e9bc7)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:598 +0x3d0
code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).kexLoop(0xc000530420)
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:301 +0x1d6
created by code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newServerTransport
        /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:143 +0x105
@nicoulaj commented on GitHub (Feb 15, 2019): I think I can reproduce this when using `chacha20` cipher, the server segfaults. Relevant settings in `app.ini`: ``` SSH_SERVER_CIPHERS = chacha20-poly1305@openssh.com, aes256-gcm@openssh.com, aes128-gcm@openssh.com, aes256-ctr, aes192-ctr, aes128-ctr SSH_SERVER_KEY_EXCHANGES = curve25519-sha256@libssh.org, ecdh-sha2-nistp521, ecdh-sha2-nistp384, ec dh-sha2-nistp256, diffie-hellman-group-exchange-sha256 SSH_SERVER_MACS = hmac-sha2-512-etm@openssh.com, hmac-sha2-256-etm@openssh.com, umac-128-etm@openss h.com, hmac-sha2-512, hmac-sha2-256, umac-128@openssh.com ``` Client side logs: ``` $ GIT_SSH_COMMAND="ssh -vvv" git pull [...] master OpenSSH_7.9p1, OpenSSL 1.1.1a 20 Nov 2018 debug1: Reading configuration data /home/[...]/.ssh/config debug1: /home/[...]/.ssh/config line 41: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: auto-mux: Trying existing master debug1: Control socket "/home/[...]/.cache/ssh-git@[...]:22" does not exist debug2: resolving "[...]" port 22 debug2: ssh_connect_direct debug1: Connecting to [...] [[...]] port 22. debug1: Connection established. debug1: identity file /home/[...]/.ssh/id_[...]_ed25519 type 3 debug1: identity file /home/[...]/.ssh/id_[...]_ed25519-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.9 debug1: Remote protocol version 2.0, remote software version Go debug1: no match: Go debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to [...]:22 as 'git' debug3: hostkeys_foreach: reading file "/home/[...]/.ssh/known_hosts" debug3: record_hostkey: found key type RSA in file /home/[...]/.ssh/known_hosts:16 debug3: load_hostkeys: loaded 1 keys from [...] debug3: order_hostkeyalgs: prefer hostkeyalgs: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa debug3: send packet: type 20 debug1: SSH2_MSG_KEXINIT sent debug3: receive packet: type 20 debug1: SSH2_MSG_KEXINIT received debug2: local client KEXINIT proposal debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c debug2: host key algorithms: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: zlib@openssh.com,zlib,none debug2: compression stoc: zlib@openssh.com,zlib,none debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug2: peer server KEXINIT proposal debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256 debug2: host key algorithms: ssh-rsa debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com debug2: compression ctos: none debug2: compression stoc: none debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ssh-rsa debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug3: send packet: type 30 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug3: receive packet: type 31 debug1: Server host key: ssh-rsa SHA256:CDcQidKLgFlNFIm13LTchXGdQk8DyzE7baX1tM+KPGE debug3: hostkeys_foreach: reading file "/home/[...]/.ssh/known_hosts" debug3: record_hostkey: found key type RSA in file /home/[...]/.ssh/known_hosts:16 debug3: load_hostkeys: loaded 1 keys from [...] debug3: hostkeys_foreach: reading file "/home/[...]/.ssh/known_hosts" debug3: record_hostkey: found key type RSA in file /home/[...]/.ssh/known_hosts:16 debug3: load_hostkeys: loaded 1 keys from [...] debug1: Host '[...]' is known and matches the RSA host key. debug1: Found key in /home/[...]/.ssh/known_hosts:16 debug3: send packet: type 21 debug2: set_newkeys: mode 1 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS Connection closed by [...] port 22 fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` Server log: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x87ca7c] goroutine 867 [running]: code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newPacketCipher(0x27648b9, 0x1, 0x1, 0x27648ba, 0x1, 0x1, 0x27648bb, 0x1, 0x1, 0xc001414640, ...) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:245 +0x15c code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*transport).prepareKeyChange(0xc001c76120, 0xc002b8e800, 0xc003f99800, 0xc002b8e800, 0xc002b46900) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/transport.go:80 +0xeb code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).enterKeyExchange(0xc000530420, 0xc002a86000, 0x567, 0x567, 0x1, 0x8e9bc7) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:598 +0x3d0 code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.(*handshakeTransport).kexLoop(0xc000530420) /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:301 +0x1d6 created by code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh.newServerTransport /go/src/code.gitea.io/gitea/vendor/golang.org/x/crypto/ssh/handshake.go:143 +0x105 ```
Author
Owner

@HorlogeSkynet commented on GitHub (Feb 15, 2019):

Well, if you are right, it might look related to https://github.com/golang/go/issues/24485

Currently on mobile, will try to perform some tests anytime soon 👌

Thanks for your feedback though, I started to wonder whether it was about my setup...

@HorlogeSkynet commented on GitHub (Feb 15, 2019): Well, if you are right, it _might_ look related to https://github.com/golang/go/issues/24485 Currently on mobile, will try to perform some tests anytime soon 👌 Thanks for your feedback though, I started to wonder whether it was about my setup...
Author
Owner

@HorlogeSkynet commented on GitHub (Feb 16, 2019):

--> After having tried without CHACHA20 negotiation, I can affirm it (unfortunately) does not look related...

debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
debug1: Host '[XXX.XXX.XX.XX]:YYYY' is known and matches the RSA host key.
debug1: Found key in /home/git/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
@HorlogeSkynet commented on GitHub (Feb 16, 2019): --> After having tried without `CHACHA20` negotiation, I can affirm it (unfortunately) does not look related... ``` debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ssh-rsa debug1: kex: server->client cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none debug1: kex: client->server cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ debug1: Host '[XXX.XXX.XX.XX]:YYYY' is known and matches the RSA host key. debug1: Found key in /home/git/.ssh/known_hosts:1 debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS ```
Author
Owner

@stale[bot] commented on GitHub (Apr 17, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 17, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@HorlogeSkynet commented on GitHub (Apr 17, 2019):

Nope, up ! 👍

@HorlogeSkynet commented on GitHub (Apr 17, 2019): Nope, up ! :+1:
Author
Owner

@HorlogeSkynet commented on GitHub (Nov 29, 2020):

It looks like I can't reproduce as of 1.12.6.
Although, I haven't tried it in a long time so it might have been fixed before.

Bye, closing here 👋

@HorlogeSkynet commented on GitHub (Nov 29, 2020): It looks like I can't reproduce as of 1.12.6. Although, I haven't tried it in a long time so it might have been fixed before. Bye, closing here :wave:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2804