rapier1 / hpn-ssh

HPN-SSH based on OpenSSH
https://psc.edu/hpn-ssh-home
Other
302 stars 41 forks source link

sshd segfaults on non-SMT machine after successful authentication - impossible to connect #35

Closed S-trace closed 2 years ago

S-trace commented 2 years ago

The sshd daemon running on a machine without SMT is accepting a connection but then falls into segmentation fault after successful authentication, which makes it useless as it is impossible to connect.

The problem is caused by / determine is hyperthreading is enabled / part of ssh_aes_ctr_init() in cipher-ctr-mt.c - it tries to open "/sys/devices/system/cpu/smt/active" for reading, but then incorrectly behaves if fopen() returned NULL, attempting to fscanf() from NULL pointer, which leads to segfault.

Fixed in https://github.com/rapier1/openssh-portable/pull/34

rapier1 commented 2 years ago

Doh! Thanks for catching that. I never would have found that as I don't think I have any single core systems left to test that on. I'll pull that in asap.

S-trace commented 2 years ago

VIM2 is 8-cores non-SMT system. I'm happy to help you!

rapier1 commented 2 years ago

Crazy! Anyway, I should have looked more closely at that chunk of my code before I pushed it out. Thanks again, Chris