[PATCH 0/1][SRU][OEM-OSP1-B] Kernel NULL pointer dereference when plugging/unpluggin USB-c (power or hub)

Koba Ko koba.ko at canonical.com
Fri Jun 5 08:46:03 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1878544

[Impact]
Asus Zenbook Flip S (UX-370UAR). Intel Core i7-8550U CPU).
The X freezes and doesnt even allow to start a console session.

Only happening on Ubuntu 18.04 and 20.04.
Does not happen in the same computer under Ubuntu 16.04 or Windows 10.

Can be replicated easily. Every time I plug/unplug the power USB-C or 
the USB-c hub. Mostly, on any interaction with the USB-c or I/O ports.

If I plug/unplug the USB-c without X in a console session (CTRL+ALT+F3) I get 
the following:
 BUG: kernel NULL point dereference, address: 0000000000000080
 ...
 Workqueue: events ucsi_connector_change [typec_usci]
 RIP: 0010:ucsi_displayport_remove_partner+0xe/0x30 [typec_usci]
 ...

[Fix]
Before this commit, typec_altmode_get_partner would return a
const struct typec_altmode * pointing to address 0x08 when
to_altmode(adev)->partner was NULL.

Add a check for to_altmode(adev)->partner being NULL to fix this.

[test]
With the patch, User has verified the panic of kernel is gone.

[Regression Potential]
Low. Just check whether to_altmode(adev)->partner is NULL or not.

Naoki Kiryu (1):
  usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning
    an invalid pointer

 drivers/usb/typec/bus.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.17.1




More information about the kernel-team mailing list