Kernel Bug Tracker – Bug 15806
Kernel Panic or Kernel becomes unstable with encrypted drives (TrueCrypt)
Last modified: 2012-05-14 17:22:32 UTC
Created attachment 26040 [details]
Includes kern.log, linux-image.crash-log and file with system information
* Overview: More detailed restatement of summary.
I have 2 encrypted drives, the Kernel becomes unstable or I get Kernel Panic when I'm using one of this drives. This means, if I try to copy files from one encrypted drive to another I get in the most cases Kernel Panic after a short time.
If accessing more than one application files from an encrypted drive, I get often the message that the system might become unstable and I need to reboot because I can't access the encrypted drive any more. The same when I try to force a file system check with fsck, I get every time the message that the system might become unstable.
* Steps to Reproduce: Minimized, easy-to-follow steps that will trigger the bug. Include any special setup steps.
The easiest way to reproduce is to check the file system with fsck:
1) Mount the volume with the TrueCrypt GUI (check under "Filesystem: Do not mount")
2) Force file check with "sudo fsck -f /dev/mapper/truecrypt1"
3) After a short while I get a new icon in the tray with the message "Your system might become unstable now and might need to be restarted."
* Actual Results: What the application did after performing the above steps.
The Kernel becomes unstable (Your system might become unstable now and might need to be restarted.) and I can't access the drive until reboot.
* Expected Results: What the application should have done, were the bug not present.
fsck should check the mapped drive and should fix errors if any.
* Build Date & Platform: Date and platform of the build in which you first encountered the bug.
I'm running Ubuntu 10.04 beta with mainline Kernel.
* Additional Builds and Platforms: Whether or not the bug takes place on other platforms (or browsers, if applicable).
The last Kernel without problems was 188.8.131.52 (Ubuntu 9.04), all newer Kernels crashing my system.
* Additional Information: Any other useful information.
I'm using TrueCrypt 6.3a, AES Encryption and the drives are formatted with ext4.
I don't see anything in the oops that looks at all ext4-specific - unless you can show otherwise, I'm guessing that this is a bug in another layer...
If this is triggered by doing userspace IO on the block device (i.e. via fsck) that's another clue that it's a problem in the (crypted) block layer rather than the filesystem, I think.
yeah, I'll recategorise it to devicemapper, assigned to Milan.
kernel BUG at /home/kernel-ppa/mainline/build/include/linux/scatterlist.h:63!
* In order for the low bit stealing approach to work, pages
* must be aligned at a 32-bit boundary as a minimum.
BUG_ON((unsigned long) page & 0x03);
kernel BUG at /home/kernel-ppa/mainline/build/fs/bio.c:159!
void bvec_free_bs(struct bio_set *bs, struct bio_vec *bv, unsigned int idx)
BIO_BUG_ON(idx >= BIOVEC_NR_POOLS);
hmmm. this is some memory corruption, no idea how this can happen inside dm-crypt.
first, are you sure your hw is ok? memcheck is ok?
If so, please reproduce it with upstream kernel tree
(I have no idea if there are some Ubuntu-only patches in mix...)
Also please paste output of "dmsetup table" and "mount" - check if there is no FUSE mapping (truecrypt uses it for old containers).
Created attachment 26062 [details]
dmsetup, mount output
Thank you for your replys and your help!
> first, are you sure your hw is ok? memcheck is ok?
I have made a memcheck with Memtest86 v2.11 and after 35 minutes it found no errors.
On the other hand my hardware works well with the old Kernel in Ubuntu 9.04 (2.6.28). When I'm running Ubuntu 9.04 via Live-CD and installing TrueCrypt 6.3a I can run fsck without problems and copying large files without Kernel Panic.
> If so, please reproduce it with upstream kernel tree (I have no idea if there are some Ubuntu-only patches in mix...)
On the Ubuntu Wiki they said that the Ubuntu mainline Kernel are unmodified (https://wiki.ubuntu.com/KernelTeam/MainlineBuilds). It is necessary to install from http://www.kernel.org/? I never compiled a kernel from source.
> Also please paste output of "dmsetup table" and "mount" - check if there is no FUSE mapping (truecrypt uses it for old containers).
The volumes are newly created with TrueCrypt 6.x some months ago and should use the new container format.
TrueCrypt shows at the Volume Property dialog:
Mode of Operation: XTS
Volume Format Version: 2
I have added the output in the attachment.
What's interesting here IMHO is
last sysfs file: /sys/devices/virtual/block/dm-0/dm/name
last sysfs file: /sys/devices/virtual/block/dm-0/uevent
I wonder what is trying to scan these devices... can you please add lvmdump archive also? Is there udisks/DeviceKit-disks installed?
I am running Truecrypt volumes without problem (but how do you format it using ext4? IIRC Truecrypt GUI knows only ext3.)
Well, I tried that kernel Ubuntu build - runs without problems with high load on truecrypt encrypted device (2.6.34-rc6).
Without reproducer I cannot help much here, lines copied in comment #3 shows apparent memory corruption, it can be whatever part in system, even hw...
thanks for your reply and sorry for my late answer! I have installed the new Ubuntu 10.04 32bit with the same problems I have reported, then I installed the 64bit version some days ago and since then I have no problems with TrueCrypt any more. I don't know why the 64bit version runs without problems and the 32bit version crashes my system with newer kernels as 2.6.28. But I am happy to have solved this very annoying problem for me.
> I am running Truecrypt volumes without problem (but how do you format it using
> ext4? IIRC Truecrypt GUI knows only ext3.)
Yes the GUI cannot format the volumes in ext4 but when you map the volume without mount the filesystem you can format the volume with any other filesystem you like.
Well, usually such bug appears when there is some hw or driver corruption memory problem.
If 64 bit works, I would expect maybe some problem with high memory on 32bit.
Maybe you can try to limit memory (e.g. mem=512M) if this causes some change.
(I am running the same 32bit kernel without problem...)