New issue
Advanced search Search tips

Issue 855370 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 17
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

nassh: sftp: sometimes runs into "Packet too short to read a xxx" error

Project Member Reported by luisnin@google.com, Jun 22 2018

Issue description

Chrome Version: 69.0.3464.0
OS: Chrome OS

What steps will reproduce the problem?
(1) Load secure shell and add connection information.
(2) Hit SFTP Mount.
(3) Wait

What is the expected result?
To be prompted to touch security and then mount the volume.

What happens instead?
Indefinitely hangs. Saying:
Loading NaCl plugin... done.
Pseudo-terminal will not be allocated because stdin is not a terminal.
(see screenshot)

Going into chrome://extensions, switching to developer mode, and inspecting  background.html gives us this error message via console:

nassh_sftp_packet.js:63 Uncaught Error: Packet too short to read a uint8
    at nassh.sftp.Packet.getUint8 (nassh_sftp_packet.js:63)
    at isSftpInitResponse (nassh_command_instance.js:1276)
    at nassh.CommandInstance.onPlugin_.write (nassh_command_instance.js:1254)
    at nassh.CommandInstance.dispatchMessage_ (nassh_command_instance.js:920)
    at nassh.CommandInstance.onPluginMessage_ (nassh_command_instance.js:1117)
nassh.sftp.Packet.getUint8 @ nassh_sftp_packet.js:63
isSftpInitResponse @ nassh_command_instance.js:1276
nassh.CommandInstance.onPlugin_.write @ nassh_command_instance.js:1254
nassh.CommandInstance.dispatchMessage_ @ nassh_command_instance.js:920
nassh.CommandInstance.onPluginMessage_ @ nassh_command_instance.js:1117

Please see log for more details. I got this from the background.html console.



Please use labels and text to provide additional information.

If this is a regression (i.e., worked before), please consider using the
bisect tool (https://www.chromium.org/developers/bisect-builds-py) to help
us identify the root cause and more rapidly triage the issue.

For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.


 
Screenshot 2018-06-22 at 1.04.53 AM.png
164 KB View Download
pnhechapfaindjhompbnflcldabbghjo-1529654865418.log
26.0 KB View Download

Comment 1 Deleted

Comment 2 by vapier@chromium.org, Jun 22 2018

Labels: -Restrict-View-Google Pri-3 Type-Bug
Summary: nassh: SFTP sometimes runs into "Packet too short to read a xxx" error (was: SFTP doesn't mount when using Secure Shell on Chrome OS m68)
we've seen reports of this off & on, but haven't had a good way of reproducing it, and even for users it usually just goes away.  so it hasn't been a high priority.

Comment 3 Deleted

Project Member

Comment 4 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/0cb4d6eb129ce42043be2e77434e75d42a53cecb

commit 0cb4d6eb129ce42043be2e77434e75d42a53cecb
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue Oct 16 05:25:09 2018

nassh: sftp: move pendingRequests internally

These series of callbacks are for internal client usage only,
so use the internal naming convention.

Bug:  855370 
Change-Id: Ib83d6b5a2f46380cd450e8bf2537def75c45972d
Reviewed-on: https://chromium-review.googlesource.com/c/1278009
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0cb4d6eb129ce42043be2e77434e75d42a53cecb/nassh/js/nassh_sftp_client.js

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/289ac1bd5ff00f5c791db063abef0e319e8cb132

commit 289ac1bd5ff00f5c791db063abef0e319e8cb132
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue Oct 16 06:56:12 2018

nassh: sftp: bind stdout to sftp immediately

Currently we delay changing stdout binding from the terminal to the
sftp client until after we've seen (peeked) the sftp handshake finish.
But there's no reason to not do this right away -- authentication is
done over dedicated auth channels.

Bug:  chromium:855370 
Change-Id: I87b86bae14913fd6d74ccec2b877b77c66f15592
Reviewed-on: https://chromium-review.googlesource.com/c/1278010
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/289ac1bd5ff00f5c791db063abef0e319e8cb132/nassh/js/nassh_command_instance.js

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/125dec52113cda69504545818a41945577231017

commit 125dec52113cda69504545818a41945577231017
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue Oct 16 06:58:21 2018

nassh: sftp: move init logic into a callback

The current nassh isSftpInitResponse logic breaks down when we get
partial packet reads.  The sftp client layers already handle this
scenario, as well as checking for the VERSION packet, so stop trying
to parse it ourselves.  Instead add a callback we can register with.

Bug:  chromium:855370 
Change-Id: I3f000d06d5e71a3072fbf9cc61200ddcd1069aeb
Reviewed-on: https://chromium-review.googlesource.com/c/1278011
Reviewed-by: Vitaliy Shipitsyn <vsh@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/125dec52113cda69504545818a41945577231017/nassh/js/nassh_command_instance.js
[modify] https://crrev.com/125dec52113cda69504545818a41945577231017/nassh/js/nassh_sftp_client.js

Owner: vapier@chromium.org
Status: Fixed (was: Untriaged)
Summary: nassh: sftp: sometimes runs into "Packet too short to read a xxx" error (was: nassh: SFTP sometimes runs into "Packet too short to read a xxx" error)
should be fixed in current versions and the next release

Sign in to add a comment