pop-os / system76-firmware

System76 Firmware Tool and Daemon
GNU General Public License v3.0
75 stars 28 forks source link

Does not work when the Secure Boot is enabled (failed to get I/O permission) #127

Open szydell opened 11 months ago

szydell commented 11 months ago

Distribution (run cat /etc/os-release): NAME="Fedora Linux" VERSION="39 (KDE Plasma)" ID=fedora VERSION_ID=39 VERSION_CODENAME="" PLATFORM_ID="platform:f39" PRETTY_NAME="Fedora Linux 39 (KDE Plasma)"

Related Application and/or Package Version (run apt policy $PACKAGE NAME): Current version from the GitHub packaged for Fedora.

Issue/Bug Description: [root@ ~]# system76-firmware-daemon system76-firmware-daemon: failed to get I/O permission: Operation not permitted (os error 1)

The issue is related to Secure Boot and kernel lockdown. I was able to reproduce it and found a workaround. With the disabled secure boot, it works ok again.

As written in the man (https://man7.org/linux/man-pages/man2/iopl.2.html) usage of iopl is deprecated. Maybe there is a way to rewrite this part? :)

    if unsafe { libc::iopl(3) } < 0 {
        return Err(format!(
            "failed to get I/O permission: {}",
            io::Error::last_os_error()
        ));
    }

Steps to reproduce (if you know): You can just run it on a system with enabled Secure Boot.

Expected behavior: Run also on systems with enabled Secure Boot.

Other Notes: Originally reported as an issue for Fedora copr package here: https://pagure.io/system76/system76-firmware/issue/1

s373r commented 5 months ago

I have the exact same problem

JLeemaster commented 4 months ago

Same here

tunix commented 3 months ago

Any chance that this may get fixed soon?