Bug 45961 - Switch to Debian Kernel
Switch to Debian Kernel
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Kernel
UCS 4.3
Other Linux
: P5 enhancement (vote)
: UCS 4.3
Assigned To: Philipp Hahn
Stefan Gohmann
https://www.kernel.org/doc/html/v4.10...
: interim-2
: 46356 (view as bug list)
Depends on: 46342
Blocks: 46325
  Show dependency treegraph
 
Reported: 2017-12-29 06:10 CET by Stefan Gohmann
Modified: 2018-03-14 14:38 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Grub kernel selection (436.47 KB, image/png)
2018-02-12 12:26 CET, Arvid Requate
Details
Failed UEFI Secure Screenshot (1.37 MB, image/jpeg)
2018-03-01 17:17 CET, Stefan Gohmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2017-12-29 06:10:04 CET
UCS should switch to the Debian Kernel.
Comment 1 Stefan Gohmann univentionstaff 2017-12-29 13:47:32 CET
I've downloaded the kernel packages manually and copied the files to our apt repository:

http://security.debian.org/debian-security/pool/updates/main/l/linux/linux-image-4.9.0-4-686-pae_4.9.65-3+deb9u1_i386.deb
http://security.debian.org/debian-security/pool/updates/main/l/linux/linux-image-4.9.0-4-amd64_4.9.65-3+deb9u1_amd64.deb

And the source packages:
 http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.9.65-3+deb9u1.dsc
 http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.9.65.orig.tar.xz
 http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.9.65-3+deb9u1.debian.tar.xz

And the debian installer udeb modules:
 http://security.debian.org/debian-security/pool/updates/main/l/linux/

Please adjust the debmirror that these files are copied automatically.

I've switched the dependency of univention-kernel-image to the latest unsigned Debian kernel:
 https://git.knut.univention.de/univention/ucs/commit/7d6817a3df770be2f3d508d9d18d08db8a02fb36
 https://git.knut.univention.de/univention/ucs/commit/4208b93e07fa6129ff7958db4496009d283fc67d

The UEFI / signed part is still missing and needs to be implemented. It looks like the MODULE signature is disabled by default in Debian. Anyway, maybe we should only build the signed kernel manually.

I've changed the UCS 4.3 Jenkins DVD build job so that the kernel version parameter is given:
 --kernelversion=4.9.0-4-amd64
This should be done in a better way.
Comment 2 Felix Botner univentionstaff 2018-01-18 14:45:17 CET
disabled tests/00_checks/70_check_kernel_module_signing_settings, revert if bug is fixed
Comment 3 Philipp Hahn univentionstaff 2018-02-11 15:33:36 CET
zgrep -e CONFIG_MODULE_SIG /boot/config-4.9.0-5-amd64                                                                                                                                                           
# CONFIG_MODULE_SIG is not set

SO currently in Debian signing is disabled.
Even if we sign the modules afterwards manually using "scripts/sign-file", the kernel would not enforce the verification.

Reading <https://docs-old.fedoraproject.org/en-US/Fedora/23/html/System_Administrators_Guide/sect-kernel-module-authentication.html> shere should be a way to load the UEFI-SB keys as additional keys into the Linux Kernel Keyring.

There also is "CONFIG_SYSTEM_EXTRA_CERTIFICATE" to reseve space for adding keys without re-compilation, which is not enabled in Debian (as CONFIG_MODULE_SIG is disabled), but neither in our build.

# CONFIG_SECONDARY_TRUSTED_KEYRING is not set
Comment 4 Arvid Requate univentionstaff 2018-02-12 12:26:12 CET
Created attachment 9384 [details]
Grub kernel selection

After updating a UCS 4.2 system to UCS 4.3 and rebooting the new Kernel is not selected, probably due to sort order.
Comment 5 Philipp Hahn univentionstaff 2018-02-16 10:27:44 CET
I removed univention-kernel-images-signed from ucs_4.3-0 as it is useless and still depends on the Linux kernel from ucs_4.2-3-errata4.2-3
Comment 6 Philipp Hahn univentionstaff 2018-02-19 10:57:48 CET
(In reply to Philipp Hahn from comment #3)
> Reading
> <https://docs-old.fedoraproject.org/en-US/Fedora/23/html/
> System_Administrators_Guide/sect-kernel-module-authentication.html> shere
> should be a way to load the UEFI-SB keys as additional keys into the Linux
> Kernel Keyring.

This required a RedHad specific Linux kernel patch, which is not included upstream: <https://lists.fedoraproject.org/pipermail/scm-commits/2012-October/890845.html>

from that:
> Secure boot adds certain policy requirements, including that root must not
> be able to do anything that could cause the kernel to execute arbitrary code.
AFAIK we need to enforce verifying module signatures.
Comment 7 Philipp Hahn univentionstaff 2018-02-20 13:04:45 CET
(In reply to Arvid Requate from comment #4)
> After updating a UCS 4.2 system to UCS 4.3 and rebooting the new Kernel is
> not selected, probably due to sort order.

Moved to Bug #46342
Comment 8 Philipp Hahn univentionstaff 2018-02-20 16:26:45 CET
9c34289138 Bug #45961 kernel: Copyright 2018
74611a2cc8 Bug #45961 kernel: Update firmware dependencies

Package: univention-kernel-image
Version: 11.0.1-3A~4.3.0.201802201402
Branch: ucs_4.3-0
Comment 9 Philipp Hahn univentionstaff 2018-02-20 17:14:00 CET
c14c876958 Bug #45961 kernel: Down-prio ipw2x00

Package: univention-kernel-image
Version: 11.0.1-4A~4.3.0.201802201712
Branch: ucs_4.3-0
Comment 10 Arvid Requate univentionstaff 2018-02-20 21:53:16 CET
*** Bug 46356 has been marked as a duplicate of this bug. ***
Comment 12 Philipp Hahn univentionstaff 2018-02-28 17:28:56 CET
28ee855951 Bug #45961 kernel: Sign Debian Linux kernel 4.9.0-6

Package: univention-kernel-image-signed
Version: 4.0.0-2A~4.3.0.201802281721
Branch: ucs_4.3-0

f64ad3117d Bug #45961 kernel: Use signed Debian Linux kernel

Package: univention-kernel-image
Version: 11.0.1-5A~4.3.0.201802281728
Branch: ucs_4.3-0

c9717c4997 Bug #45961: Linux kernel changelog
Comment 14 Stefan Gohmann univentionstaff 2018-03-01 17:13:11 CET
Newly installed system: OK

System upgrade: OK

Updated i386 system: tbd

UEFI secure boot: Failed, see screenshot

Changelog: OK
Comment 15 Stefan Gohmann univentionstaff 2018-03-01 17:17:48 CET
Created attachment 9429 [details]
Failed UEFI Secure Screenshot
Comment 16 Stefan Gohmann univentionstaff 2018-03-01 17:18:52 CET
(In reply to Stefan Gohmann from comment #14)
> UEFI secure boot: Failed, see screenshot

I've burned the latest DVD and tried the installation on our UEFI test hardware.
Comment 17 Stefan Gohmann univentionstaff 2018-03-02 05:59:36 CET
(In reply to Stefan Gohmann from comment #14)
> Updated i386 system: tbd

Updated i386 system: OK
Comment 18 Philipp Hahn univentionstaff 2018-03-02 15:08:19 CET
(In reply to Stefan Gohmann from comment #16)
> (In reply to Stefan Gohmann from comment #14)
> > UEFI secure boot: Failed, see screenshot
> 
> I've burned the latest DVD and tried the installation on our UEFI test
> hardware.

FIXED: DVD was using the old D-I, which still used the old unsigned kernel.

FIXED: the signed kernel was not on the DVD:

[4.3-0] ecdc49a0e6 Bug #45961 kernel: Always install signed Debian Linux kernel on amd64
[4.3-0] 5a24fa1dd5 Bug #45961 kernel: Depend directly on linux-image

Package: univention-kernel-image
Version: 11.0.1-6A~4.3.0.201803021152
Version: 11.0.1-49A~4.2.0.201803021300
Branch: ucs_4.3-0

ucs_4.3-0-20180302-135545-dvd-amd64.iso

OK: amd64 @ kvm
OK: amd64 @ UEFI-SecureBoot HW
OK: uname -r # 4.9.0-6-amd64
OK: cat /sys/kernel/security/securelevel # 1
OK: grep . /sys/devices/system/cpu/vulnerabilities/
Comment 19 Stefan Gohmann univentionstaff 2018-03-02 16:25:47 CET
UEFI Secure boot installation was successful too.
Comment 20 Stefan Gohmann univentionstaff 2018-03-14 14:38:54 CET
UCS 4.3 has been released:
 https://docs.software-univention.de/release-notes-4.3-0-en.html
 https://docs.software-univention.de/release-notes-4.3-0-de.html

If this error occurs again, please use "Clone This Bug".