-
Notifications
You must be signed in to change notification settings - Fork 71
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
tegra-se-nvhost incompatible with LUKS #114
Comments
Thanks for the detailed report! Merged a workaround in #122, but I'll leave this issue open until we're able to get Tegra-SE + LUKS working reliably. |
For some additional details, since I recently took a look at this again: One issue is:
This appears to be due to the tegra-se-nvhost driver using a mutex_lock in an atomic context, since it is called from the kcryptd tasklet. Other drivers in the same directory use a spinlock instead, which would appear to be the correct option, so it's unclear why a mutex is used here. ===
From reading the code, these parameters may be related to the issue of running out of cmdbufs: https://github.com/OE4T/linux-tegra-5.10/blob/5921377f5ffb5b1fbca9e40a187d1059743ef631/nvidia/drivers/crypto/tegra-se-nvhost.h#L252-L254 |
Reproduction on Orin Nano using a disk on the built-in m.2 slot, but probably not a mandatory requirement.
You will start getting kernel errors along the lines of
Couldn't get free cmdbuf
. If you start doing a bunch of disk operations (e.g. installing Nix onto that volume), eventually you will get ext4 errors and see your filesystem remounted as read only due to corruption. My best guess is that a bunch of writes were simply not applied. This behaviour can be reproduced with btrfs instead of ext4, obviously with different ways of reporting corruption.other reproductions
luksFormat
with--sector-size 4096
you may receiveBug: scheduling while atomic
errors and potential lockups.luksOpen
with--perf-no_read_workqueue
--perf-no_write_workqueue
you will very likely observe a kernel panic.mitigation
'Couldn't get free cmdbuf' is only reported from within this file, which provides "Tegra Crypto algorithm support using Host1x interface". A mitigation is to disable this kernel module at startup time with
initcall_blacklist=tegra_se_module_init
, after which the bug is not reproducible, although presumably you lose hardware crypto. However, fast but sometimes broken is something I want from my food deliveries, not my crypto, so it's probably no major loss.The text was updated successfully, but these errors were encountered: