# Problem with crypto-loop

## bisho

I have been using a encrypted AES partition for a while, and today sudenly with an update (not surely of the things updated) is not working.

The error is:

```

ioctl: LOOP_SET_STATUS: Invalid argument

```

The device is configured as follows:

```

/dev/hda6               /home           reiserfs        loop,keybits=256,phash=sha512,encryption=aes,noauto,noatime                     0 0

```

Nothing else has changed. The kernel is the 2.4.20-r5 of gentoo, and it was working this morning.

Any help on what's going on or what can I check to find the problem?

----------

## aycan

Me thinks that:

You get -EINVAL because no module implements that ioctl for your loop device.

Are you sure you have enabled cryptoloop support in your kernel?

----------

## petu

If you are using ~arch you probably have sys-apps/util-linux-2.12 installed which doesn't work well with cryptoloop. I had the same problem and I solved it by downgrading util-linux to version 2.11z-r7.

----------

## PartyCharly

Yes, thanks ...

crypto-loop works fine with linux-utils-2.11z-r7

i lost 3 days till i found you ...

----------

## bisho

 *PartyCharly wrote:*   

> Yes, thanks ...
> 
> crypto-loop works fine with linux-utils-2.11z-r7
> 
> i lost 3 days till i found you ...

 

2.11z is for 2.4.X and 2.12 is for 2.6.X kernels.

It would be nice to be able to have bofth of them at the same time if you are testing bofth kernels...  :Sad: 

Also I'm having problems with cryptoloop in kernel 2.6.0-test4. cryptoloop needs to be compiled as module, you can't set the keybits of the encryption algorithm, neither the hash function used to store the key on disk...  :Sad: 

On the 2.4 conf I have a 256bit AES with sha512 for the hash. Anybody knows when this features will be implemented on linux-utils? At kernel level I supose it's implemented.

Anyway, take care of using crypto under 2.6 kernels... it seems to be a little unstable. I get a kernel ops when umounting a cryptoloop file:

```

# umount test2/

------------[ cut here ]------------

kernel BUG at fs/buffer.c:2658!

invalid operand: 0000 [#1]

CPU:    0

EIP:    0060:[<c0156dfa>]    Tainted: PF

EFLAGS: 00010202

EIP is at submit_bh+0x15c/0x176

eax: 00000010   ebx: c1762960   ecx: c13ffb18   edx: de8aa424

esi: 00000001   edi: c0399880   ebp: dcb26200   esp: d99a1ed8

ds: 007b   es: 007b   ss: 0068

Process umount (pid: 3691, threadinfo=d99a0000 task=de6fec80)

Stack: c0399880 dcb26200 d997a400 c1762960 c0156ef4 00000001 c1762960 c0154b4d

       c13ffb10 d997a400 dcb26200 c01a3991 c1762960 dcb2624c de845a00 c01a2604

       dcb26200 d997a400 dcb2624c dcb26200 c0399880 d99a0000 c01585b7 dcb26200

Call Trace:

 [<c0156ef4>] sync_dirty_buffer+0x5c/0xb8

 [<c0154b4d>] mark_buffer_dirty+0x34/0x4c

 [<c01a3991>] ext2_sync_super+0x50/0x60

 [<c01a2604>] ext2_put_super+0x96/0x9b

 [<c01585b7>] generic_shutdown_super+0x17d/0x18d

 [<c01590cd>] kill_block_super+0x1d/0x48

 [<c01582e8>] deactivate_super+0x60/0xc5

 [<c016d7d5>] sys_umount+0x3f/0x86

 [<c016d833>] sys_oldumount+0x17/0x1b

 [<c0109207>] syscall_call+0x7/0xb

 

Code: 0f 0b 62 0a e6 a5 34 c0 e9 c0 fe ff ff 0f 0b 61 0a e6 a5 34

 Violaci?n de segmento

```

----------

## hulk2nd

i think your oops is because you had pnp bios enabled in the kernel. try to disable

----------

## ThorstenHirsch

I still have the same problem, always "ioctl: LOOP_SET_STATUS: Invalid argument".

I'm using kernel 2.6.5 (gentoo-dev-sources) and I have installed the latest version available of util-linux, 2.12-r5. I also have switched off BIOS PNP in the kernel and I also have loaded the aes module.

Any ideas?

----------

## hassler

I too have been having lots of difficulties getting an encrypted file system setup. i tried the ideas on this page, with no luck either. There must be some magic combination of kernel and util-linux versions that are required to work.

I'm running 2.4.25-gentoo-r2 kernel, with util-linux-2.11z-r8. 

I had been running util-linux-2.12-r4 (latest), and was getting the "ioctl: LOOP_SET_STATUS: Invalid argument" error. I backed off to util-linux-2.11z-r8, and now am getting:

 *Quote:*   

> 
> 
> The cipher does not exist, or a cipher module needs to be loaded into the kernel
> 
> ioctl: LOOP_SET_STATUS: Invalid argument
> ...

 

The module is loaded:

```
tsewdry sys-apps/util-linux# lsmod

Module                  Size  Used by    Not tainted

loop                   11736   0

aes                    31200   0  (unused)

8139too                15496   1

crc32                   2912   0  [8139too]

```

One thing I did notice, is that somewherea long the line, /proc/crypto switched from a directory to a file. Not sure if this has anything to do with it or not.

----------

## ThorstenHirsch

I've tried it another time with 2.6.6-rc3-mm1 and the latest version of util-linux 2.11 and 2.12, but i still always get "ioctl: LOOP_SET_STATUS: Invalid argument".

I wonder that I get the same error when I use a wrong password.

----------

## Jacobs

Hi, after a complete system reinstall I've ended up with the same error as described here. I have 2.6.7 and util-linux-2.12-r3. The thing that helped for me is recompiling the util-linux with

```
USE="crypt"
```

I had this flag on before the reinstall, but after it I forgot to set it up.

So make sure your crypt USE flag didn't change just before these problems started. If so, switching this flag and recompiling may do the job.

----------

