Nitrokey / nitrokey-storage-firmware

Firmware for the Nitrokey Storage device
GNU General Public License v3.0
54 stars 19 forks source link

Multiple file copy to encrypted volume fails #43

Closed szszszsz closed 7 years ago

szszszsz commented 7 years ago

Description

Copying files to freshly formatted encrypted volume fails when the device is after libnitrokey's full test suite. Device is reset by the kernel and further not accessible, it responds to the HID commands though.

Occurrence: very frequent

Reproduction scenario

As of now issue cause has not been isolated yet and full test suite has to be run to provoke issue occurrence.

Environment

Ubuntu 16.10, Storage v0.46 RC, libnitrokey: v2.0-147-gec500f1, branch: wip-show_information_about_invalid_CRC Device connected to USB 2.0/3.0 SD card initialization already done

Steps

  1. Run libnitrokey full test suite: pro + storage (without SD card initialization test - default), with --randomly-seed=1498651223
  2. Reinsert the device
  3. Run Nitrokey App
  4. Unlock encrypted volume and format it to Fat32 (or ext4)
  5. Mount the encrypted volume
  6. Schedule a copy of 2GB of files with 5MB of size on average (about 400 files) and another 1.5GB (1500 files).

Copy stopped after 500th MB (sometimes it stops after 4GB). After a brief moment the device was reset (a couple of times) by the kernel. It was still responding to Nitrokey App commands. No LED was flashing.

Logs

Attached full system log. dmesg.zip Relevant messages shown:

Jun 28 17:32:25 feather kernel: FAT-fs (sdd): Directory bread(block 5217440) failed
Jun 28 17:32:59 feather kernel: FAT-fs (sdd): unable to read inode block for updating (i_pos 83479173)
Jun 28 17:32:25 feather kernel: FAT-fs (sdd): FAT read failed (blocknr 5105)

Workaround

To clear the issue it suffices to regenerate AES keys (e.g. by selecting Destroy Encrypted Data from Nitrokey App's tray menu) make a factory reset.

szszszsz commented 7 years ago

Issue is not reproducing on development firmware v0.47.1 with mentioned environment and changed hardware test sample. Issue will be monitored and the reproduction route is planned to be added to test suite. Will be reopen if occur again.

szszszsz commented 7 years ago

TBD: retest on 0.47

szszszsz commented 7 years ago

Issue occurs on 0.47, hardware sample no 2. Will be tested on v0.47.2.

szszszsz commented 7 years ago

Issue was not occurring on development v0.47.4.

szszszsz commented 7 years ago

Not occurring on v0.48, HW sample number 2, Ubuntu 16.10. Closing as fixed.