diff options
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | 0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch | 63 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | config | 4 |
4 files changed, 81 insertions, 11 deletions
@@ -1,5 +1,5 @@ pkgbase = linux-macbook - pkgver = 4.16.7 + pkgver = 4.16.10 pkgrel = 1 url = https://www.kernel.org/ arch = x86_64 @@ -12,8 +12,8 @@ pkgbase = linux-macbook options = !strip source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.tar.xz source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.tar.sign - source = https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.16.7.xz - source = https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.16.7.sign + source = https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.16.10.xz + source = https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.16.10.sign source = config source = 60-linux.hook source = 90-linux.hook @@ -24,13 +24,14 @@ pkgbase = linux-macbook source = 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch source = 0002-drm-i915-edp-Only-use-the-alternate-fixed-mode-if-it.patch source = 0003-Partially-revert-swiotlb-remove-various-exports.patch + source = 0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E sha256sums = 63f6dc8e3c9f3a0273d5d6f4dca38a2413ca3a5f689329d05b750e4c87bb21b9 sha256sums = SKIP - sha256sums = f5ef83461054024814846eb816c76eba1b903f7e3e38c3417027b33070b60d91 + sha256sums = 9fe6093be401fe0ff3f6cb3d428f137119a7befaf86d70f18c7e88871c1852d6 sha256sums = SKIP - sha256sums = 8566a49997faf3f8678440c52578a7a0ee901e598d3b67d3bee3799fb92e8f86 + sha256sums = e39c02fd021f125a6202f7e4c0692dfd3ced93d404ecb6c8dca6994c8e17b227 sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21 sha256sums = 75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919 sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65 @@ -40,6 +41,7 @@ pkgbase = linux-macbook sha256sums = 7fb607fe384dd814e9e45d7fc28f7b5b23a51d80784c54bf9209486ad428be14 sha256sums = ceaa19e0af3842c62eb666a4ac5c79d89b3e6d00593442f18d6508ca6d74bbaa sha256sums = 5b397cf9eccdad0c1f2865842c29ba6f4e32ad7dbe4e0c6ef6ca6f07d2963cea + sha256sums = 052a39582f84c52b027c261fcec90325493f4d46f15647c274a58e39145deced pkgname = linux-macbook pkgdesc = The Linux-macbook kernel and modules diff --git a/0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch b/0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch new file mode 100644 index 000000000000..009251cb3e6e --- /dev/null +++ b/0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch @@ -0,0 +1,63 @@ +From 005c2f4576d9bab5ff97dac4b3d27aafa2f1f153 Mon Sep 17 00:00:00 2001 +Message-Id: <005c2f4576d9bab5ff97dac4b3d27aafa2f1f153.1526520264.git.jan.steffens@gmail.com> +In-Reply-To: <1d8e17daf031e219d904ef93718081534c9e8cea.1526520263.git.jan.steffens@gmail.com> +References: <1d8e17daf031e219d904ef93718081534c9e8cea.1526520263.git.jan.steffens@gmail.com> +From: Mathias Nyman <mathias.nyman@linux.intel.com> +Date: Mon, 14 May 2018 11:57:23 +0300 +Subject: [PATCH 4/4] xhci: Fix USB3 NULL pointer dereference at logical + disconnect. + +Hub driver will try to disable a USB3 device twice at logical disconnect, +racing with xhci_free_dev() callback from the first port disable. + +This can be triggered with "udisksctl power-off --block-device <disk>" +or by writing "1" to the "remove" sysfs file for a USB3 device +in 4.17-rc4. + +USB3 devices don't have a similar disabled link state as USB2 devices, +and use a U3 suspended link state instead. In this state the port +is still enabled and connected. + +hub_port_connect() first disconnects the device, then later it notices +that device is still enabled (due to U3 states) it will try to disable +the port again (set to U3). + +The xhci_free_dev() called during device disable is async, so checking +for existing xhci->devs[i] when setting link state to U3 the second time +was successful, even if device was being freed. + +The regression was caused by, and whole thing revealed by, +Commit 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device") +which sets xhci->devs[i]->udev to NULL before xhci_virt_dev() returned. +and causes a NULL pointer dereference the second time we try to set U3. + +Fix this by checking xhci->devs[i]->udev exists before setting link state. + +The original patch went to stable so this fix needs to be applied there as +well. + +Fixes: 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device") +Cc: <stable@vger.kernel.org> +Reported-by: Jordan Glover <Golden_Miller83@protonmail.ch> +Tested-by: Jordan Glover <Golden_Miller83@protonmail.ch> +Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> +--- + drivers/usb/host/xhci-hub.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c +index 72ebbc908e19..32cd52ca8318 100644 +--- a/drivers/usb/host/xhci-hub.c ++++ b/drivers/usb/host/xhci-hub.c +@@ -354,7 +354,7 @@ int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, + + slot_id = 0; + for (i = 0; i < MAX_HC_SLOTS; i++) { +- if (!xhci->devs[i]) ++ if (!xhci->devs[i] || !xhci->devs[i]->udev) + continue; + speed = xhci->devs[i]->udev->speed; + if (((speed >= USB_SPEED_SUPER) == (hcd->speed >= HCD_USB3)) +-- +2.17.0 + @@ -6,7 +6,7 @@ #pkgbase=linux # Build stock -ARCH kernel pkgbase=linux-macbook # Build kernel with a different name _srcname=linux-4.16 -pkgver=4.16.7 +pkgver=4.16.10 pkgrel=1 arch=('x86_64') url="https://www.kernel.org/" @@ -26,6 +26,7 @@ source=( 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch 0002-drm-i915-edp-Only-use-the-alternate-fixed-mode-if-it.patch 0003-Partially-revert-swiotlb-remove-various-exports.patch + 0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds @@ -33,9 +34,9 @@ validpgpkeys=( ) sha256sums=('63f6dc8e3c9f3a0273d5d6f4dca38a2413ca3a5f689329d05b750e4c87bb21b9' 'SKIP' - 'f5ef83461054024814846eb816c76eba1b903f7e3e38c3417027b33070b60d91' + '9fe6093be401fe0ff3f6cb3d428f137119a7befaf86d70f18c7e88871c1852d6' 'SKIP' - '8566a49997faf3f8678440c52578a7a0ee901e598d3b67d3bee3799fb92e8f86' + 'e39c02fd021f125a6202f7e4c0692dfd3ced93d404ecb6c8dca6994c8e17b227' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' @@ -44,7 +45,8 @@ sha256sums=('63f6dc8e3c9f3a0273d5d6f4dca38a2413ca3a5f689329d05b750e4c87bb21b9' '09189eb269a9fd16898cf90a477df23306236fb897791e8d04e5a75d5007bbff' '7fb607fe384dd814e9e45d7fc28f7b5b23a51d80784c54bf9209486ad428be14' 'ceaa19e0af3842c62eb666a4ac5c79d89b3e6d00593442f18d6508ca6d74bbaa' - '5b397cf9eccdad0c1f2865842c29ba6f4e32ad7dbe4e0c6ef6ca6f07d2963cea') + '5b397cf9eccdad0c1f2865842c29ba6f4e32ad7dbe4e0c6ef6ca6f07d2963cea' + '052a39582f84c52b027c261fcec90325493f4d46f15647c274a58e39145deced') _kernelname=${pkgbase#linux} : ${_kernelname:=-ARCH} @@ -77,6 +79,9 @@ prepare() { # NVIDIA driver compat patch -Np1 -i ../0003-Partially-revert-swiotlb-remove-various-exports.patch + # https://bugs.archlinux.org/task/58237 + patch -Np1 -i ../0004-xhci-Fix-USB3-NULL-pointer-dereference-at-logical-di.patch + cat ../config - >.config <<END CONFIG_LOCALVERSION="${_kernelname}" CONFIG_LOCALVERSION_AUTO=n @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 4.16.7-1 Kernel Configuration +# Linux/x86 4.16.10-1 Kernel Configuration # CONFIG_64BIT=y CONFIG_X86_64=y @@ -6203,7 +6203,7 @@ CONFIG_SND_HDA_CODEC_CA0132_DSP=y CONFIG_SND_HDA_CODEC_CMEDIA=m CONFIG_SND_HDA_CODEC_SI3054=m CONFIG_SND_HDA_GENERIC=m -CONFIG_SND_HDA_POWER_SAVE_DEFAULT=10 +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 CONFIG_SND_HDA_CORE=m CONFIG_SND_HDA_DSP_LOADER=y CONFIG_SND_HDA_I915=y |