]> git.proxmox.com Git - mirror_ubuntu-impish-kernel.git/log
mirror_ubuntu-impish-kernel.git
3 years agoUBUNTU: [Debian] exclude $(DEBIAN)/__abi.current from linux-source
Seth Forshee [Wed, 2 Jun 2021 20:16:14 +0000 (15:16 -0500)]
UBUNTU: [Debian] exclude $(DEBIAN)/__abi.current from linux-source

BugLink: https://bugs.launchpad.net/bugs/1930713
Previously install-source ran before the flavour install, but that is
no longer the case. As a result the __abi.current driectory ends up
in the linux-source package. Explicitly exclude it when installing
files for linux-source.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
3 years agoUBUNTU: [Debian] dkms-build -- use fakeroot if not running as root
Seth Forshee [Tue, 1 Jun 2021 15:36:03 +0000 (10:36 -0500)]
UBUNTU: [Debian] dkms-build -- use fakeroot if not running as root

BugLink: https://bugs.launchpad.net/bugs/1930713
Some dkms builds require running as root, or at least the illusion of
doing so. However we need to do dkms builds before deleting the
flavour build directory in order to sign the modules, and this may
happen without fakeroot. Detect whether or not dkms-build has been
invoked as root, and if not use fakeroot to do the dkms build.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
3 years agoUBUNTU: [Debian] remove dh_testroot from install targets
Seth Forshee [Fri, 21 May 2021 00:50:29 +0000 (19:50 -0500)]
UBUNTU: [Debian] remove dh_testroot from install targets

BugLink: https://bugs.launchpad.net/bugs/1930713
When invoked during the build phase we do not expect to be running as
root or under fakeroot.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
3 years agoUBUNTU: [Debian] run install-$(flavour) targets during build phase
Seth Forshee [Thu, 20 May 2021 21:15:13 +0000 (16:15 -0500)]
UBUNTU: [Debian] run install-$(flavour) targets during build phase

BugLink: https://bugs.launchpad.net/bugs/1930713
Move installation of files from the flavour build directories to the
build phase. This results in cleaning up of one flavour build
directory before starting the build of the next flavour, significantly
reducing the amount of space needed on builders.

Note that this will result in incorrect ownership of files in cases
where the build and binary phases of building packages are run
separately. This will be addressed in a later commit.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
3 years agoUBUNTU: [Debian] use stamps for flavour install targets
Seth Forshee [Thu, 20 May 2021 20:32:25 +0000 (15:32 -0500)]
UBUNTU: [Debian] use stamps for flavour install targets

BugLink: https://bugs.launchpad.net/bugs/1930713
In preparation for moving installation of files from the flavour
build directories over to the build phase, convert relevant install-*
targets to use stamps.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
3 years agoUBUNTU: [Debian] install kvm_stat systemd service
Krzysztof Kozlowski [Mon, 31 May 2021 15:04:55 +0000 (17:04 +0200)]
UBUNTU: [Debian] install kvm_stat systemd service

Install the kvm_stat systemd service in linux-host-tools package,
disabled by default.  The service logs KVM kernel module trace events to
/var/log/kvm_stat.csv.

This tool is useful for observing guest behavior from the host
perspective.  Often conclusions about performance or buggy behavior can
be drawn from the output.

BugLink: https://bugs.launchpad.net/bugs/1921870
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: [Packaging] Build and include GDB Python scripts into debug packages
Krzysztof Kozlowski [Wed, 19 May 2021 16:17:47 +0000 (12:17 -0400)]
UBUNTU: [Packaging] Build and include GDB Python scripts into debug packages

The kernel comes with useful GDB debugging scripts/commands (enabled
with CONFIG_GDB_SCRIPTS), however these are built either with "all" make
target or with "scripts_gdb".  Build these in
"$(stampdir)/stamp-build-%" target and package in "install-%" under
/usr/share/gdb/auto-load.

BugLink: https://bugs.launchpad.net/bugs/1928715
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: iwlwifi: add new pci id for 6235
Alex Hung [Sat, 22 May 2021 00:12:03 +0000 (18:12 -0600)]
UBUNTU: SAUCE: iwlwifi: add new pci id for 6235

lspci output:
Network controller [0280]: Intel Corporation Centrino Advanced-N6235
 [8086:088f] (rev 24)
 Subsystem: Intel Corporation Centrino Advanced-N 6235 [8086:526a]

BugLink: https://bugs.launchpad.net/bugs/1920180
Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agovgaarb: Use ACPI HID name to find integrated GPU
Kai-Heng Feng [Fri, 21 May 2021 13:07:18 +0000 (21:07 +0800)]
vgaarb: Use ACPI HID name to find integrated GPU

BugLink: https://bugs.launchpad.net/bugs/1929217
Commit 3d42f1ddc47a ("vgaarb: Keep adding VGA device in queue") assumes
the first device is an integrated GPU. However, on AMD platforms an
integrated GPU can have higher PCI device number than a discrete GPU.

Integrated GPU on ACPI platform generally has _DOD and _DOS method, so
use that as predicate to find integrated GPU. If the new strategy
doesn't work, fallback to use the first device as boot VGA.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210519135723.525997-1-kai.heng.feng@canonical.com
(cherry picked from commit 808a4ae5fa7dfba286a274e729e40522500c57fe linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoBluetooth: Shutdown controller after workqueues are flushed or cancelled
Kai-Heng Feng [Wed, 19 May 2021 11:59:01 +0000 (19:59 +0800)]
Bluetooth: Shutdown controller after workqueues are flushed or cancelled

BugLink: https://bugs.launchpad.net/bugs/1928838
Rfkill block and unblock Intel USB Bluetooth [8087:0026] may make it
stops working:
[  509.691509] Bluetooth: hci0: HCI reset during shutdown failed
[  514.897584] Bluetooth: hci0: MSFT filter_enable is already on
[  530.044751] usb 3-10: reset full-speed USB device number 5 using xhci_hcd
[  545.660350] usb 3-10: device descriptor read/64, error -110
[  561.283530] usb 3-10: device descriptor read/64, error -110
[  561.519682] usb 3-10: reset full-speed USB device number 5 using xhci_hcd
[  566.686650] Bluetooth: hci0: unexpected event for opcode 0x0500
[  568.752452] Bluetooth: hci0: urb 0000000096cd309b failed to resubmit (113)
[  578.797955] Bluetooth: hci0: Failed to read MSFT supported features (-110)
[  586.286565] Bluetooth: hci0: urb 00000000c522f633 failed to resubmit (113)
[  596.215302] Bluetooth: hci0: Failed to read MSFT supported features (-110)

Or kernel panics because other workqueues already freed skb:
[ 2048.663763] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 2048.663775] #PF: supervisor read access in kernel mode
[ 2048.663779] #PF: error_code(0x0000) - not-present page
[ 2048.663782] PGD 0 P4D 0
[ 2048.663787] Oops: 0000 [#1] SMP NOPTI
[ 2048.663793] CPU: 3 PID: 4491 Comm: rfkill Tainted: G        W         5.13.0-rc1-next-20210510+ #20
[ 2048.663799] Hardware name: HP HP EliteBook 850 G8 Notebook PC/8846, BIOS T76 Ver. 01.01.04 12/02/2020
[ 2048.663801] RIP: 0010:__skb_ext_put+0x6/0x50
[ 2048.663814] Code: 8b 1b 48 85 db 75 db 5b 41 5c 5d c3 be 01 00 00 00 e8 de 13 c0 ff eb e7 be 02 00 00 00 e8 d2 13 c0 ff eb db 0f 1f 44 00 00 55 <8b> 07 48 89 e5 83 f8 01 74 14 b8 ff ff ff ff f0 0f c1
07 83 f8 01
[ 2048.663819] RSP: 0018:ffffc1d105b6fd80 EFLAGS: 00010286
[ 2048.663824] RAX: 0000000000000000 RBX: ffff9d9ac5649000 RCX: 0000000000000000
[ 2048.663827] RDX: ffffffffc0d1daf6 RSI: 0000000000000206 RDI: 0000000000000000
[ 2048.663830] RBP: ffffc1d105b6fd98 R08: 0000000000000001 R09: ffff9d9ace8ceac0
[ 2048.663834] R10: ffff9d9ace8ceac0 R11: 0000000000000001 R12: ffff9d9ac5649000
[ 2048.663838] R13: 0000000000000000 R14: 00007ffe0354d650 R15: 0000000000000000
[ 2048.663843] FS:  00007fe02ab19740(0000) GS:ffff9d9e5f8c0000(0000) knlGS:0000000000000000
[ 2048.663849] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2048.663853] CR2: 0000000000000000 CR3: 0000000111a52004 CR4: 0000000000770ee0
[ 2048.663856] PKRU: 55555554
[ 2048.663859] Call Trace:
[ 2048.663865]  ? skb_release_head_state+0x5e/0x80
[ 2048.663873]  kfree_skb+0x2f/0xb0
[ 2048.663881]  btusb_shutdown_intel_new+0x36/0x60 [btusb]
[ 2048.663905]  hci_dev_do_close+0x48c/0x5e0 [bluetooth]
[ 2048.663954]  ? __cond_resched+0x1a/0x50
[ 2048.663962]  hci_rfkill_set_block+0x56/0xa0 [bluetooth]
[ 2048.664007]  rfkill_set_block+0x98/0x170
[ 2048.664016]  rfkill_fop_write+0x136/0x1e0
[ 2048.664022]  vfs_write+0xc7/0x260
[ 2048.664030]  ksys_write+0xb1/0xe0
[ 2048.664035]  ? exit_to_user_mode_prepare+0x37/0x1c0
[ 2048.664042]  __x64_sys_write+0x1a/0x20
[ 2048.664048]  do_syscall_64+0x40/0xb0
[ 2048.664055]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 2048.664060] RIP: 0033:0x7fe02ac23c27
[ 2048.664066] Code: 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
[ 2048.664070] RSP: 002b:00007ffe0354d638 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 2048.664075] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe02ac23c27
[ 2048.664078] RDX: 0000000000000008 RSI: 00007ffe0354d650 RDI: 0000000000000003
[ 2048.664081] RBP: 0000000000000000 R08: 0000559b05998440 R09: 0000559b05998440
[ 2048.664084] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
[ 2048.664086] R13: 0000000000000000 R14: ffffffff00000000 R15: 00000000ffffffff

So move the shutdown callback to a place where workqueues are either
flushed or cancelled to resolve the issue.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
(cherry picked from commit 8bf7111b4bda00ae82e2de0cd871af997c3f2e9b linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: [Config] enable soundwire audio mach driver
Hui Wang [Fri, 14 May 2021 04:06:34 +0000 (12:06 +0800)]
UBUNTU: [Config] enable soundwire audio mach driver

BugLink: https://bugs.launchpad.net/bugs/1921632
The soundwire audio driver in the kernel could work on some Dell cml
machines, so enable the machine driver and some needed codec driver.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: Ubuntu-unstable-5.13.0-5.5
Andrea Righi [Mon, 31 May 2021 10:32:38 +0000 (12:32 +0200)]
UBUNTU: Ubuntu-unstable-5.13.0-5.5

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Config] set CONFIG_BPF_UNPRIV_DEFAULT_OFF=y
Andrea Righi [Mon, 31 May 2021 10:02:50 +0000 (12:02 +0200)]
UBUNTU: [Config] set CONFIG_BPF_UNPRIV_DEFAULT_OFF=y

This option will disable uprivileged BPF by default. It can be reenabled,
though, as it uses the new value 2 for the kernel.unprivileged_bpf_disabled
sysctl. That value disables it, but allows the sysctl knob to be set back
to 0.

This allows sysadmins to enable unprivileged BPF back by using sysctl
config files.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 31 May 2021 09:46:14 +0000 (11:46 +0200)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1930205
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Start new release
Andrea Righi [Mon, 31 May 2021 09:22:20 +0000 (11:22 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: update dkms package versions
Andrea Righi [Mon, 31 May 2021 09:12:55 +0000 (11:12 +0200)]
UBUNTU: update dkms package versions

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Ubuntu-unstable-5.13.0-4.4
Andrea Righi [Mon, 24 May 2021 11:06:17 +0000 (13:06 +0200)]
UBUNTU: Ubuntu-unstable-5.13.0-4.4

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 24 May 2021 11:05:26 +0000 (13:05 +0200)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1929404
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: update dkms package versions
Andrea Righi [Mon, 24 May 2021 09:39:28 +0000 (11:39 +0200)]
UBUNTU: update dkms package versions

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Rebase to v5.13-rc3
Andrea Righi [Mon, 24 May 2021 09:39:12 +0000 (11:39 +0200)]
UBUNTU: Rebase to v5.13-rc3

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Start new release
Andrea Righi [Mon, 24 May 2021 09:38:47 +0000 (11:38 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Config] Temporarily disable signing for ppc64el and s390x
Seth Forshee [Wed, 19 May 2021 15:21:20 +0000 (10:21 -0500)]
UBUNTU: [Config] Temporarily disable signing for ppc64el and s390x

We're awaiting testing of lockdown under secureboot on these
architectures. Disable signing in the meantime to allow putting
linux-unstable into -proposed.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: integrity: add informational messages when revoking certs
Dimitri John Ledkov [Tue, 18 May 2021 09:56:42 +0000 (10:56 +0100)]
UBUNTU: SAUCE: integrity: add informational messages when revoking certs

integrity_load_cert() prints messages of the source and cert details
when adding certs as trusted. Mirror those messages in
uefi_revocation_list_x509() when adding certs as revoked.

Sample dmesg with this change:

    integrity: Platform Keyring initialized
    integrity: Loading X.509 certificate: UEFI:db
    integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
    integrity: Revoking X.509 certificate: UEFI:MokListXRT (MOKvar table)
    blacklist: Revoked X.509 cert 'Canonical Ltd. Secure Boot Signing: 61482aa2830d0ab2ad5af10b7250da9033ddcef0'
    integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
    integrity: Loaded X.509 cert 'Canonical Ltd. Master Certificate Authority: ad91990bc22ab1f517048c23b6655a268e345a63'

BugLink: https://bugs.launchpad.net/bugs/1928679
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: integrity: Load mokx certs from the EFI MOK config table
Dimitri John Ledkov [Tue, 18 May 2021 09:56:41 +0000 (10:56 +0100)]
UBUNTU: SAUCE: integrity: Load mokx certs from the EFI MOK config table

Refactor load_moklist_certs() to load either MokListRT into db, or
MokListXRT into dbx. Call load_moklist_certs() twice - first to load
mokx certs into dbx, then mok certs into db.

This thus now attempts to load mokx certs via the EFI MOKvar config
table first, and if that fails, via the EFI variable. Previously mokx
certs were only loaded via the EFI variable. Which fails when
MokListXRT is large. Instead of large MokListXRT variable, only
MokListXRT{1,2,3} are available which are not loaded. This is the case
with Ubuntu's 15.4 based shim. This patch is required to address
CVE-2020-26541 when certificates are revoked via MokListXRT.

Fixes: ebd9c2ae369a ("integrity: Load mokx variables into the blacklist keyring")
BugLink: https://bugs.launchpad.net/bugs/1928679
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: Ubuntu-unstable-5.13.0-3.3
Andrea Righi [Mon, 17 May 2021 09:55:02 +0000 (11:55 +0200)]
UBUNTU: Ubuntu-unstable-5.13.0-3.3

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 17 May 2021 09:51:30 +0000 (11:51 +0200)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1928655
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Rebase to v5.13-rc2
Andrea Righi [Mon, 17 May 2021 08:21:27 +0000 (10:21 +0200)]
UBUNTU: Rebase to v5.13-rc2

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Start new release
Andrea Righi [Mon, 17 May 2021 08:20:56 +0000 (10:20 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Ubuntu-unstable-5.13.0-2.2
Andrea Righi [Fri, 14 May 2021 07:19:03 +0000 (09:19 +0200)]
UBUNTU: Ubuntu-unstable-5.13.0-2.2

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Start new release
Andrea Righi [Fri, 14 May 2021 06:46:05 +0000 (08:46 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Config] enable CONFIG_DEBUG_INFO_COMPRESSED
Andrea Righi [Fri, 14 May 2021 06:43:53 +0000 (08:43 +0200)]
UBUNTU: [Config] enable CONFIG_DEBUG_INFO_COMPRESSED

Enable CONFIG_DEBUG_INFO_COMPRESSED to reduce the amount of space
required during the build.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Ubuntu-unstable-5.13.0-1.1
Andrea Righi [Wed, 12 May 2021 09:35:23 +0000 (11:35 +0200)]
UBUNTU: Ubuntu-unstable-5.13.0-1.1

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Rebase to v5.13-rc1
Andrea Righi [Wed, 12 May 2021 09:30:33 +0000 (11:30 +0200)]
UBUNTU: Rebase to v5.13-rc1

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: Start new release
Andrea Righi [Wed, 12 May 2021 09:26:41 +0000 (11:26 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] add ignore.* for each arch
Andrea Righi [Tue, 11 May 2021 10:41:19 +0000 (12:41 +0200)]
UBUNTU: [Packaging] add ignore.* for each arch

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] correctly support the new ABI schema
Andrea Righi [Wed, 12 May 2021 08:38:17 +0000 (10:38 +0200)]
UBUNTU: [Packaging] correctly support the new ABI schema

The ABI directory is now <DEBIAN>abi/. Update the helper scripts to
properly support this naming when we need to re-use the previous ABI.

Also manually transition to the new ABI schema.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] Drop the processing of perm-blacklist
Juerg Haefliger [Mon, 3 May 2021 08:47:07 +0000 (10:47 +0200)]
UBUNTU: [Packaging] Drop the processing of perm-blacklist

perm-blacklist lists modules and/or symbols that are permanently excluded
from the ABI check. AFAICT this hasn't been used in ages and with the
previous commit it would move up one level which puts it outside of the
ABI directory. That in itelf is not problematic just not pretty. Take this
opportunity to get rid of the whole (unsued) concept. We can always add it
back later should the need arise (and then should probably rename it to
abi.perm-blacklist to make it clear that it's a file related to the ABI).

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] Move the ABI files up by one directory level
Juerg Haefliger [Mon, 3 May 2021 08:47:06 +0000 (10:47 +0200)]
UBUNTU: [Packaging] Move the ABI files up by one directory level

The current ABI root directory name is <DEBIAN/abi/previous/. This commit
drops the 'previous' path component and moves the ABI up one level. We
still need a temporary directory for downloading the current ABIs which now
has to reside outside of the ABI tree. For that, use <DEBIAN>/__abi.current/
which should clearly indicate that it's a temporary directory.

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: update dkms package versions
Andrea Righi [Tue, 11 May 2021 09:20:45 +0000 (11:20 +0200)]
UBUNTU: update dkms package versions

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: make ASYNCB_INITIALIZED available for the kernel
Andrea Righi [Tue, 11 May 2021 07:30:51 +0000 (09:30 +0200)]
UBUNTU: SAUCE: make ASYNCB_INITIALIZED available for the kernel

The flag ASYNCB_INITIALIZED is required by our driver
ubuntu/xr-usb-serial. Make it available to kernel code to prevent the
following build failure:

 ./build/ubuntu/xr-usb-serial/xr_usb_serial_common.c:1613:15: error: 'ASYNCB_INITIALIZED' undeclared (first use in this function); did you mean 'RCU_INITIALIZER'?
  1613 |  if (test_bit(ASYNCB_INITIALIZED, &xr_usb_serial->port.flags))
       |               ^~~~~~~~~~~~~~~~~~
       |               RCU_INITIALIZER

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Config] update configs/annotations after rebase to 5.13
Andrea Righi [Tue, 11 May 2021 07:21:47 +0000 (09:21 +0200)]
UBUNTU: [Config] update configs/annotations after rebase to 5.13

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] do not check for previous revision for new upstream kernels
Andrea Righi [Tue, 11 May 2021 07:00:12 +0000 (09:00 +0200)]
UBUNTU: [Packaging] do not check for previous revision for new upstream kernels

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] bump up kernel version to 5.13
Andrea Righi [Tue, 11 May 2021 06:41:55 +0000 (08:41 +0200)]
UBUNTU: [Packaging] bump up kernel version to 5.13

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: [Packaging] initial packaging import from linux-unstable-5.12
Andrea Righi [Mon, 22 Feb 2021 13:55:09 +0000 (14:55 +0100)]
UBUNTU: [Packaging] initial packaging import from linux-unstable-5.12

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: shiftfs: handle copy_to_user() return values correctly
Seth Forshee [Fri, 9 Apr 2021 18:10:37 +0000 (13:10 -0500)]
UBUNTU: SAUCE: shiftfs: handle copy_to_user() return values correctly

shiftfs expects copy_to_user() to return a negative error code on
failure, when it actually returns the amount of uncopied data. Fix all
code using copy_to_user() to handle the return values correctly.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
CVE-2021-3492
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
3 years agoUBUNTU: SAUCE: shiftfs: free allocated memory in shiftfs_btrfs_ioctl_fd_replace(...
Seth Forshee [Fri, 9 Apr 2021 18:01:06 +0000 (13:01 -0500)]
UBUNTU: SAUCE: shiftfs: free allocated memory in shiftfs_btrfs_ioctl_fd_replace() error paths

Many error paths in shiftfs_btrfs_ioctl_fd_replace() do not free memory
allocated near the top of the function. Fix up these error paths to free
the memory.

Additionally, the addresses for the allocated memory are assigned to
return parameters early in the function, before we know whether or not
the function as a whole will return success. Wait to assign these values
until we know the function was successful, and for good measure
initialize the return parameters to NULL at the start.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
CVE-2021-3492
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
3 years agoUBUNTU: SAUCE: apparmor: Fix build error, make sk parameter const
Colin Ian King [Mon, 29 Mar 2021 09:26:15 +0000 (10:26 +0100)]
UBUNTU: SAUCE: apparmor: Fix build error, make sk parameter const

Make the sk parameter const to fix a build error with clang:

security/apparmor/net.c:143:35: error: passing 'const struct sock *' to
parameter of type 'struct sock *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                        audit_unix_sk_addr(ab, "addr", sa->u.net->sk);
                                                       ^~~~~~~~~~~~~
/home/ubuntu/hirsute/security/apparmor/net.c:98:24: note: passing argument
to parameter 'sk' here
                               struct sock *sk)
                                            ^

Fixes: 2775e0786896 ("UBUNTU: SAUCE: apparmor: af_unix mediation")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: xr-usb-serial: clean up build warnings
Colin Ian King [Fri, 26 Mar 2021 16:54:41 +0000 (16:54 +0000)]
UBUNTU: SAUCE: xr-usb-serial: clean up build warnings

Clean up a few build warnings on unused variable 'tty'. Only declare
tty for specific kernel versions where the code requires it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: xr-usb-serial: clean up indentation
Colin Ian King [Fri, 26 Mar 2021 16:54:40 +0000 (16:54 +0000)]
UBUNTU: SAUCE: xr-usb-serial: clean up indentation

Cosmetic changes, clean up indentation to make the code easier
to read.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: RDMA/core: Introduce peer memory interface
Jason Gunthorpe [Thu, 8 Apr 2021 14:37:58 +0000 (08:37 -0600)]
UBUNTU: SAUCE: RDMA/core: Introduce peer memory interface

The peer_memory_client scheme allows a driver to register with the ib_umem
system that it has the ability to understand user virtual address ranges
that are not compatible with get_user_pages(). For instance VMAs created
with io_remap_pfn_range(), or other driver special VMA.

For ranges the interface understands it can provide a DMA mapped sg_table
for use by the ib_umem, allowing user virtual ranges that cannot be
supported by get_user_pages() to be used as umems for RDMA.

This is designed to preserve the kABI, no functions or structures are
changed, only new symbols are added:

 ib_register_peer_memory_client
 ib_unregister_peer_memory_client
 ib_umem_activate_invalidation_notifier
 ib_umem_get_peer

And a bitfield in struct ib_umem uses more bits.

This interface is compatible with the two out of tree GPU drivers:
 https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/blob/master/drivers/gpu/drm/amd/amdkfd/kfd_peerdirect.c
 https://github.com/Mellanox/nv_peer_memory/blob/master/nv_peer_mem.c

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
(cherry picked from commit a42989294cf39d6e829424734ab0e7ec48bebcef
 git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
[ saf: resolve conflicts with updates in 5.12 ]
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) powerpc: lock down kernel in secure boot mode
Daniel Axtens [Thu, 2 Apr 2020 05:16:32 +0000 (16:16 +1100)]
UBUNTU: SAUCE: (lockdown) powerpc: lock down kernel in secure boot mode

BugLink: https://bugs.launchpad.net/bugs/1855668
PowerNV has recently gained Secure Boot support. If it's enabled through
the firmware and bootloader stack, then lock down the kernel.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
(cherry picked from commit d4f3f12e040caf3ec669726efb67b27550a4713f)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) security: lockdown: Make CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOO...
Seth Forshee [Thu, 10 Oct 2019 16:19:32 +0000 (11:19 -0500)]
UBUNTU: SAUCE: (lockdown) security: lockdown: Make CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT more generic

s390 supports secure boot which is not based on EFI. Change the
config option to be more generic, and allow it to be enabled on
s390.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
(cherry picked from commit dd9548a9eb3f2a34ee7c60abce157f8e2868e7c7)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) arm64: Allow locking down the kernel under EFI secure boot
Seth Forshee [Thu, 10 Oct 2019 15:57:25 +0000 (10:57 -0500)]
UBUNTU: SAUCE: (lockdown) arm64: Allow locking down the kernel under EFI secure boot

Add support to arm64 for the CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT
option. When enabled the lockdown LSM will be enabled with
maximum confidentiality when booted under EFI secure boot.

Based on an earlier patch by Linn Crosetto.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
[v2: ported to 5.7-rc1 and adapted to the new fdt parsing mechanism]
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
(cherry picked from commit fb9c9645d977e23e9b494ce008d31507d872ffef)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) KEYS: Make use of platform keyring for module signature...
Robert Holmes [Tue, 23 Apr 2019 07:39:29 +0000 (07:39 +0000)]
UBUNTU: SAUCE: (lockdown) KEYS: Make use of platform keyring for module signature verify

This patch completes commit 278311e417be ("kexec, KEYS: Make use of
platform keyring for signature verify") which, while adding the
platform keyring for bzImage verification, neglected to also add
this keyring for module verification.

As such, kernel modules signed with keys from the MokList variable
were not successfully verified.

Signed-off-by: Robert Holmes <robeholmes@gmail.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
(cherry picked from commit b697ff5e26974fee8fcd31a1e221e9dd41515efc
from https://gitlab.com/cki-project/kernel-ark)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) s390: Lock down the kernel when the IPL secure flag is set
Jeremy Cline [Wed, 30 Oct 2019 14:37:49 +0000 (14:37 +0000)]
UBUNTU: SAUCE: (lockdown) s390: Lock down the kernel when the IPL secure flag is set

Automatically lock down the kernel to LOCKDOWN_CONFIDENTIALITY_MAX if
the IPL secure flag is set.

Upstream Status: RHEL only
Suggested-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
(cherry picked from commit 2384646bf71d8c282cf49bb20321fdf802c61cce
https://gitlab.com/cki-project/kernel-ark)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) efi: Lock down the kernel if booted in secure boot mode
David Howells [Mon, 30 Sep 2019 21:28:16 +0000 (21:28 +0000)]
UBUNTU: SAUCE: (lockdown) efi: Lock down the kernel if booted in secure boot mode

UEFI Secure Boot provides a mechanism for ensuring that the firmware
will only load signed bootloaders and kernels.  Certain use cases may
also require that all kernel modules also be signed.  Add a
configuration option that to lock down the kernel - which includes
requiring validly signed modules - if the kernel is secure-booted.

Upstream Status: RHEL only
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
(cherry picked from commit 5850c93175b9d2e1081873f4bbe08dead202cb08
from https://gitlab.com/cki-project/kernel-ark)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) efi: Add an EFI_SECURE_BOOT flag to indicate secure boot...
David Howells [Tue, 27 Feb 2018 10:04:55 +0000 (10:04 +0000)]
UBUNTU: SAUCE: (lockdown) efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode

UEFI machines can be booted in Secure Boot mode.  Add an EFI_SECURE_BOOT
flag that can be passed to efi_enabled() to find out whether secure boot is
enabled.

Move the switch-statement in x86's setup_arch() that inteprets the
secure_boot boot parameter to generic code and set the bit there.

Upstream Status: RHEL only
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
cc: linux-efi@vger.kernel.org
[Rebased for context; efi_is_table_address was moved to arch/x86]
Signed-off-by: Jeremy Cline <jcline@redhat.com>
(cherry picked from commit 53250b991f841be025fa4d264850dadc0fae2861
from https://gitlab.com/cki-project/kernel-ark)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) security: lockdown: expose a hook to lock the kernel down
Jeremy Cline [Mon, 30 Sep 2019 21:22:47 +0000 (21:22 +0000)]
UBUNTU: SAUCE: (lockdown) security: lockdown: expose a hook to lock the kernel down

In order to automatically lock down kernels running on UEFI machines
booted in Secure Boot mode, expose the lock_kernel_down() hook.

Upstream Status: RHEL only
Signed-off-by: Jeremy Cline <jcline@redhat.com>
(cherry picked from commit 72223fd1241cc5c70b96a491db14d54c83beadd8
from https://gitlab.com/cki-project/kernel-ark)

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) Make get_cert_list() use efi_status_to_str() to print error...
Peter Jones [Mon, 2 Oct 2017 22:18:30 +0000 (18:18 -0400)]
UBUNTU: SAUCE: (lockdown) Make get_cert_list() use efi_status_to_str() to print error messages.

Upstream Status: RHEL only
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
(cherry picked from commit 7ba28f03674fa9346610c3fea7fc93bc58f06d2a
from https://gitlab.com/cki-project/kernel-ark)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: (lockdown) Add efi_status_to_str() and rework efi_status_to_err().
Peter Jones [Mon, 2 Oct 2017 22:22:13 +0000 (18:22 -0400)]
UBUNTU: SAUCE: (lockdown) Add efi_status_to_str() and rework efi_status_to_err().

This adds efi_status_to_str() for use when printing efi_status_t
messages, and reworks efi_status_to_err() so that the two use a common
list of errors.

Upstream Status: RHEL only
Signed-off-by: Peter Jones <pjones@redhat.com>
(cherry picked from commit 2ae9082db0b54d831a9b3782c049d9917e37d89f
from https://gitlab.com/cki-project/kernel-ark)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoclk: sifive: Use reset-simple in prci driver for PCIe driver
Greentime Hu [Tue, 16 Mar 2021 21:31:11 +0000 (21:31 +0000)]
clk: sifive: Use reset-simple in prci driver for PCIe driver

We use reset-simple in this patch so that pcie driver can use
devm_reset_control_get() to get this reset data structure and use
reset_control_deassert() to deassert pcie_power_up_rst_n.

Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoriscv: Get CPU manufacturer information
Vincent Chen [Tue, 16 Mar 2021 21:31:07 +0000 (21:31 +0000)]
riscv: Get CPU manufacturer information

Issue 3 SBI calls to get the vendor ID, architecture ID and implementation
ID early in boot so we only need to take the SBI call overhead once.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoriscv: sifive: unmatched: update for 16GB rev3
David Abdurachmanov [Tue, 16 Mar 2021 21:31:05 +0000 (21:31 +0000)]
riscv: sifive: unmatched: update for 16GB rev3

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoriscv: sifive: fu740: cpu{1, 2, 3, 4} set compatible to sifive, u74-mc
David Abdurachmanov [Tue, 16 Mar 2021 21:31:04 +0000 (21:31 +0000)]
riscv: sifive: fu740: cpu{1, 2, 3, 4} set compatible to sifive, u74-mc

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: PCI: Serialize TGL e1000e PM ops
Kai-Heng Feng [Tue, 16 Mar 2021 13:13:28 +0000 (21:13 +0800)]
UBUNTU: SAUCE: PCI: Serialize TGL e1000e PM ops

BugLink: https://bugs.launchpad.net/bugs/1919321
On TGL systems, PCI_COMMAND may randomly flip to 0 on system resume.
This is devastating to drivers that use pci_set_master(), like NVMe and
xHCI, to enable DMA in their resume routine, as pci_set_master() can
inadvertently disable PCI_COMMAND_IO and PCI_COMMAND_MEMORY, making
resources inaccessible.

The issue is reproducible on all kernel releases, but obviously the
situation is exacerbated by commit 6cecf02e77ab ('Revert "e1000e:
disable s0ix entry and exit flows for ME systems"').

Seems like ME is out to lunch until it's finally out of ULP polling. So
ensure e1000e PM ops are serialized by enforcing device links to
workaround the issue. This is another hacky hackish hack that we can't
upstream :)

Of course this will make suspend and resume a bit slower, but at least
we protect other PCI devices by keeping ME from going full basket case.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212039
Link: https://lore.kernel.org/linux-pci/20210303172223.GA634698@bjorn-Precision-5520/
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: Input: i8042 - add dmi quirk
Chia-Lin Kao (AceLan) [Mon, 15 Mar 2021 08:05:40 +0000 (16:05 +0800)]
UBUNTU: SAUCE: Input: i8042 - add dmi quirk

BugLink: https://bugs.launchpad.net/bugs/1919123
On some platforms, the EC doesn't support the register reading sequence
for sentelic[1], and then make the EC can't respond commands for a while
when probing. It leads to the keyboard non-responsive for around 10
seconds while waking up from s2idle.

[   44.304488] i8042: [9804] d4 -> i8042 (command)
[   44.304634] i8042: [9804] f3 -> i8042 (parameter)
[   44.304787] i8042: [9804] fa <- i8042 (interrupt, 1, 12)
[   44.304855] i8042: [9804] d4 -> i8042 (command)
[   44.304938] i8042: [9804] 66 -> i8042 (parameter)
[   44.337698] i8042: [9813] d4 -> i8042 (command)
[   44.905695] i8042: [9942] 88 -> i8042 (parameter)
[   45.497478] i8042: [10102] d4 -> i8042 (command)
[   46.098041] i8042: [10253] f3 -> i8042 (parameter)
[   46.098070] i8042: [10253] fe <- i8042 (interrupt, 1, 12)
[   46.718154] i8042: [10386] d4 -> i8042 (command)
[   47.309915] i8042: [10386] f4 -> i8042 (parameter)
[   47.918961] i8042: [10556] d4 -> i8042 (command)
[   48.402624] i8042: [10556] f6 -> i8042 (parameter)

A DMI quirk to mark this platform doesn't have aux device could avoid those
commands to be sent. And the system could still using i2c interface to
communicate with the touchpad.

1. https://www.kernel.org/doc/html/v5.11/input/devices/sentelic.html#programming-sequence-for-register-reading-writing

Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
(cherry picked from https://lkml.org/lkml/2021/3/15/126)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: drm/i915: Drop require_force_probe from JSL
You-Sheng Yang [Fri, 5 Mar 2021 07:08:54 +0000 (15:08 +0800)]
UBUNTU: SAUCE: drm/i915: Drop require_force_probe from JSL

BugLink: https://bugs.launchpad.net/bugs/1917843
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: selftests: memory-hotplug: bump timeout to 10min
Paolo Pisati [Thu, 18 Feb 2021 14:58:21 +0000 (15:58 +0100)]
UBUNTU: SAUCE: selftests: memory-hotplug: bump timeout to 10min

$ sudo make -C tools/testing/selftests/memory-hotplug run_tests
TAP version 13
1..1
...
15:11:09 DEBUG| [stdout] not ok 1 selftests: memory-hotplug: mem-on-off-test.sh # TIMEOUT 45 seconds

The memory-hotplug selftest can take up to several minutes, depending on memory
size and cpu speed of the testbench, so bump timeout to 10 minutes.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: x86/entry: build thunk_$(BITS) only if CONFIG_PREEMPTION=y
Andrea Righi [Thu, 14 Jan 2021 11:06:12 +0000 (12:06 +0100)]
UBUNTU: SAUCE: x86/entry: build thunk_$(BITS) only if CONFIG_PREEMPTION=y

With CONFIG_PREEMPTION disabled, arch/x86/entry/thunk_64.o is just an
empty object file.

With the newer binutils (tested with 2.35.90.20210113-1ubuntu1) the GNU
assembler doesn't generate a symbol table for empty object files and
objtool fails with the following error when a valid symbol table cannot
be found:

  arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table

To prevent this from happening, build thunk_$(BITS).o only if
CONFIG_PREEMPTION is enabled.

BugLink: https://bugs.launchpad.net/bugs/1911359
Fixes: 320100a5ffe5 ("x86/entry: Remove the TRACE_IRQS cruft")
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: PCI/DPC: Disable DPC interrupt during suspend
Kai-Heng Feng [Fri, 29 Jan 2021 08:02:45 +0000 (16:02 +0800)]
UBUNTU: SAUCE: PCI/DPC: Disable DPC interrupt during suspend

BugLink: https://bugs.launchpad.net/bugs/1913691
Commit 50310600ebda ("iommu/vt-d: Enable PCI ACS for platform opt in
hint") enables ACS, and some platforms lose its NVMe after resume from
firmware:
[   50.947816] pcieport 0000:00:1b.0: DPC: containment event, status:0x1f01 source:0x0000
[   50.947817] pcieport 0000:00:1b.0: DPC: unmasked uncorrectable error detected
[   50.947829] pcieport 0000:00:1b.0: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, (Receiver ID)
[   50.947830] pcieport 0000:00:1b.0:   device [8086:06ac] error status/mask=00200000/00010000
[   50.947831] pcieport 0000:00:1b.0:    [21] ACSViol                (First)
[   50.947841] pcieport 0000:00:1b.0: AER: broadcast error_detected message
[   50.947843] nvme nvme0: frozen state error detected, reset controller

Like what previous patch does to AER, introduce new helpers to disable
DPC interrupt and enable it on system suspend and resume, respectively.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=209149
Fixes: 50310600ebda ("iommu/vt-d: Enable PCI ACS for platform opt in hint")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: PCI/AER: Disable AER interrupt during suspend
Kai-Heng Feng [Fri, 29 Jan 2021 08:02:44 +0000 (16:02 +0800)]
UBUNTU: SAUCE: PCI/AER: Disable AER interrupt during suspend

BugLink: https://bugs.launchpad.net/bugs/1913691
Commit 50310600ebda ("iommu/vt-d: Enable PCI ACS for platform opt in
hint") enables ACS, and some platforms lose its NVMe after resume from
firmware:
[   50.947816] pcieport 0000:00:1b.0: DPC: containment event, status:0x1f01 source:0x0000
[   50.947817] pcieport 0000:00:1b.0: DPC: unmasked uncorrectable error detected
[   50.947829] pcieport 0000:00:1b.0: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, (Receiver ID)
[   50.947830] pcieport 0000:00:1b.0:   device [8086:06ac] error status/mask=00200000/00010000
[   50.947831] pcieport 0000:00:1b.0:    [21] ACSViol                (First)
[   50.947841] pcieport 0000:00:1b.0: AER: broadcast error_detected message
[   50.947843] nvme nvme0: frozen state error detected, reset controller

It happens right after ACS gets enabled during resume.

To prevent that from happening, disable AER interrupt and enable it on
system suspend and resume, respectively.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=209149
Fixes: 50310600ebda ("iommu/vt-d: Enable PCI ACS for platform opt in hint")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: platform/x86: dell-uart-backlight: add get_display_mode command
Chia-Lin Kao (AceLan) [Thu, 17 Dec 2020 08:08:58 +0000 (16:08 +0800)]
UBUNTU: SAUCE: platform/x86: dell-uart-backlight: add get_display_mode command

BugLink: https://bugs.launchpad.net/bugs/1865402
ODM asks us to use get_display_mode command to confirm the scalar's
behavior, and Windows use this command, too.
To align the behavior with Windows, remove get_scalar_status command and
replace it with get_display_mode.

Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoSiFive HiFive Unleashed: Add PWM LEDs (D1, D2, D3, D4)
David Abdurachmanov [Fri, 5 Jun 2020 07:02:10 +0000 (07:02 +0000)]
SiFive HiFive Unleashed: Add PWM LEDs (D1, D2, D3, D4)

BugLink: https://bugs.launchpad.net/bugs/1910965
By default no functions are assigned to LEDs. It's up to user/distribution
to provide udev rules to configure them.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
(backported from https://github.com/sifive/meta-sifive/blob/2020.11/recipes-kernel/linux/files/freedom-u540/0007-Add-PWM-LEDs-D1-D2-D3-D4.patch)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoMicrosemi PCIe expansion board DT entry.
David Abdurachmanov [Tue, 28 Jan 2020 10:47:43 +0000 (02:47 -0800)]
Microsemi PCIe expansion board DT entry.

BugLink: https://bugs.launchpad.net/bugs/1910965
Rebased on v5.5 (no actual changes).

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Upstream-Status: Inappropriate [enable feature]
(backported from https://github.com/sifive/meta-sifive/blob/2020.11/recipes-kernel/linux/files/freedom-u540/0002-Microsemi-PCIe-expansion-board-DT-entry.patch)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agolib/decompress_unlz4.c: correctly handle zero-padding around initrds.
Dimitri John Ledkov [Thu, 14 Jan 2021 20:02:56 +0000 (20:02 +0000)]
lib/decompress_unlz4.c: correctly handle zero-padding around initrds.

lz4 compatible decompressor is simple. The format is underspecified and
relies on EOF notification to determine when to stop. Initramfs buffer
format[1] explicitly states that it can have arbitrary number of zero
padding. Thus when operating without a fill function, be extra careful to
ensure that sizes less than 4, or apperantly empty chunksizes are treated
as EOF.

To test this I have created two cpio initrds, first a normal one,
main.cpio. And second one with just a single /test-file with content
"second" second.cpio. Then i compressed both of them with gzip, and with
lz4 -l. Then I created a padding of 4 bytes (dd if=/dev/zero of=pad4 bs=1
count=4). To create four testcase initrds:

 1) main.cpio.gzip + extra.cpio.gzip = pad0.gzip
 2) main.cpio.lz4  + extra.cpio.lz4 = pad0.lz4
 3) main.cpio.gzip + pad4 + extra.cpio.gzip = pad4.gzip
 4) main.cpio.lz4  + pad4 + extra.cpio.lz4 = pad4.lz4

The pad4 test-cases replicate the initrd load by grub, as it pads and
aligns every initrd it loads.

All of the above boot, however /test-file was not accessible in the initrd
for the testcase #4, as decoding in lz4 decompressor failed. Also an error
message printed which usually is harmless.

Whith a patched kernel, all of the above testcases now pass, and /test-file
is accessible.

This fixes lz4 initrd decompress warning on every boot with grub. And more
importantly this fixes inability to load multiple lz4 compressed initrds
with grub.

I guess I should convert above decompressor streams with/without padding
into kunit tests, across all decompressor algorithms.

[1] ./Documentation/driver-api/early-userspace/buffer-format.rst

BugLink: https://bugs.launchpad.net/bugs/1835660
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: shiftfs: fix build error with 5.11
Andrea Righi [Wed, 30 Dec 2020 10:10:20 +0000 (11:10 +0100)]
UBUNTU: SAUCE: shiftfs: fix build error with 5.11

After commit:

 8760c909f54a82aaa6e76da19afe798a0c77c3c3 ("file: Rename __close_fd to close_fd and remove the files parameter")

__close_fd() has been renamed to close_fd() and the files parameter has
been removed.

Change the shiftfs code to properly support this change.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: hio: fix build error with kernel 5.11
Andrea Righi [Wed, 30 Dec 2020 09:55:44 +0000 (10:55 +0100)]
UBUNTU: hio: fix build error with kernel 5.11

hd_struct has been merged with block_device by this commit:

 0d02129e76edf91cf04fabf1efbc3a9a1f1d729a ("block: merge struct block_device and struct hd_struct")

Update hio to properly support this change.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmblob in smk_netlbl_mls()
Paolo Pisati [Tue, 27 Oct 2020 11:04:12 +0000 (11:04 +0000)]
UBUNTU: SAUCE: LSM: Use lsmblob in smk_netlbl_mls()

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: change ima_read_file() to use lsmblob
Paolo Pisati [Tue, 27 Oct 2020 10:27:39 +0000 (10:27 +0000)]
UBUNTU: SAUCE: LSM: change ima_read_file() to use lsmblob

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: apparmor: rename kzfree() to kfree_sensitive()
Paolo Pisati [Tue, 27 Oct 2020 09:45:23 +0000 (09:45 +0000)]
UBUNTU: SAUCE: apparmor: rename kzfree() to kfree_sensitive()

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: platform/x86: dell-uart-backlight: rename kzfree() to kfree_sensitive()
Paolo Pisati [Tue, 27 Oct 2020 09:43:59 +0000 (09:43 +0000)]
UBUNTU: SAUCE: platform/x86: dell-uart-backlight: rename kzfree() to kfree_sensitive()

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
3 years agoUBUNTU: SAUCE: doc: remove python3-venv dependency
Paolo Pisati [Thu, 8 Oct 2020 09:33:20 +0000 (11:33 +0200)]
UBUNTU: SAUCE: doc: remove python3-venv dependency

BugLink: https://bugs.launchpad.net/bugs/1896801
Since upstream has removed python3-venv, update our build dependencies and let
linux-doc build outside a virtualenv.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: dccp: avoid double free of ccid on child socket
Thadeu Lima de Souza Cascardo [Fri, 28 Aug 2020 02:47:47 +0000 (23:47 -0300)]
UBUNTU: SAUCE: dccp: avoid double free of ccid on child socket

When a dccp socket is cloned, the pointers to dccps_hc_rx_ccid and
dccps_hc_tx_ccid are copied. When CCID features are activated on the child
socket, the CCID objects are freed, leaving the parent socket with dangling
pointers.

During cloning, set dccps_hc_rx_ccid and dccps_hc_tx_ccid to NULL so the
parent objects are not freed.

Reported-by: Hadar Manor
CVE-2020-16119
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: Audit: Fix for missing NULL check
Casey Schaufler [Tue, 1 Sep 2020 18:19:11 +0000 (11:19 -0700)]
UBUNTU: SAUCE: Audit: Fix for missing NULL check

AppArmor audit calls can have a NULL audit context,
so the LSM context audit needs to check for this.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: AppArmor: Remove the exclusive flag
Casey Schaufler [Mon, 6 Apr 2020 15:05:13 +0000 (08:05 -0700)]
UBUNTU: SAUCE: AppArmor: Remove the exclusive flag

With the inclusion of the "display" process attribute
mechanism AppArmor no longer needs to be treated as an
"exclusive" security module. Remove the flag that indicates
it is exclusive. Remove the stub getpeersec_dgram AppArmor
hook as it has no effect in the single LSM case and
interferes in the multiple LSM case.

Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Add /proc attr entry for full LSM context
Casey Schaufler [Fri, 21 Aug 2020 22:27:38 +0000 (15:27 -0700)]
UBUNTU: SAUCE: LSM: Add /proc attr entry for full LSM context

Add an entry /proc/.../attr/context which displays the full
process security "context" in compound format:
        lsm1\0value\0lsm2\0value\0...
This entry is not writable.

A security module may decide that its policy does not allow
this information to be displayed. In this case none of the
information will be displayed.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: linux-api@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: Audit: Add a new record for multiple object LSM
Casey Schaufler [Fri, 21 Aug 2020 21:59:03 +0000 (14:59 -0700)]
UBUNTU: SAUCE: Audit: Add a new record for multiple object LSM
 attributes

Create a new audit record type to contain the object information
when there are multiple security modules that require such data.
This record is emitted before the other records for the event, but
is linked with the same timestamp and serial number.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: linux-audit@redhat.com
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: Audit: Add new record for multiple process LSM attributes
Casey Schaufler [Fri, 21 Aug 2020 21:29:19 +0000 (14:29 -0700)]
UBUNTU: SAUCE: Audit: Add new record for multiple process LSM attributes

Create a new audit record type to contain the subject information
when there are multiple security modules that require such data.
This record is linked with the same timestamp and serial number.
The record is produced only in cases where there is more than one
security module with a process "context".

Before this change the only audit events that required multiple
records were syscall events. Several non-syscall events include
subject contexts, so the use of audit_context data has been expanded
as necessary.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: linux-audit@redhat.com
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Verify LSM display sanity in binder
Casey Schaufler [Tue, 24 Mar 2020 00:00:09 +0000 (17:00 -0700)]
UBUNTU: SAUCE: LSM: Verify LSM display sanity in binder

Verify that the tasks on the ends of a binder transaction
use the same "display" security module. This prevents confusion
of security "contexts".

Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: NET: Store LSM netlabel data in a lsmblob
Casey Schaufler [Fri, 21 Aug 2020 17:54:15 +0000 (10:54 -0700)]
UBUNTU: SAUCE: NET: Store LSM netlabel data in a lsmblob

Netlabel uses LSM interfaces requiring an lsmblob and
the internal storage is used to pass information between
these interfaces, so change the internal data from a secid
to a lsmblob. Update the netlabel interfaces and their
callers to accommodate the change. This requires that the
modules using netlabel use the lsm_id.slot to access the
correct secid when using netlabel.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: netdev@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: security_secid_to_secctx in netlink netfilter
Casey Schaufler [Fri, 21 Aug 2020 00:14:14 +0000 (17:14 -0700)]
UBUNTU: SAUCE: LSM: security_secid_to_secctx in netlink netfilter

Change netlink netfilter interfaces to use lsmcontext
pointers, and remove scaffolding.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
cc: netdev@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmcontext in security_inode_getsecctx
Casey Schaufler [Thu, 20 Aug 2020 23:25:25 +0000 (16:25 -0700)]
UBUNTU: SAUCE: LSM: Use lsmcontext in security_inode_getsecctx

Change the security_inode_getsecctx() interface to fill
a lsmcontext structure instead of data and length pointers.
This provides the information about which LSM created the
context so that security_release_secctx() can use the
correct hook.

Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmcontext in security_secid_to_secctx
Casey Schaufler [Thu, 20 Aug 2020 22:19:52 +0000 (15:19 -0700)]
UBUNTU: SAUCE: LSM: Use lsmcontext in security_secid_to_secctx

Replace the (secctx,seclen) pointer pair with a single
lsmcontext pointer to allow return of the LSM identifier
along with the context and context length. This allows
security_release_secctx() to know how to release the
context. Callers have been modified to use or save the
returned data from the new structure.

Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: netdev@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Ensure the correct LSM context releaser
Casey Schaufler [Thu, 20 Aug 2020 18:47:01 +0000 (11:47 -0700)]
UBUNTU: SAUCE: LSM: Ensure the correct LSM context releaser

Add a new lsmcontext data structure to hold all the information
about a "security context", including the string, its size and
which LSM allocated the string. The allocation information is
necessary because LSMs have different policies regarding the
lifecycle of these strings. SELinux allocates and destroys
them on each use, whereas Smack provides a pointer to an entry
in a list that never goes away.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: linux-integrity@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Specify which LSM to display
Casey Schaufler [Thu, 20 Aug 2020 17:40:08 +0000 (10:40 -0700)]
UBUNTU: SAUCE: LSM: Specify which LSM to display

Create a new entry "display" in the procfs attr directory for
controlling which LSM security information is displayed for a
process. A process can only read or write its own display value.

The name of an active LSM that supplies hooks for
human readable data may be written to "display" to set the
value. The name of the LSM currently in use can be read from
"display". At this point there can only be one LSM capable
of display active. A helper function lsm_task_display() is
provided to get the display slot for a task_struct.

Setting the "display" requires that all security modules using
setprocattr hooks allow the action. Each security module is
responsible for defining its policy.

AppArmor hook provided by John Johansen <john.johansen@canonical.com>
SELinux hook provided by Stephen Smalley <sds@tycho.nsa.gov>

Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: IMA: Change internal interfaces to use lsmblobs
Casey Schaufler [Thu, 20 Aug 2020 16:24:21 +0000 (09:24 -0700)]
UBUNTU: SAUCE: IMA: Change internal interfaces to use lsmblobs

The IMA interfaces ima_get_action() and ima_match_policy()
call LSM functions that use lsmblobs. Change the IMA functions
to pass the lsmblob to be compatible with the LSM functions.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
cc: linux-integrity@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
[ saf: resolve conflicts ]
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmblob in security_cred_getsecid
Casey Schaufler [Thu, 20 Aug 2020 15:43:21 +0000 (08:43 -0700)]
UBUNTU: SAUCE: LSM: Use lsmblob in security_cred_getsecid

Change the security_cred_getsecid() interface to fill in a
lsmblob instead of a u32 secid. The associated data elements
in the audit sub-system are changed from a secid to a lsmblob
to accommodate multiple possible LSM audit users.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
cc: linux-integrity@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmblob in security_inode_getsecid
Casey Schaufler [Thu, 20 Aug 2020 00:28:57 +0000 (17:28 -0700)]
UBUNTU: SAUCE: LSM: Use lsmblob in security_inode_getsecid

Change the security_inode_getsecid() interface to fill in a
lsmblob structure instead of a u32 secid. This allows for its
callers to gather data from all registered LSMs. Data is provided
for IMA and audit.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
cc: linux-integrity@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
[ saf: resolve conflicts ]
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmblob in security_task_getsecid
Casey Schaufler [Wed, 19 Aug 2020 23:06:37 +0000 (16:06 -0700)]
UBUNTU: SAUCE: LSM: Use lsmblob in security_task_getsecid

Change the security_task_getsecid() interface to fill in
a lsmblob structure instead of a u32 secid in support of
LSM stacking. Audit interfaces will need to collect all
possible secids for possible reporting.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
cc: linux-integrity@vger.kernel.org
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
[ saf: resolve conflicts ]
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
3 years agoUBUNTU: SAUCE: LSM: Use lsmblob in security_ipc_getsecid
Casey Schaufler [Thu, 19 Mar 2020 16:40:29 +0000 (09:40 -0700)]
UBUNTU: SAUCE: LSM: Use lsmblob in security_ipc_getsecid

There may be more than one LSM that provides IPC data
for auditing. Change security_ipc_getsecid() to fill in
a lsmblob structure instead of the u32 secid. The
audit data structure containing the secid will be updated
later, so there is a bit of scaffolding here.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>