-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel panic when trying to boot BTRFS+LUKS system (Arch Linux) #188
Comments
The Is there any chance you can get previous log lines, those are the most informative ones. Maybe you can modify screen resolution with Also if you provide the way you setup your LUKS partition I'll be glad to add it as a test case to luks.go library to make sure it properly handled. |
Sure, here it is, nothing "military" grade, but I simply don't like to run with defaults..
As for changing the screen resolution while booting, I'll see what I can do, and how readable it gets. |
So, there's no way (at least I have not found one) to change the boot resolution.. vga option does nothing here, either via ask, or trying to set a specific value, vconsole to make the font smaller also does not work since it triggers only after sucesfully decrypting the drive.. Since this is a new device, and to make sure this is indeed related to the actual setup of luks, I'll reencrypt the drive lowering the parameters and maybe trying to change the cipher (don't remember if reencrypt allows for it) and will report back, later today. Cheers |
luks.go library does not support |
BTW why |
Thanks, hopefully this won't be too much work to add it to the code..
On paper, there's none.. But it's a non standard cipher that is not AES, for some this is a good enough argument. Thou I won't be bringing up my tinfoil hat, and will just say that I don't like to use the "good enough" standards for my devices especially when it comes to encryption. And yes, I know that this is a very niche configuration, probably overkill for 95+ % of people using LUKS, but it works (worked?) fine for me over the years so I sticked with it :) |
I just pushed a fix for panic you see to
|
Per request from anatol/booster#188
Among other things it brings 'camellia' block cipher support Issue #188
I added I pushed an updated booster to |
Thanks for the quick response to this, yeah I'll try to build it and see how it works. Cheers |
I think I spoke too quick ;) While I don't have problems building packages manually, adding branches to the mix is apparently too much for me :D Spend last hour trying to figure out how to build it via makepkg against specific branch but can't wrap my head around.. Some directions (or a manual I can reference since pkgbuild wiki does not mention this) would be helpful to get this going.. |
The easiest way for you would be to install Once you are done testing it - reinstall the official package back. |
That did not work, because of:
However pointing booster-git to the wip branch via source in PKGBUILD (git+https://github.com/anatol/booster#branch=wip) allowed me to build the package just fine. Unfortunately while I do not get kernel panics anymore, I still can't boot, attaching latest screenshot showing bit more debug info, however it still does not produce anything to either journal or dmesg.. |
It probably comes from the fact that Either use universal mode that adds a bunch of kernel modules to the image. For that add Or specify this module explicitly with Then regenerate the image and reboot. |
Among other things it brings 'camellia' block cipher support Issue #188
Among other things it brings 'camellia' block cipher support from luks.go Issue #188
Among other things it brings 'camellia' block cipher support from luks.go Issue #188
Turns out, I can't just specify "camellia" as a module since module with such name does not exist. Instead it seems to be broken into several modules as per listing:
Will test with universal image if it works, and then with seperate modules untill I find the ones needed.. Was wondering if I can expand them by say typing camellia*, CRYPTO_CAMELLIA*? Trying to do it like I wrote, does not work and breaks image generation with error that module camellia* does not exist.. |
The kernel module name resolution in Linux a bit tricky. It has so called module aliases when the same module has multiple names/aliases. For example "camelia" aliased to its implementations like this one https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/crypto/camellia_generic.c#L1072 so I believe "camellia" will resolve to "camelia_generic.ko" and included to the image. Universal image will include all crypto libraries. |
Name resolution is indeed weird, specying camellia or camellia-generic, always tripped the image generation with same error that the module XXX does not exist.. I tried building universal image, and image containing all camellia modules added manually, unfortunately I still end up with same error message I send via screenshot yesterday.. Anything else I could try here? not stripping the modules? |
|
It is worth giving a try. Use |
@deathtrip yeah, it is the same issue. If you get the latest patches from It looks like the problem is with loadable crypto modules.
` |
The test shows that dm-crypt fails to load cammilia with this error message: [ 8.853839] device-mapper: table: 254:0: crypt: Error allocating crypto tfm (-ENOENT) [ 8.854683] device-mapper: ioctl: error adding target to table [ 8.871073] booster: dm ioctl (cmd=0xc138fd09): no such file or directory Issue #188
OK, so I had a moment to list the modules loaded in both initram images, turns out booster loads just one, whereas mkinitcpio loads 4.. On top of that, booster seems to have issues finding the additional modules in the first place, please refer to the left hand side of the screen where you can find the error message and me listing the available modules, showing it is where it is supposed to be.. I am not sure why this happens, unfortunately my programming knowledge is close to none, so while I can help do all the testing you need, at this point I don't have any ideas how to implement it inside the code.. |
@IronsideSec as a workaround try to add |
I've tried every possible combination, what I don't understand why it complains that the module does not exist yet when you list modules via booster ls, same module is listed.. Anyway I've decided to test if aes-xts-plain64 will work fine. Will report soon.. Thou this does not fix the initial issue since I'd like to stick with camilla as my cipher. |
@IronsideSec wait a bit, I have patches on the way that might fix your original issue with |
If a user specifies non-standard encryption like xts-camellia then booster fails to use it, and fails with error: [ 8.853839] device-mapper: table: 254:0: crypt: Error allocating crypto tfm (-ENOENT) [ 8.854683] device-mapper: ioctl: error adding target to table [ 8.871073] booster: dm ioctl (cmd=0xc138fd09): no such file or directory To fix it we need mimic kernel's codepath for this case. If modules for encryption mode/block cipher are not used then it asks userspace to load it with `modprobe crypto-$MODE`, when crypto-$MODE is an alias that points to other modules. To fix the issue we load the required `crypto-*` alias before setting up a device mapper for dmcrypto. As a result of this change 'modules' and 'modules_force_load' handles aliases as well. So user can add `modules: cryto-camellia` to their config. Add an integration test for loadable crypto module. Fixes #188 Fixes #47
Among other things it brings 'camellia' block cipher support from luks.go Issue #188
If a user specifies non-standard encryption like xts-camellia then booster fails to use it, and fails with error: [ 8.853839] device-mapper: table: 254:0: crypt: Error allocating crypto tfm (-ENOENT) [ 8.854683] device-mapper: ioctl: error adding target to table [ 8.871073] booster: dm ioctl (cmd=0xc138fd09): no such file or directory To fix it we need mimic kernel's codepath for this case. If modules for encryption mode/block cipher are not used then it asks userspace to load it with `modprobe crypto-$MODE`, when crypto-$MODE is an alias that points to other modules. To fix the issue we load the required `crypto-*` alias before setting up a device mapper for dmcrypto. As a result of this change 'modules' and 'modules_force_load' handles aliases as well. So user can add `modules: cryto-camellia` to their config. Add an integration test for loadable crypto module. Fixes #188 Fixes #47
@IronsideSec I just pushed changes to
module aliases are supported by |
Thanks a lot for your help here, will test it and report back later tonight. Cheers |
Hi @anatol I can confirm this works now! booting is blazing fast and I can finally easily unlock the drive with a yubikey instead of a very long passphrase :) Much appreciated, thank you. |
I tried building the AUR package and also got |
I built a universal image and added the modules to the config file. Here are my findings:
|
@deathtrip while waiting for Anatol to look into the issue, try this to see if this fixes issue nr.1 as per documentation
Issue nr 2 most probably require same treatment as with the camellia-xts cipher, I don't think these are being loaded/used properly by booster similar to camellia. |
@deathtrip, answering your comments
|
A note about
|
The |
After updating the AUR package and disabling module stripping, i'm finally able to use host specific images to unlock my system. Also as booster gets more users, it's likely they too will encounter the problem of unsupported ciphers/hashes. |
@deathtrip it is great to hear this news. I filed a ticket to review/add support for more algorithms anatol/luks.go#8 |
If a user specifies non-standard encryption like xts-camellia then booster fails to use it. The error message is [ 8.853839] device-mapper: table: 254:0: crypt: Error allocating crypto tfm (-ENOENT) [ 8.854683] device-mapper: ioctl: error adding target to table [ 8.871073] booster: dm ioctl (cmd=0xc138fd09): no such file or directory To fix it we need to mimic kernel's codepath for this case. What kernel does in case of loadable crypto modules are not loaded - it asks userspace to load the module with `modprobe crypto-$MODE`. `crypto-$MODE` is an alias that points to other modules. To fix the original issue we load the required `crypto-*` alias before setting up a device mapper for dm-crypt. As a result of this change 'modules' and 'modules_force_load' now handle aliases as well. So user can add `modules: cryto-camellia` to their config. Add an integration test for loadable crypto module. Fixes #188 Fixes #47
Among other things it brings 'camellia' block cipher support from luks.go Issue #188
Hi, I was preparing a new machine and decided to give booster a try, since I wanted the system to be as minimal and as snappy as possible.. I've set it up as usual with the btrfs layout + luks and systemd as my bootloader choice.
First issue when trying to boot after pacstrapping and preparing the system - kernel panic attempting to kill init - Initially I thought that maybe this is an issue with the setup or some weird hardware issue so decided to play around with the config, to maybe add some modules manually (btrfs for example) and try building host specific and universal images.. In all cases no matter the config I ended up with kernel panic..
Running short on time I decided to try mkinitcpio and of course it booted as it always did no problems here.. This got me thinking that maybe this was due to some modules not being added and I needed a fully booted kernel to build a proper init image, this was unfortunately not the case.. Even when building images from a fully working workstation with every possible kernel and/or booster option did not yield a single proper boot.. So far for the last two or maybe even three days I did the following:
So no matter what I try it always ends up the same way - kernel panic right after it tries to unlock my luks partition. I wonder if this might be related to the setup of luks, since I don't run with the "defaults" and have custom options for most of the parameters and unlocking the drive takes approx 30-35 seconds - maybe there's some race condition going on here (I will try to do some test by redoing the parameters, seeing if this solves the issue)? I am attaching a video I took when attempting to boot, apologies for crap quality..
If there's anything else I can provide or test, please let me know as I'm very interested in not only trying to fix this, but run booster since I want (need) yubikey unlock for my luks drives.
Cheers!
https://imgur.com/a/2tTgjqo
The text was updated successfully, but these errors were encountered: