openssh: The concurrency of settimeofday and ssh connect would lead to coredump
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
New
|
Undecided
|
Unassigned | ||
Bionic |
New
|
Undecided
|
Unassigned |
Bug Description
Hi, pals:
we found a coredump when we do ssh connection. the basic information as follow:
the stack trace in coredump:
(gdb) bt
#0 0x20007510 in raise () from /lib/libc.so.6
#1 0x2000c718 in abort () from /lib/libc.so.6
#2 0x2053d42c in __mulvsi3 (a=, b=) at /home/l00194794
#3 0x2050d030 in ms_subtract_diff (start=
#4 0x204d2568 in ssh_exchange_
#5 0x204d3e3c in ssh_login (sensitive=
at sshconnect.c:1346
#6 0x204c433c in main (ac=, av=) at ssh.c:1326
the direct cause of the coredump, is that the function __mulvsi3 in gcc checked the plus operation is overflow, then this gcc function abort().
the reason of the overflow is cause by the time-setting operation when do ssh connect. in function ms_subtract_diff . the timeoutp get a very big value because of the time-change.
So could we add a limitation for the differ of the 2 values get from gettimeofday ? if it's too big, would lead to overflow, we set a default value and report a warning log.
thanks for you attention and expect your reply.
B.R.
Le Wang
Thank you for taking the time to report this bug and helping to make Ubuntu better. I appreciate the quality of this bug report and I'm sure it'll be helpful to others experiencing the same issue.
This sounds like an upstream bug to me. Please can you verify this by building directly from the latest upstream source? If this can be confirmed as an upstream bug, the best route to getting it fixed in Ubuntu in this case would be to file an upstream bug if you're able to do that. Otherwise, I'm not sure what we can do directly in Ubuntu to fix the problem.
Slightly old, but still mostly applicable info about doing so can be found at [1]
If you do end up filing an upstream bug, please link to it from here. Thanks!
[1]: https:/ /wiki.ubuntu. com/Bugs/ Upstream/ OpenSSH