mirror of
https://github.com/hirschmann/nbfc.git
synced 2026-04-26 00:56:01 +03:00
[GH-ISSUE #414] [Fedora 27] EC initialization failed: Could not acquire EC lock #372
Labels
No labels
Stale
bug
config
discussion
duplicate
enhancement
experimental
feature
help-wanted
info
invalid
invalid
pull-request
question
up-for-grabs
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nbfc-hirschmann#372
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FloChehab on GitHub (Dec 28, 2017).
Original GitHub issue: https://github.com/hirschmann/nbfc/issues/414
Hi,
I was previously on fedora 26 and nbfc was working well.
Yesterday, I updated to fedora 27 and suddenly nbfc stopped working.
I tried reinstalling it from the last release : unsuccessful.
I removed everything, updated mono, and reinstalled from
master:NbfcServiceLog.txt
service_status.txt
sudo mono nbfc.exe config --apply "Asus Zenbook UX410UQ"I am getting theEC initialization failed: Could not acquire EC lockerror.I am running Fedora 27 / Linux Kernel 4.14.8-300 on my Asus Zenbook UX410UQ.
NB : nbfc is working great on the same computer with windows.
Any idea on solving this issue ? Any more details needed ?
@mandree commented on GitHub (Dec 28, 2017):
same here, where strace -f reveals this around the error message when running
sudo strace -f mono ec-probe.exe dump 2>&1:@mandree commented on GitHub (Dec 28, 2017):
I found this in my
dmesgoutput:I do not have that manual page, but figured this:
Apparently this is a result of "kernel lockdown" that restricts access to the kernel debug configuration in context with UEFI Secure Boot, with these links:
@mandree commented on GitHub (Dec 28, 2017):
based on https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?h=efi-lock-down&id=47a04d29e952d4dd896f2ec4c2ecee6971ab364d the workaround is:
which lifts the kernel lockdown and then restores the Fedora default sysrq mask allowing only Magic SysRq+S for sync devices. Note that this reduces security since kernel image modifications and other new safety defenses are then down. I do not oversee the consequences.
After this,
mono nbfc.exe startwill work again.@FloChehab commented on GitHub (Dec 28, 2017):
@mandree
Thank you for your quick reply ! I didn't get all your explanations (I am not a Linux expert) but your solution is effective.
Do you know if there are any tweaks that can be done on nbfc side's ? If not, I'll close the issue.
Thanks again and have good day.
@FloChehab commented on GitHub (Dec 29, 2017):
After a restart the patch wasn't working anymore (it certainly could have been redone).
I recently did a BIOS update that reactivated Secure Boot without telling it.
After disabling secure boot, everything is back to normal.
@jgoclawski commented on GitHub (Mar 4, 2018):
@mandree thanks for investigating and sharing your findings!
To make the change persistent I've created a simple systemd service. That way the kernel lockdown is lifted at every boot, before nbfc service starts.
/etc/systemd/system/lift-kernel-lockdown.service:
/opt/lift_kernel_lockdown.sh:
@stefanocirici commented on GitHub (May 10, 2018):
@jgoclawski With your script, is the kernel lockdown restored after running the nbfc service?
@mandree commented on GitHub (May 13, 2018):
No, @jgoclawski 's script will only reinstate the prior Magic SysRq settings, but the lockdown remains lifted.
@stefanocirici commented on GitHub (May 14, 2018):
Is there a way to restore it after being lifted?
@jgoclawski commented on GitHub (May 15, 2018):
If you restore the lockdown (I'm not sure if it's possible), nbfc would stop working, because it needs to poll EC periodically. So it's either nbfc with disabled lockdown or nbfc not working and lockdown enabled.
@stefanocirici commented on GitHub (May 15, 2018):
Ok. I got it
@linkwh commented on GitHub (Dec 17, 2019):
The issue is back with kernel 5.3.0-24.
See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1851380?comments=all and https://github.com/hirschmann/nbfc/issues/800
@YtvwlD commented on GitHub (Dec 18, 2019):
Hi, I'm the reporter of the Ubuntu bug @linkwh linked.
This behaviour did exploit a bug in Ubuntu's lockdown implementation. It should defend the kernel against attacks from root - it should obviously not be able for root to simply disable it. This is already fixed in Ubuntu and newer upstream kernels. I didn't report this bug to other distros yet.
I was asked whether there is a better way. And yes, there are solutions to this that don't expose the whole kernel to root.
* This project's kernel module could use DKMS. This could make use of the MOK workflow already present in Ubuntu.
* This project's kernel module could be included in the upstream kernel.
The last option would be more secure, but more difficult to achieve.
I didn't look at the source code yet (and I don't know any C#). If anyone could explain to me how this software interfaces with the kernel I can probably recommend something (although I'm not really an expert).