RTL8822BE WiFi Disabled in Kernel 4.18.0-12

Bug #1806472 reported by Callum Hutchinson on 2018-12-03
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Status tracked in Disco
Bionic
Medium
Unassigned
Cosmic
Medium
Unassigned
Disco
Undecided
Kai-Heng Feng

Bug Description

===SRU Justification===
[Impact]
Realtek 8822be doesn't work under kernel lockdown.

[Fix]
Add r8822be.ko to signature-inclusion, so it can be signed and be loaded
when lockdown is enabled.

[Test]
Since I can't signed the kernel so it's not tested.

[Regression Potential]
Low. The driver is maintained by a Realtek guy, so bugs are actually
getting fixed.

===Original Bug Report===
Received kernel patch 4.18.0-12 today on my machine. On reboot my WiFi appears to be unavailable.
lspci still recognises the installed RTL8822BE card and a reboot back to the previous kernel version (4.18.0-11) seems to resolve the problem.

We tried some debugging in the IRC channel and didn't get very far. The r8822be module alias is intact, trying to modprobe it or insert results in a "operation not permitted" error. Modprobing mac80211 and cfg80211 which r8822be depends on did not seem to help.

KMod Lists for -12 and -11 kernels:
https://paste.ubuntu.com/p/pwx5mKszVt/

`ls -latr /lib/modules/4.18.0-12-*/ ; grep -i B822 /lib/modules/4.18.0-12-*/modules.alias` :
https://paste.ubuntu.com/p/5zcCbXyM5g/

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: linux-image-4.18.0-11-generic 4.18.0-11.12
ProcVersionSignature: Ubuntu 4.18.0-11.12-generic 4.18.12
Uname: Linux 4.18.0-11-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: callum 2989 F.... pulseaudio
 /dev/snd/controlC0: callum 2989 F.... pulseaudio
CurrentDesktop: KDE
Date: Mon Dec 3 19:27:16 2018
InstallationDate: Installed on 2018-11-10 (22 days ago)
InstallationMedia: Kubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.2)
MachineType: LENOVO 90H90015UK
ProcFB: 0 amdgpudrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.18.0-11-generic root=UUID=d5f81e09-382c-4759-8a6d-2503fe6959b4 ro quiet splash vt.handoff=1
RelatedPackageVersions:
 linux-restricted-modules-4.18.0-11-generic N/A
 linux-backports-modules-4.18.0-11-generic N/A
 linux-firmware 1.175.1
SourcePackage: linux
StagingDrivers: r8822be
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/15/2018
dmi.bios.vendor: LENOVO
dmi.bios.version: O3FKT26A
dmi.board.name: 36E1
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40709 WIN 3259620440547
dmi.chassis.type: 3
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrO3FKT26A:bd06/15/2018:svnLENOVO:pn90H90015UK:pvrLegionY720T-34ASU:rvnLENOVO:rn36E1:rvrSDK0J40709WIN3259620440547:cvnLENOVO:ct3:cvrNone:
dmi.product.family: Legion Y720T-34ASU
dmi.product.name: 90H90015UK
dmi.product.sku: LENOVO_MT_90H9_BU_LENOVO_FM_Legion Y720T-34ASU
dmi.product.version: Legion Y720T-34ASU
dmi.sys.vendor: LENOVO

Callum Hutchinson (callumh003) wrote :

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Kai-Heng Feng (kaihengfeng) wrote :

Please try the hotkey "Alt+PrintScreen+x", then reload rtl8822be?

Callum Hutchinson (callumh003) wrote :

Hi, not sure what the hotkey was supposed to do if anything, I don't have any dmesg entries after executing it and there's no change in the status of the r8822be module when I attempt a modprobe afterwards.

Kai-Heng Feng (kaihengfeng) wrote :

Ok, can you test if disabling secure boot in BIOS helps?

Callum Hutchinson (callumh003) wrote :

Yep, disabling Secure Boot seems to allow the driver to load no problem.
Attached is dmesg output of this boot sequence with Secure Boot disabled.

Kai-Heng Feng (kaihengfeng) wrote :

Thanks for your testing.

This means staging drivers don't work when kernel lockdown is enabled. I'll discuss with kernel team members how to sort this out.

Changed in linux (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
description: updated
Callum Hutchinson (callumh003) wrote :

Hey,

Still seems to be an issue with Kernel v4.18.0-13 too. Tried to modprobe r8822be module and received the same "operation not permitted" error as before.

Paul Singh (psingh76) wrote :

Installed 18.04 LTS with kernel 4.15 - was required to disabled secure boot mode to get the r8822be wifi module working. Seems unsigned here as well.

lappy5k:~$ sudo uname -a
Linux lappy5k 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

---- modinfo, no signature ----
@lappy5k:~$ sudo modinfo r8822be
filename: /lib/modules/4.15.0-43-generic/kernel/drivers/staging/rtlwifi/r8822be.ko
description: Realtek 802.11n PCI wireless core
license: GPL
author: Larry Finger <email address hidden>
author: Realtek WlanFAE <email address hidden>
author: lizhaoming <email address hidden>
description: PCI basic driver for rtlwifi
license: GPL
author: Larry Finger <email address hidden>
author: Realtek WlanFAE <email address hidden>
author: lizhaoming <email address hidden>
firmware: rtlwifi/rtl8822befw.bin
description: Realtek 8822BE 802.11n PCI wireless
license: GPL
author: Larry Finger <email address hidden>
author: Realtek WlanFAE <email address hidden>
description: Realtek 802.11n PCI wireless core
license: GPL
author: Larry Finger <email address hidden>
author: Realtek WlanFAE <email address hidden>
description: Realtek 802.11n PCI wireless core
license: GPL
author: Larry Finger <email address hidden>
author: Realtek WlanFAE <email address hidden>
srcversion: 9AE3E31830D5363CA6C8264
alias: pci:v000010ECd0000B822sv*sd*bc*sc*i*
depends: mac80211,cfg80211
staging: Y
retpoline: Y
intree: Y
name: r8822be
vermagic: 4.15.0-43-generic SMP mod_unload
parm: debug_level:int
parm: swenc:Set to 1 for software crypto (default 0)
 (bool)
parm: ips:Set to 0 to not use link power save (default 1)
 (bool)
parm: swlps:Set to 1 to use SW control power save (default 0)
 (bool)
parm: fwlps:Set to 1 to use FW control power save (default 1)
 (bool)
parm: msi:Set to 1 to use MSI interrupts mode (default 1)
 (bool)
parm: dma64:Set to 1 to use DMA 64 (default 0)
 (bool)
parm: aspm:Set to 1 to enable ASPM (default 1)
 (int)
parm: debug:Set debug level (0-5) (default 0)
parm: debug_mask:Set debug mask (default 0) (ullong)
parm: disable_watchdog:Set to 1 to disable the watchdog (default 0)
 (bool)
$

Callum Hutchinson (callumh003) wrote :

So, the driver was previously unsigned, then signed and included in the original Ubuntu kernel for 18.10, then subsequently unsigned during an update somewhere along the way?

That doesn't make sense to me - would have to try and find upstream to work out what has happened.
Larry Finger suggests that Realtek has rewritten the driver and his GitHub repo is only for older kernels that do not already ship the r8822be driver. 4.21 is quoted as when this new driver will drop.

https://github.com/lwfinger/rtlwifi_new/issues/408#issuecomment-426299298

Kai-Heng Feng (kaihengfeng) wrote :

The drivers in staging won't get loaded when lockdown is enabled to provide safety. There's a list to override behavior though.

The r8822be in its current form defaults to enable debugfs, which can be less secure as it exposes and extra interface to userspace. But we are not sure if the driver still works once the debugfs gets disabled, so please test this kernel:
https://people.canonical.com/~khfeng/lp1806472/

Once we are sure r8822be still works when debugfs is disabled, we can include this fix to Cosmic.

Callum Hutchinson (callumh003) wrote :

Hey,

This kernel seems to be working fine on a fresh install of KDE Neon (based on Bionic). I had to roll back due to other reasons, but installing this kernel has fixed it for me here. If you require any logs let me know.

Short of reinstalling to 18.10 I haven't got a way to test it on there, unfortunately.

Hopefully it won't break when Realtek releases the rewritten driver :)

Seth Forshee (sforshee) on 2019-01-15
Changed in linux (Ubuntu Disco):
status: Confirmed → Fix Committed
Stefan Bader (smb) on 2019-01-21
Changed in linux (Ubuntu Bionic):
status: New → Triaged
Changed in linux (Ubuntu Cosmic):
status: New → Triaged
Changed in linux (Ubuntu Bionic):
importance: Undecided → Medium
Changed in linux (Ubuntu Cosmic):
importance: Undecided → Medium
Changed in linux (Ubuntu Bionic):
status: Triaged → Fix Committed
Changed in linux (Ubuntu Cosmic):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (14.1 KiB)

This bug was fixed in the package linux - 4.19.0-12.13

---------------
linux (4.19.0-12.13) disco; urgency=medium

  * linux: 4.19.0-12.13 -proposed tracker (LP: #1813664)

  * kernel oops in bcache module (LP: #1793901)
    - SAUCE: bcache: never writeback a discard operation

  * Disco update: 4.19.18 upstream stable release (LP: #1813611)
    - ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address
    - mlxsw: spectrum: Disable lag port TX before removing it
    - mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion
    - net: dsa: mv88x6xxx: mv88e6390 errata
    - net, skbuff: do not prefer skb allocation fails early
    - qmi_wwan: add MTU default to qmap network interface
    - ipv6: Take rcu_read_lock in __inet6_bind for mapped addresses
    - net: clear skb->tstamp in bridge forwarding path
    - netfilter: ipset: Allow matching on destination MAC address for mac and
      ipmac sets
    - gpio: pl061: Move irq_chip definition inside struct pl061
    - drm/amd/display: Guard against null stream_state in set_crc_source
    - drm/amdkfd: fix interrupt spin lock
    - ixgbe: allow IPsec Tx offload in VEPA mode
    - platform/x86: asus-wmi: Tell the EC the OS will handle the display off
      hotkey
    - e1000e: allow non-monotonic SYSTIM readings
    - usb: typec: tcpm: Do not disconnect link for self powered devices
    - selftests/bpf: enable (uncomment) all tests in test_libbpf.sh
    - of: overlay: add missing of_node_put() after add new node to changeset
    - writeback: don't decrement wb->refcnt if !wb->bdi
    - serial: set suppress_bind_attrs flag only if builtin
    - bpf: Allow narrow loads with offset > 0
    - ALSA: oxfw: add support for APOGEE duet FireWire
    - x86/mce: Fix -Wmissing-prototypes warnings
    - MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur
    - crypto: ecc - regularize scalar for scalar multiplication
    - arm64: perf: set suppress_bind_attrs flag to true
    - drm/atomic-helper: Complete fake_commit->flip_done potentially earlier
    - clk: meson: meson8b: fix incorrect divider mapping in cpu_scale_table
    - samples: bpf: fix: error handling regarding kprobe_events
    - usb: gadget: udc: renesas_usb3: add a safety connection way for
      forced_b_device
    - fpga: altera-cvp: fix probing for multiple FPGAs on the bus
    - selinux: always allow mounting submounts
    - ASoC: pcm3168a: Don't disable pcm3168a when CONFIG_PM defined
    - scsi: qedi: Check for session online before getting iSCSI TLV data.
    - drm/amdgpu: Reorder uvd ring init before uvd resume
    - rxe: IB_WR_REG_MR does not capture MR's iova field
    - efi/libstub: Disable some warnings for x86{,_64}
    - jffs2: Fix use of uninitialized delayed_work, lockdep breakage
    - clk: imx: make mux parent strings const
    - pstore/ram: Do not treat empty buffers as valid
    - media: uvcvideo: Refactor teardown of uvc on USB disconnect
    - powerpc/xmon: Fix invocation inside lock region
    - powerpc/pseries/cpuidle: Fix preempt warning
    - media: firewire: Fix app_info parameter type in avc_ca{,_app}_info
    - ASoC: use dma_ops of parent device for acp_audio_dma
    - media: ve...

Changed in linux (Ubuntu Disco):
status: Fix Committed → Fix Released
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-cosmic' to 'verification-done-cosmic'. If the problem still exists, change the tag 'verification-needed-cosmic' to 'verification-failed-cosmic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-cosmic
Callum Hutchinson (callumh003) wrote :

Didn't test this on a full install but enabled the 4.18.0-16 signed kernel through the cosmic-proposed repository on a Bionic install. Works fine! mokutil reports secure-boot enabled and release shows as 4.18.0-16 :)

It should be noted that just installing this kernel itself did not fix the issue, the kernel-modules-extra package must be installed!

Thanks.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Paul Singh (psingh76) wrote :

This looks like it works on 4.15.0-46-generic #49 now. Wifi seems to be working while booted in secure mode.

modinfo attached showing it as signed with ver PKCS#7 / md4

lappy5k:~$ uname -a
Linux lappy5k 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

lappy5k:~$ mokutil --sb-state
SecureBoot enabled

lappy5k:~$ cat iwconfig-info.txt
wlo1 IEEE 802.11 ESSID:"LEDE"
          Mode:Managed Frequency:2.412 GHz Access Point: 16:91:82:35:66:B8
          Bit Rate=144.4 Mb/s Tx-Power=20 dBm
          Retry short limit:7 RTS thr=2347 B Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=61/70 Signal level=-49 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:3 Missed beacon:0

lappy5k:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

tags: added: verification-done-bionic
removed: verification-needed-bionic
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.