Comment 3 for bug 154392

Revision history for this message
SwissSign Operations Team (ubuntu-bugs-swisssign) wrote :

This fails with exceptional uselessness if you (as I am) are using a kernel which does not allow module loading at all.

The check for a kernel module in the file system should only be carried out if no aes ciphers are found in /proc/crypto.

Probably as so:
+++/lib/cryptsetup/cryptdisks.functions:

load_optimized_aes_module () {
        local asm_module modulesdir
+
+ # only load if not already loaded
+ local drv_loaded=`cat /proc/crypto | grep driver\ *:\ *aes-`
+ if [ -z "$drv_loaded" ]; then

        # find directory with kernel modules
        modulesdir="/lib/modules/`uname -r`"
        # Add assembly optimized AES module if it exists
        asm_module=`ls -1 "$modulesdir"/kernel/arch/*/*/aes*.ko`
        if [ $asm_module ];then
           insmod $asm_module 2>/dev/null || true
        fi
+
+ fi
}

Additionally the check should be weakened to not fail if the module does not load:

+++/lib/cryptsetup/cryptdisks.functions:
do_start () {
        local dst src key opts result

        modprobe -qb dm-mod || true
        modprobe -qb dm-crypt || true
        dmsetup mknodes > /dev/null 2>&1 || true
        log_action_begin_msg "Starting $INITSTATE crypto disks"
- load_optimized_aes_module
+ load_optimized_aes_module || true
        mount_fs