neurodroid / cryptonite

EncFS and TrueCrypt on Android
GNU General Public License v2.0
203 stars 49 forks source link

TrueCrypt can't find working "mount" on Google Nexus 7 with motley kernel #36

Open neurodroid opened 10 years ago

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on August 11, 2012 08:43:24

What steps will reproduce the problem? 1. Try to mount with truecrypt --fs-options="uid=1000,gid=1000,umask=00002" /sdcard/truectypt.tc /sdcard/truecrypt_mount What is the expected output? What do you see instead? Error: No such file or directory: /system/xbin/mount What version of the product are you using? On what operating system? Google Nexus 7 with motley kernel ( http://forum.xda-developers.com/showthread.php?t=1775798 ) and busybox. Please provide any additional information below. Changing "/system/xbin/mount" to "mount" (without full path) in the TrueCrypt patch (fed44244e881) results in: Error: Usage: mount [-r] [-w] [-o options] [-t type] device directory

Original issue: http://code.google.com/p/cryptonite/issues/detail?id=36

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on August 11, 2012 00:44:38

Do you have any other version of "mount" on your device? Try find /system -name "mount" or find / -name "mount"

neurodroid commented 10 years ago

From t...@skoch.es on August 13, 2012 12:05:48

find /system -name "mount" --> /system/bin/mount find / -name "mount" --> /system/bin/mount

neurodroid commented 10 years ago

From damonswi...@gmail.com on September 01, 2012 03:15:48

it may be of interest to you that i encounter the same errors described above when using the mount command from stock android on samsung galaxy s3 (Error: No such file or directory: /system/xbin/mount).

when i ln -s /system/bin/mount /system/xbin/mount i get the usage error described regarding patch (fed44244e881) (Error: Usage: mount [-r] [-w] [-o options] [-t type] device directory)

however when i use the mount from busybox, but with a relative path to my mount point i get the following:

root@android:/data/local # truecrypt /dev/block/mmcblk1p2 mp
% Enter password for /dev/block/mmcblk1p2: Enter keyfile [none]: Protect hidden volume (if any)? (y=Yes/n=No) [No]: Error: mount: mounting /dev/block/loop0 on /ac/mp failed: No such file or directory

maybe some strange truncation is happening to the path? (notice the /ac/mp problem)

when i use the full path: /data/local/mp the mount is successful! however i cannot unmount without rebooting.

neurodroid commented 10 years ago

From damonswi...@gmail.com on September 01, 2012 03:21:59

note also that after the relative path failure above i get the following:

root@android:/data/local # truecrypt -l
% 1: /dev/block/mmcblk1p2 /dev/block/loop0 - root@android:/data/local # truecrypt -d
% Error: umount

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on September 01, 2012 12:37:47

@damonswirled: Have you been able to decrypt a truecrypt folder in the end on your Galaxy S3? If so, could you please:

neurodroid commented 10 years ago

From damonswi...@gmail.com on September 01, 2012 14:02:28

@christoph.schmidthieber

i will note that i am NOT mounting a folder here, but a partition. i am not sure if that makes a difference to you.

root@android:/data/local # ll /system/bin/mount
lrwxrwxrwx 1 0 0 19 Sep 1 07:14 /system/bin/mount -> /system/bin/busybox root@android:/data/local # ll /system/xbin/mount
lrwxrwxrwx 1 0 0 17 Sep 1 07:02 /system/xbin/mount -> /system/bin/mount
root@android:/data/local #

what i found at this point is that using the busybox mount command is in fact different from the toolbox one, and works with truecrypt 0.6.17 as long as i use an absolute path for my mountpoint argument. at this point i am able to save files and delete them on the truecrypt partition. i am however unable to unmount the truecrypt volume at this point, short of a reboot.

root@android:/data/local # truecrypt /dev/block/mmcblk1p2 /mnt/extSdCard/
% Enter password for /dev/block/mmcblk1p2: Enter keyfile [none]: Protect hidden volume (if any)? (y=Yes/n=No) [No]: root@android:/data/local # truecrypt -l
% 1: /dev/block/mmcblk1p2 /dev/block/loop0 /mnt/extSdCard root@android:/data/local # ll /mnt/extSdCard/
total 20 drwxrwxr-x 3 1000 1023 4096 Sep 1 09:40 ./ drwxrwxr-x 13 0 1000 0 Jan 19 1970 ../ drwxrwxr-x 2 0 0 16384 Sep 1 06:15 lost+found/ root@android:/data/local # echo asdf > /mnt/extSdCard/test
root@android:/data/local # ll /mnt/extSdCard/
total 24 drwxrwxr-x 3 1000 1023 4096 Sep 1 20:53 ./ drwxrwxr-x 13 0 1000 0 Jan 19 1970 ../ drwxrwxr-x 2 0 0 16384 Sep 1 06:15 lost+found/ -rw-rw-rw- 1 0 0 5 Sep 1 20:53 test root@android:/data/local # cat /mnt/extSdCard/test
asdf root@android:/data/local # rm /mnt/extSdCard/test
root@android:/data/local # ll /mnt/extSdCard/
total 20 drwxrwxr-x 3 1000 1023 4096 Sep 1 20:54 ./ drwxrwxr-x 13 0 1000 0 Jan 19 1970 ../ drwxrwxr-x 2 0 0 16384 Sep 1 06:15 lost+found/ root@android:/data/local # truecrypt -d
% Error: umount 1|root@android:/data/local # truecrypt -d /mnt/extSdCard/
% Error: umount 1|root@android:/data/local #


neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on September 01, 2012 14:18:45

Thanks. "truecrypt -d" might fail because umount is hard-coded to "/system/xbin/umount" in cryptonite 0.6.17. I was wondering whether you'd be able to make "/system/xbin/umount" call busybox's umount, as you did with mount?

neurodroid commented 10 years ago

From damonswi...@gmail.com on September 01, 2012 14:38:45

LOL of course you are right! in all the excitement i forgot to symlink /system/bin/umount to busybox. so i had:

root@android:/data/local # ll /system/bin/umount
lrwxr-xr-x 1 0 2000 7 May 23 14:31 /system/bin/umount -> toolbox root@android:/data/local # ll /system/xbin/umount
lrwxrwxrwx 1 0 0 18 Sep 1 07:03 /system/xbin/umount -> /system/bin/umount
root@android:/data/local #

i have now changed it:

root@android:/data/local # ll /system/bin/umount
lrwxrwxrwx 1 0 0 19 Sep 1 21:31 /system/bin/umount -> /system/bin/busybox root@android:/data/local # ll /system/xbin/umount
lrwxrwxrwx 1 0 0 18 Sep 1 07:03 /system/xbin/umount -> /system/bin/umount
root@android:/data/local #

and i get

root@android:/data/local # truecrypt -d
% root@android:/data/local # truecrypt -l
% Error: No volumes mounted. 1|root@android:/data/local #

success!

on a side note, any idea why the relative path is truncated/corrupted? i.e. "/data/local" -> "/ac" ?? seems kind of odd, and may point to something?

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on September 01, 2012 14:46:19

Thanks for reporting. There's another truecrypt binary in the downloads section (truecrypt-3.0) that uses plain "mount" and "umount" without a hard-coded path. Would that be helpful at all?

Don't know what's happening with the relative path.

neurodroid commented 10 years ago

From damonswi...@gmail.com on September 01, 2012 14:48:58

are there any other changes to the truecrypt binary 3.0 beyond the mount path coding?

thanks for your prompt assistance!

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on September 01, 2012 14:52:42

The full diff of tc-android.patch is here: rfed44244e881 It's a diff of a patch, which makes it a bit cryptic.

neurodroid commented 10 years ago

From damonswi...@gmail.com on September 01, 2012 15:06:45

looks like just the mount code changed.

thanks again!