Le 13/03/2016 23:35, Timo S. a écrit :
> Hi Corentin,
>
> Am 13.03.2016 17:32 schrieb "Corentin LABBE" <
clabbe....@gmail.com <mailto:
clabbe....@gmail.com>>:
>>
>> Le 13/03/2016 16:21,
txsa...@gmail.com <mailto:
txsa...@gmail.com> a écrit :
>> >
http://irclog.whitequark.org/linux-sunxi/2016-03-11
>> >
>> > Chat from timestamp 18:25
>> >
>>
>> Hello
>>
>> And I have just sent an email asking for help
https://lkml.org/lkml/2016/3/13/64.
>>
>> Regards
>
> Thanks for the update and work on this.
>
> Are you sure that the issue occurs only when deciphering?
>
> When I ran my tests, I was under the impression, that this also happens during encryption or ciphering. Because when I downloaded a large iso image to the encrypted container, unmounted it immediately
> after, unloaded the sun4i-ss module, mounted the container again and then verified the checksum, it showed a corrupted file. I thought that means something went wrong during encryption already. But my
> knowledge of all this is little, so I might be wrong.
>
> Regards,
>
> Timo
>
Hello
You are right, the current issue seems to be in both way.
But by testing that, I found something strange:
I ran lukstest and got "BAD 2 1048576 338e26f322194e1a56f2cb68c640f0b2fe403936 6c63ea074c38445b248caa00d5ecca051e020e55"
I checked both file (original and copied) and got two 512byte sector different (sectors 339 and 697).
I stopped the LUKS mount, rmmod sun4i-ss and remount it.
Now I got only one bad sector (the last one).
If I clean all and re-use sun4i-ss, still the last one.
Interesting...
Regards
PS: list of commands done
./luks/lukstest
DEBUG: Generate image
DEBUG: Format
Command successful.
DEBUG: open
Key slot 0 unlocked.
Command successful.
/dev/mapper/ctest is active.
type: LUKS1
cipher: aes-cbc-plain
keysize: 256 bits
device: /dev/loop0
loop: /tmp/bench.img
offset: 4096 sectors
size: 315904 sectors
mode: read/write
DEBUG: mkfs
mke2fs 1.42.13 (17-May-2015)
END 1 / 10
BAD 2 1048576 338e26f322194e1a56f2cb68c640f0b2fe403936 6c63ea074c38445b248caa00d5ecca051e020e55
bindiff /dev/shm/test_1048576 /mnt/lukstest/test_1048576
Compare /dev/shm/test_1048576 and /mnt/lukstest/test_1048576
339 diff at 400 89 68
339 diff at 401 0e ef
[snip]
339 diff at 507 68 ad
339 diff at 508 03 59
339 diff at 509 35 eb
339 diff at 510 36 a6
339 diff at 511 ea ec
697 diff at 400 a1 d9
697 diff at 401 c9 44
697 diff at 402 0a ef
697 diff at 403 d7 95
[snip]
697 diff at 508 2b 07
697 diff at 509 e1 ee
697 diff at 510 57 1c
697 diff at 511 e6 f0
umount /mnt/lukstest
cryptsetup luksClose ctest
rmmod sun4i-ss
cryptsetup luksOpen /tmp/bench.img ctest --key-file=/tmp/bench.img.key
mount /dev/mapper/ctest /mnt/lukstest
bindiff /dev/shm/test_1048576 /mnt/lukstest/test_1048576
Compare /dev/shm/test_1048576 and /mnt/lukstest/test_1048576
697 diff at 400 a1 d9
697 diff at 401 c9 44
697 diff at 402 0a ef
697 diff at 403 d7 95
[snip]
697 diff at 508 2b 07
697 diff at 509 e1 ee
697 diff at 510 57 1c
697 diff at 511 e6 f0