From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7FD6C433FE for ; Mon, 18 Apr 2022 13:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243265AbiDRNdh (ORCPT ); Mon, 18 Apr 2022 09:33:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241175AbiDRNGr (ORCPT ); Mon, 18 Apr 2022 09:06:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1561B21814; Mon, 18 Apr 2022 05:47:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B95D6B80E4E; Mon, 18 Apr 2022 12:47:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8BFEC385A7; Mon, 18 Apr 2022 12:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286034; bh=B2ANfVi+se4NMIXvMkIsMOtqfcXuiy/He1grspu+uj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xbqtfSfdVxgDoJUc2y9rmxpkJxOFcapZvTdrH9Oxu5yRGmr95/NuqEYatBgQ4ZRW0 LgVwfkQNs6b7RxzuMaq/oSdBCGbeGcryHUr4iJitUlt9a0SWOxX2gFxNo/UGSijXn9 XWG44FvPr8vsjkZxQs1C8Gmcjlr9d2z9OMc+xcYc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eddie James , Joel Stanley , Johan Hovold Subject: [PATCH 4.14 001/284] USB: serial: pl2303: add IBM device IDs Date: Mon, 18 Apr 2022 14:09:42 +0200 Message-Id: <20220418121210.735243709@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Eddie James commit e1d15646565b284e9ef2433234d6cfdaf66695f1 upstream. IBM manufactures a PL2303 device for UPS communications. Add the vendor and product IDs so that the PL2303 driver binds to the device. Signed-off-by: Eddie James Signed-off-by: Joel Stanley Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220301224446.21236-1-eajames@linux.ibm.com Cc: stable@vger.kernel.org [ johan: amend the SoB chain ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 3 +++ 2 files changed, 4 insertions(+) --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -113,6 +113,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530GC_PRODUCT_ID) }, { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) }, { USB_DEVICE(AT_VENDOR_ID, AT_VTKIT3_PRODUCT_ID) }, + { USB_DEVICE(IBM_VENDOR_ID, IBM_PRODUCT_ID) }, { } /* Terminating entry */ }; =20 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h @@ -34,6 +34,9 @@ #define ATEN_PRODUCT_UC232B 0x2022 #define ATEN_PRODUCT_ID2 0x2118 =20 +#define IBM_VENDOR_ID 0x04b3 +#define IBM_PRODUCT_ID 0x4016 + #define IODATA_VENDOR_ID 0x04bb #define IODATA_PRODUCT_ID 0x0a03 #define IODATA_PRODUCT_ID_RSAQ5 0x0a0e From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 365DEC4167E for ; Mon, 18 Apr 2022 13:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243768AbiDRNeZ (ORCPT ); Mon, 18 Apr 2022 09:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241634AbiDRNI1 (ORCPT ); Mon, 18 Apr 2022 09:08:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C324A2B274; Mon, 18 Apr 2022 05:47:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 51A3861267; Mon, 18 Apr 2022 12:47:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11624C385A1; Mon, 18 Apr 2022 12:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286069; bh=D0KhdQUtd4xsL/VSZoclQHtl4B5v9CRGQPzcl2JCxKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bT2pUjxHf1OL31atDgvzwcrGebLrhyZ28cMj8arYbq5UnFqrwxPmGCQ5K3FM6jdF/ loJTxb5HmbEeRcJ5ON4eXDC7XBVgGvBjw+x9IiPiPndGpPV141nZDvAXPcmL+WIbAh urdjDJYy9M2RC8C+L+76Cc4d4lXAnwz+4NqUBmlg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.14 002/284] USB: serial: simple: add Nokia phone driver Date: Mon, 18 Apr 2022 14:09:43 +0200 Message-Id: <20220418121210.763060320@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Johan Hovold commit c4b9c570965f75d0d55e639747f1e5ccdad2fae0 upstream. Add a new "simple" driver for certain Nokia phones, including Nokia 130 (RM-1035) which exposes two serial ports in "charging only" mode: Bus 001 Device 009: ID 0421:069a Nokia Mobile Phones 130 [RM-1035] (Chargin= g only) Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0421 Nokia Mobile Phones idProduct 0x069a 130 [RM-1035] (Charging only) bcdDevice 1.00 iManufacturer 1 Nokia iProduct 2 Nokia 130 (RM-1035) iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0037 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Device Status: 0x0000 (Bus Powered) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220228084919.10656-1-johan@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/usb/serial/Kconfig | 1 + drivers/usb/serial/usb-serial-simple.c | 7 +++++++ 2 files changed, 8 insertions(+) --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig @@ -65,6 +65,7 @@ config USB_SERIAL_SIMPLE - Libtransistor USB console - a number of Motorola phones - Motorola Tetra devices + - Nokia mobile phones - Novatel Wireless GPS receivers - Siemens USB/MPI adapter. - ViVOtech ViVOpay USB device. --- a/drivers/usb/serial/usb-serial-simple.c +++ b/drivers/usb/serial/usb-serial-simple.c @@ -94,6 +94,11 @@ DEVICE(moto_modem, MOTO_IDS); { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */ DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); =20 +/* Nokia mobile phone driver */ +#define NOKIA_IDS() \ + { USB_DEVICE(0x0421, 0x069a) } /* Nokia 130 (RM-1035) */ +DEVICE(nokia, NOKIA_IDS); + /* Novatel Wireless GPS driver */ #define NOVATEL_IDS() \ { USB_DEVICE(0x09d7, 0x0100) } /* NovAtel FlexPack GPS */ @@ -126,6 +131,7 @@ static struct usb_serial_driver * const &vivopay_device, &moto_modem_device, &motorola_tetra_device, + &nokia_device, &novatel_gps_device, &hp4x_device, &suunto_device, @@ -143,6 +149,7 @@ static const struct usb_device_id id_tab VIVOPAY_IDS(), MOTO_IDS(), MOTOROLA_TETRA_IDS(), + NOKIA_IDS(), NOVATEL_IDS(), HP4X_IDS(), SUUNTO_IDS(), From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B379C3525B for ; Mon, 18 Apr 2022 13:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240797AbiDRNeq (ORCPT ); Mon, 18 Apr 2022 09:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242275AbiDRNIz (ORCPT ); Mon, 18 Apr 2022 09:08:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7784A3525B; Mon, 18 Apr 2022 05:48:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 076106128A; Mon, 18 Apr 2022 12:48:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3DC3C385A7; Mon, 18 Apr 2022 12:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286104; bh=eKsyNOgDgUbv/IxsbppHvlC2vjtNL19xnUQ72S2luC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wSKW66Sl02sksyfDJ8are+diEnkMgQVugNkrKpXeX3XktmnDleAhwOqf7doueEEsY 5nUDwjZvjOCUOjGtjFbU505GDnK/wwto1ZghA95pzAJR4asEQujIY4lmOMAmXqcUap IRxv6p89417PR+yCQ2yvS5O9lqSGOzoe7SGUPPc4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yajun Deng , "David S. Miller" , Pavel Machek Subject: [PATCH 4.14 003/284] netdevice: add the case if dev is NULL Date: Mon, 18 Apr 2022 14:09:44 +0200 Message-Id: <20220418121210.791317858@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Yajun Deng commit b37a466837393af72fe8bcb8f1436410f3f173f3 upstream. Add the case if dev is NULL in dev_{put, hold}, so the caller doesn't need to care whether dev is NULL or not. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller Cc: Pavel Machek Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- include/linux/netdevice.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3378,7 +3378,8 @@ void netdev_run_todo(void); */ static inline void dev_put(struct net_device *dev) { - this_cpu_dec(*dev->pcpu_refcnt); + if (dev) + this_cpu_dec(*dev->pcpu_refcnt); } =20 /** @@ -3389,7 +3390,8 @@ static inline void dev_put(struct net_de */ static inline void dev_hold(struct net_device *dev) { - this_cpu_inc(*dev->pcpu_refcnt); + if (dev) + this_cpu_inc(*dev->pcpu_refcnt); } =20 /* Carrier loss detection, dial on demand. The functions netif_carrier_on From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB4E3C433F5 for ; Mon, 18 Apr 2022 13:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242589AbiDRNfU (ORCPT ); Mon, 18 Apr 2022 09:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242736AbiDRNJZ (ORCPT ); Mon, 18 Apr 2022 09:09:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA75536333; Mon, 18 Apr 2022 05:48:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D404F6124A; Mon, 18 Apr 2022 12:48:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD619C385A1; Mon, 18 Apr 2022 12:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286131; bh=pbmnvJMpAqebIetUAqMQen3WmrQy0z43KJeIZmjeLA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B0QQvd1Fu7t/wWCaQZstufk384vwW7hIvovbYzCAfvABSRnIO6UXBq/XV9JgHI+Qi FhXqyQlwDnoVrf5dJPQ8jsJk+AW43pIrqzGXyCqVnlU7dItWBcwVCewW9f1Ea6dzYb uxEwJABpZqJk0OUR/CwwFg3MdaAmhMDEEG8jb7Gg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Michael S. Tsirkin" , Sasha Levin Subject: [PATCH 4.14 004/284] virtio_console: break out of buf poll on remove Date: Mon, 18 Apr 2022 14:09:45 +0200 Message-Id: <20220418121210.819571886@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Michael S. Tsirkin [ Upstream commit 0e7174b9d5877130fec41fb4a16e0c2ee4958d44 ] A common pattern for device reset is currently: vdev->config->reset(vdev); .. cleanup .. reset prevents new interrupts from arriving and waits for interrupt handlers to finish. However if - as is common - the handler queues a work request which is flushed during the cleanup stage, we have code adding buffers / trying to get buffers while device is reset. Not good. This was reproduced by running modprobe virtio_console modprobe -r virtio_console in a loop. Fix this up by calling virtio_break_device + flush before reset. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=3D1786239 Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/char/virtio_console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 0fb3a8e62e62..2140d401523f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -2001,6 +2001,13 @@ static void virtcons_remove(struct virtio_device *vd= ev) list_del(&portdev->list); spin_unlock_irq(&pdrvdata_lock); =20 + /* Device is going away, exit any polling for buffers */ + virtio_break_device(vdev); + if (use_multiport(portdev)) + flush_work(&portdev->control_work); + else + flush_work(&portdev->config_work); + /* Disable interrupts for vqs */ vdev->config->reset(vdev); /* Finish up work that's lined up */ --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B94ADC433EF for ; Mon, 18 Apr 2022 13:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242275AbiDRNfr (ORCPT ); Mon, 18 Apr 2022 09:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242824AbiDRNJ3 (ORCPT ); Mon, 18 Apr 2022 09:09:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370F4369ED; Mon, 18 Apr 2022 05:49:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3377F61259; Mon, 18 Apr 2022 12:48:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1D50C385A8; Mon, 18 Apr 2022 12:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286134; bh=m010D5kfjHCZrOKrDHaOt/zruGT7jWSVi3xsW6bm/1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHPHmsEUL3AIZ9jjrWDcWE1/myKT/fJ4fEJ7YvIKN9iAPiXsWgG/4je8Sct6KBS+K S8YSHn3np8yJ8zYaUvcirxtl2jTL1+AXcQwLaOW8R742dpu53BmPGVWIi7gmTx9z/K e1JLKEio6/v2v0mtvIAs63kTAlQVBJdvKnsGVbJI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 005/284] ethernet: sun: Free the coherent when failing in probing Date: Mon, 18 Apr 2022 14:09:46 +0200 Message-Id: <20220418121210.849128396@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Zheyu Ma [ Upstream commit bb77bd31c281f70ec77c9c4f584950a779e05cf8 ] When the driver fails to register net device, it should free the DMA region first, and then do other cleanup. Signed-off-by: Zheyu Ma Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/ethernet/sun/sunhme.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/s= unhme.c index 9e983e1d8249..7522f277e912 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -3165,7 +3165,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, if (err) { printk(KERN_ERR "happymeal(PCI): Cannot register net device, " "aborting.\n"); - goto err_out_iounmap; + goto err_out_free_coherent; } =20 pci_set_drvdata(pdev, hp); @@ -3198,6 +3198,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, =20 return 0; =20 +err_out_free_coherent: + dma_free_coherent(hp->dma_dev, PAGE_SIZE, + hp->happy_block, hp->hblock_dvma); + err_out_iounmap: iounmap(hp->gregs); =20 --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35836C433F5 for ; Mon, 18 Apr 2022 13:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243197AbiDRNku (ORCPT ); Mon, 18 Apr 2022 09:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242957AbiDRNJn (ORCPT ); Mon, 18 Apr 2022 09:09:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E5336E0A; Mon, 18 Apr 2022 05:49:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 000BEB80EDC; Mon, 18 Apr 2022 12:48:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48446C385A7; Mon, 18 Apr 2022 12:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286137; bh=Y5zWl7U5Otlds0oDof3do24rzGWPA9Fl6NP3DV3Vw0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nMLT+r96lgd9AJru7MM44iI1IboT0IkPEQH1xb6Q913pQSoLhbANB1AKh9GdJpcj1 N/wkFwzP05QCyjZzP0UBUmDzRfsZaU9QmW+52uh4lM85KrEaSsflnF4XJg73Bfr2VZ 4QZvHWQbitZk45/3EIZiNwgC/GIZdrh/GN8e7DkI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Biju Das , Lad Prabhakar , Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 4.14 006/284] spi: Fix invalid sgs value Date: Mon, 18 Apr 2022 14:09:47 +0200 Message-Id: <20220418121210.877635778@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Biju Das [ Upstream commit 1a4e53d2fc4f68aa654ad96d13ad042e1a8e8a7d ] max_seg_size is unsigned int and it can have a value up to 2^32 (for eg:-RZ_DMAC driver sets dma_set_max_seg_size as U32_MAX) When this value is used in min_t() as an integer type, it becomes -1 and the value of sgs becomes 0. Fix this issue by replacing the 'int' data type with 'unsigned int' in min_t(). Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220307184843.9994-1-biju.das.jz@bp.renesa= s.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 71f74015efb9..d26aefed16ac 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -774,10 +774,10 @@ static int spi_map_buf(struct spi_controller *ctlr, s= truct device *dev, int i, ret; =20 if (vmalloced_buf || kmap_buf) { - desc_len =3D min_t(int, max_seg_size, PAGE_SIZE); + desc_len =3D min_t(unsigned int, max_seg_size, PAGE_SIZE); sgs =3D DIV_ROUND_UP(len + offset_in_page(buf), desc_len); } else if (virt_addr_valid(buf)) { - desc_len =3D min_t(int, max_seg_size, ctlr->max_dma_len); + desc_len =3D min_t(unsigned int, max_seg_size, ctlr->max_dma_len); sgs =3D DIV_ROUND_UP(len, desc_len); } else { return -EINVAL; --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44FCBC433EF for ; Mon, 18 Apr 2022 13:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241152AbiDRNfx (ORCPT ); Mon, 18 Apr 2022 09:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243074AbiDRNJs (ORCPT ); Mon, 18 Apr 2022 09:09:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 159BA2CCAC; Mon, 18 Apr 2022 05:49:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3E030B80E4E; Mon, 18 Apr 2022 12:49:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 537FEC385A7; Mon, 18 Apr 2022 12:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286141; bh=Mk1Iqrphq54417Wc0cBdCgN7loP8w3zoxuUin2+H7X0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgisBNabDwMPZgwaf3H3pXPMzkc9F2dHVb+2pYhl5jNd+CPqT8hN5p/Okg6XuCTd2 8TcNPk0Des+W54jrI7p5R/ZILrdByUXTh0cgWZ8Z7yVYy3/myJhWbOcSzK8Cd9T0GU bn0DGI4o0zchtZrssl0b+A5WaNQn1EYuhfwRCS7g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds , Geert Uytterhoeven , Biju Das , Lad Prabhakar , Mark Brown , Sasha Levin Subject: [PATCH 4.14 007/284] spi: Fix erroneous sgs value with min_t() Date: Mon, 18 Apr 2022 14:09:48 +0200 Message-Id: <20220418121210.905523230@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Biju Das [ Upstream commit ebc4cb43ea5ada3db46c80156fca58a54b9bbca8 ] While computing sgs in spi_map_buf(), the data type used in min_t() for max_seg_size is 'unsigned int' where as that of ctlr->max_dma_len is 'size_t'. min_t(unsigned int,x,y) gives wrong results if one of x/y is 'size_t' Consider the below examples on a 64-bit machine (ie size_t is 64-bits, and unsigned int is 32-bit). case 1) min_t(unsigned int, 5, 0x100000001); case 2) min_t(size_t, 5, 0x100000001); Case 1 returns '1', where as case 2 returns '5'. As you can see the result from case 1 is wrong. This patch fixes the above issue by using the data type of the parameters that are used in min_t with maximum data length. Fixes: commit 1a4e53d2fc4f68aa ("spi: Fix invalid sgs value") Reported-by: Linus Torvalds Suggested-by: Geert Uytterhoeven Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220316175317.465-1-biju.das.jz@bp.renesas= .com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index d26aefed16ac..1031c8e38144 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -774,10 +774,10 @@ static int spi_map_buf(struct spi_controller *ctlr, s= truct device *dev, int i, ret; =20 if (vmalloced_buf || kmap_buf) { - desc_len =3D min_t(unsigned int, max_seg_size, PAGE_SIZE); + desc_len =3D min_t(unsigned long, max_seg_size, PAGE_SIZE); sgs =3D DIV_ROUND_UP(len + offset_in_page(buf), desc_len); } else if (virt_addr_valid(buf)) { - desc_len =3D min_t(unsigned int, max_seg_size, ctlr->max_dma_len); + desc_len =3D min_t(size_t, max_seg_size, ctlr->max_dma_len); sgs =3D DIV_ROUND_UP(len, desc_len); } else { return -EINVAL; --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A716EC433F5 for ; Mon, 18 Apr 2022 13:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243441AbiDRNlP (ORCPT ); Mon, 18 Apr 2022 09:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242965AbiDRNJn (ORCPT ); Mon, 18 Apr 2022 09:09:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A424236E0B; Mon, 18 Apr 2022 05:49:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 75A08B80EE1; Mon, 18 Apr 2022 12:49:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC030C385A7; Mon, 18 Apr 2022 12:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286144; bh=K+tDWAFZJnPKREwEHMhg1Ie2OWCsnVXB7aQ07ZjAkp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o46xS19S1wp8QQxfxVEGWTuv+gPXGkUYy43/MUfVidbN/EP0J7vps0mPL4kAGYUXd 2IXAuhex//Ej+klpWaIhrmGBIIKOrYixv4H7isSNbmEKlf3BLX1qNIVR12nWMS9kZV JaNZtuqrc5c6DX6wTIHHeQdIIVxmJMxCTTPHWNHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, TCS Robot , Haimin Zhang , Steffen Klassert , Sasha Levin Subject: [PATCH 4.14 008/284] af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register Date: Mon, 18 Apr 2022 14:09:49 +0200 Message-Id: <20220418121210.933615085@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Haimin Zhang [ Upstream commit 9a564bccb78a76740ea9d75a259942df8143d02c ] Add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register to initialize the buffer of supp_skb to fix a kernel-info-leak issue. 1) Function pfkey_register calls compose_sadb_supported to request a sk_buff. 2) compose_sadb_supported calls alloc_sbk to allocate a sk_buff, but it doesn't zero it. 3) If auth_len is greater 0, then compose_sadb_supported treats the memory as a struct sadb_supported and begins to initialize. But it just initializes the field sadb_supported_len and field sadb_supported_exttype without field sadb_supported_reserved. Reported-by: TCS Robot Signed-off-by: Haimin Zhang Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- net/key/af_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index a10336cd7f97..9b3756aa7ca2 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1709,7 +1709,7 @@ static int pfkey_register(struct sock *sk, struct sk_= buff *skb, const struct sad =20 xfrm_probe_algs(); =20 - supp_skb =3D compose_sadb_supported(hdr, GFP_KERNEL); + supp_skb =3D compose_sadb_supported(hdr, GFP_KERNEL | __GFP_ZERO); if (!supp_skb) { if (hdr->sadb_msg_satype !=3D SADB_SATYPE_UNSPEC) pfk->registered &=3D ~(1<sadb_msg_satype); --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7B91C433EF for ; Mon, 18 Apr 2022 13:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243087AbiDRNkk (ORCPT ); Mon, 18 Apr 2022 09:40:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243010AbiDRNJq (ORCPT ); Mon, 18 Apr 2022 09:09:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E3B0369E7; Mon, 18 Apr 2022 05:49:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B3B1B80EC3; Mon, 18 Apr 2022 12:49:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9F5FC385A8; Mon, 18 Apr 2022 12:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286147; bh=z+MJ5BwcFYCOls5GqHWIzpBRgYQfepqqFTN/5M0j8+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQb8FyAGGxhP57sRA4LtmvnxKVfR10mKocN0+fr+dXDypo6iASRN6RfKeHXI1jIWu mmnQjYunUkaVDW8xHo0eMNE3Px0aG1XWR306cH07PTTl+qjJOTkv/jlLwA2pMSRqMH SRGKfnHyRHa9NBV8BHvU1nTFnFs11/DbJpTollXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jann Horn , Miklos Szeredi , Zach OKeefe Subject: [PATCH 4.14 009/284] fuse: fix pipe buffer lifetime for direct_io Date: Mon, 18 Apr 2022 14:09:50 +0200 Message-Id: <20220418121210.961307913@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miklos Szeredi commit 0c4bcfdecb1ac0967619ee7ff44871d93c08c909 upstream. In FOPEN_DIRECT_IO mode, fuse_file_write_iter() calls fuse_direct_write_iter(), which normally calls fuse_direct_io(), which then imports the write buffer with fuse_get_user_pages(), which uses iov_iter_get_pages() to grab references to userspace pages instead of actually copying memory. On the filesystem device side, these pages can then either be read to userspace (via fuse_dev_read()), or splice()d over into a pipe using fuse_dev_splice_read() as pipe buffers with &nosteal_pipe_buf_ops. This is wrong because after fuse_dev_do_read() unlocks the FUSE request, the userspace filesystem can mark the request as completed, causing write() to return. At that point, the userspace filesystem should no longer have access to the pipe buffer. Fix by copying pages coming from the user address space to new pipe buffers. Reported-by: Jann Horn Fixes: c3021629a0d8 ("fuse: support splice() reading from fuse device") Cc: Signed-off-by: Miklos Szeredi Signed-off-by: Zach O'Keefe Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- fs/fuse/dev.c | 12 +++++++++++- fs/fuse/file.c | 1 + fs/fuse/fuse_i.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -991,7 +991,17 @@ static int fuse_copy_page(struct fuse_co =20 while (count) { if (cs->write && cs->pipebufs && page) { - return fuse_ref_page(cs, page, offset, count); + /* + * Can't control lifetime of pipe buffers, so always + * copy user pages. + */ + if (cs->req->user_pages) { + err =3D fuse_copy_fill(cs); + if (err) + return err; + } else { + return fuse_ref_page(cs, page, offset, count); + } } else if (!cs->len) { if (cs->move_pages && page && offset =3D=3D 0 && count =3D=3D PAGE_SIZE) { --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1325,6 +1325,7 @@ static int fuse_get_user_pages(struct fu (PAGE_SIZE - ret) & (PAGE_SIZE - 1); } =20 + req->user_pages =3D true; if (write) req->in.argpages =3D 1; else --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -312,6 +312,8 @@ struct fuse_req { /** refcount */ refcount_t count; =20 + bool user_pages; + /** Unique ID for the interrupt request */ u64 intr_unique; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBA1AC47084 for ; Mon, 18 Apr 2022 13:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243185AbiDRNd3 (ORCPT ); Mon, 18 Apr 2022 09:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241206AbiDRNG6 (ORCPT ); Mon, 18 Apr 2022 09:06:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18ABF2A24F; Mon, 18 Apr 2022 05:47:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AA522B80D9C; Mon, 18 Apr 2022 12:47:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1881EC385A7; Mon, 18 Apr 2022 12:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286037; bh=n86Irt6Ow5UK4EEIJgdxAiIlt2DLWJLL3IAaDQDqQ20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRLIaXxod+ifU5i0LPJq9J8x+/+u/5elw0DTW/0jFAP5vTtInDG+u20Q0xc6hA/zk DN96RP3uMSmbOna91F6D3RCS8dWz1GOAEc8uL86+wn6oLy72tZVDXXnH6/YFFjW+1z TfvkmNKttciFc5ZP/l+SlCSzij1ipz34LD1oSUZM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gunthorpe , Lino Sanfilippo , Stefan Berger , Jason Gunthorpe , Jarkko Sakkinen Subject: [PATCH 4.14 010/284] tpm: fix reference counting for struct tpm_chip Date: Mon, 18 Apr 2022 14:09:51 +0200 Message-Id: <20220418121210.989763174@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Lino Sanfilippo commit 7e0438f83dc769465ee663bb5dcf8cc154940712 upstream. The following sequence of operations results in a refcount warning: 1. Open device /dev/tpmrm. 2. Remove module tpm_tis_spi. 3. Write a TPM command to the file descriptor opened at step 1. Reviewed-by: Jarkko Sakkinen Reviewed-by: Jason Gunthorpe Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Stefan Berger ------------[ cut here ]------------ WARNING: CPU: 3 PID: 1161 at lib/refcount.c:25 kobject_get+0xa0/0xa4 refcount_t: addition on 0; use-after-free. Modules linked in: tpm_tis_spi tpm_tis_core tpm mdio_bcm_unimac brcmfmac sha256_generic libsha256 sha256_arm hci_uart btbcm bluetooth cfg80211 vc4 brcmutil ecdh_generic ecc snd_soc_core crc32_arm_ce libaes raspberrypi_hwmon ac97_bus snd_pcm_dmaengine bcm2711_thermal snd_pcm snd_timer genet snd phy_generic soundcore [last unloaded: spi_bcm2835] CPU: 3 PID: 1161 Comm: hold_open Not tainted 5.10.0ls-main-dirty #2 Hardware name: BCM2711 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xc4/0xd8) [] (dump_stack) from [] (__warn+0x104/0x108) [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8) [] (warn_slowpath_fmt) from [] (kobject_get+0xa0/0xa4) [] (kobject_get) from [] (tpm_try_get_ops+0x14/0x54 [tp= m]) [] (tpm_try_get_ops [tpm]) from [] (tpm_common_write+0x= 38/0x60 [tpm]) [] (tpm_common_write [tpm]) from [] (vfs_write+0xc4/0x3= c0) [] (vfs_write) from [] (ksys_write+0x58/0xcc) [] (ksys_write) from [] (ret_fast_syscall+0x0/0x4c) Exception stack(0xc226bfa8 to 0xc226bff0) bfa0: 00000000 000105b4 00000003 beafe664 00000014 000000= 00 bfc0: 00000000 000105b4 000103f8 00000004 00000000 00000000 b6f9c000 beafe6= 84 bfe0: 0000006c beafe648 0001056c b6eb6944 ---[ end trace d4b8409def9b8b1f ]--- The reason for this warning is the attempt to get the chip->dev reference in tpm_common_write() although the reference counter is already zero. Since commit 8979b02aaf1d ("tpm: Fix reference count to main device") the extra reference used to prevent a premature zero counter is never taken, because the required TPM_CHIP_FLAG_TPM2 flag is never set. Fix this by moving the TPM 2 character device handling from tpm_chip_alloc() to tpm_add_char_device() which is called at a later point in time when the flag has been set in case of TPM2. Commit fdc915f7f719 ("tpm: expose spaces via a device link /dev/tpmrm") already introduced function tpm_devs_release() to release the extra reference but did not implement the required put on chip->devs that results in the call of this function. Fix this by putting chip->devs in tpm_chip_unregister(). Finally move the new implementation for the TPM 2 handling into a new function to avoid multiple checks for the TPM_CHIP_FLAG_TPM2 flag in the good case and error cases. Cc: stable@vger.kernel.org Fixes: fdc915f7f719 ("tpm: expose spaces via a device link /dev/tpmrm") Fixes: 8979b02aaf1d ("tpm: Fix reference count to main device") Co-developed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Lino Sanfilippo Tested-by: Stefan Berger Reviewed-by: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm-chip.c | 46 +++++------------------------ drivers/char/tpm/tpm.h | 2 + drivers/char/tpm/tpm2-space.c | 65 +++++++++++++++++++++++++++++++++++++= +++++ 3 files changed, 75 insertions(+), 38 deletions(-) --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -134,14 +134,6 @@ static void tpm_dev_release(struct devic kfree(chip); } =20 -static void tpm_devs_release(struct device *dev) -{ - struct tpm_chip *chip =3D container_of(dev, struct tpm_chip, devs); - - /* release the master device reference */ - put_device(&chip->dev); -} - /** * tpm_class_shutdown() - prepare the TPM device for loss of power. * @dev: device to which the chip is associated. @@ -205,7 +197,6 @@ struct tpm_chip *tpm_chip_alloc(struct d chip->dev_num =3D rc; =20 device_initialize(&chip->dev); - device_initialize(&chip->devs); =20 chip->dev.class =3D tpm_class; chip->dev.class->shutdown_pre =3D tpm_class_shutdown; @@ -213,39 +204,20 @@ struct tpm_chip *tpm_chip_alloc(struct d chip->dev.parent =3D pdev; chip->dev.groups =3D chip->groups; =20 - chip->devs.parent =3D pdev; - chip->devs.class =3D tpmrm_class; - chip->devs.release =3D tpm_devs_release; - /* get extra reference on main device to hold on - * behalf of devs. This holds the chip structure - * while cdevs is in use. The corresponding put - * is in the tpm_devs_release (TPM2 only) - */ - if (chip->flags & TPM_CHIP_FLAG_TPM2) - get_device(&chip->dev); - if (chip->dev_num =3D=3D 0) chip->dev.devt =3D MKDEV(MISC_MAJOR, TPM_MINOR); else chip->dev.devt =3D MKDEV(MAJOR(tpm_devt), chip->dev_num); =20 - chip->devs.devt =3D - MKDEV(MAJOR(tpm_devt), chip->dev_num + TPM_NUM_DEVICES); - rc =3D dev_set_name(&chip->dev, "tpm%d", chip->dev_num); if (rc) goto out; - rc =3D dev_set_name(&chip->devs, "tpmrm%d", chip->dev_num); - if (rc) - goto out; =20 if (!pdev) chip->flags |=3D TPM_CHIP_FLAG_VIRTUAL; =20 cdev_init(&chip->cdev, &tpm_fops); - cdev_init(&chip->cdevs, &tpmrm_fops); chip->cdev.owner =3D THIS_MODULE; - chip->cdevs.owner =3D THIS_MODULE; =20 rc =3D tpm2_init_space(&chip->work_space, TPM2_SPACE_BUFFER_SIZE); if (rc) { @@ -257,7 +229,6 @@ struct tpm_chip *tpm_chip_alloc(struct d return chip; =20 out: - put_device(&chip->devs); put_device(&chip->dev); return ERR_PTR(rc); } @@ -306,14 +277,9 @@ static int tpm_add_char_device(struct tp } =20 if (chip->flags & TPM_CHIP_FLAG_TPM2) { - rc =3D cdev_device_add(&chip->cdevs, &chip->devs); - if (rc) { - dev_err(&chip->devs, - "unable to cdev_device_add() %s, major %d, minor %d, err=3D%d\n", - dev_name(&chip->devs), MAJOR(chip->devs.devt), - MINOR(chip->devs.devt), rc); - return rc; - } + rc =3D tpm_devs_add(chip); + if (rc) + goto err_del_cdev; } =20 /* Make the chip available. */ @@ -321,6 +287,10 @@ static int tpm_add_char_device(struct tp idr_replace(&dev_nums_idr, chip, chip->dev_num); mutex_unlock(&idr_lock); =20 + return 0; + +err_del_cdev: + cdev_device_del(&chip->cdev, &chip->dev); return rc; } =20 @@ -449,7 +419,7 @@ void tpm_chip_unregister(struct tpm_chip tpm_del_legacy_sysfs(chip); tpm_bios_log_teardown(chip); if (chip->flags & TPM_CHIP_FLAG_TPM2) - cdev_device_del(&chip->cdevs, &chip->devs); + tpm_devs_remove(chip); tpm_del_char_device(chip); } EXPORT_SYMBOL_GPL(tpm_chip_unregister); --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -593,4 +593,6 @@ int tpm2_prepare_space(struct tpm_chip * u8 *cmd); int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc, u8 *buf, size_t *bufsiz); +int tpm_devs_add(struct tpm_chip *chip); +void tpm_devs_remove(struct tpm_chip *chip); #endif --- a/drivers/char/tpm/tpm2-space.c +++ b/drivers/char/tpm/tpm2-space.c @@ -540,3 +540,68 @@ int tpm2_commit_space(struct tpm_chip *c =20 return 0; } + +/* + * Put the reference to the main device. + */ +static void tpm_devs_release(struct device *dev) +{ + struct tpm_chip *chip =3D container_of(dev, struct tpm_chip, devs); + + /* release the master device reference */ + put_device(&chip->dev); +} + +/* + * Remove the device file for exposed TPM spaces and release the device + * reference. This may also release the reference to the master device. + */ +void tpm_devs_remove(struct tpm_chip *chip) +{ + cdev_device_del(&chip->cdevs, &chip->devs); + put_device(&chip->devs); +} + +/* + * Add a device file to expose TPM spaces. Also take a reference to the + * main device. + */ +int tpm_devs_add(struct tpm_chip *chip) +{ + int rc; + + device_initialize(&chip->devs); + chip->devs.parent =3D chip->dev.parent; + chip->devs.class =3D tpmrm_class; + + /* + * Get extra reference on main device to hold on behalf of devs. + * This holds the chip structure while cdevs is in use. The + * corresponding put is in the tpm_devs_release. + */ + get_device(&chip->dev); + chip->devs.release =3D tpm_devs_release; + chip->devs.devt =3D MKDEV(MAJOR(tpm_devt), chip->dev_num + TPM_NUM_DEVICE= S); + cdev_init(&chip->cdevs, &tpmrm_fops); + chip->cdevs.owner =3D THIS_MODULE; + + rc =3D dev_set_name(&chip->devs, "tpmrm%d", chip->dev_num); + if (rc) + goto err_put_devs; + + rc =3D cdev_device_add(&chip->cdevs, &chip->devs); + if (rc) { + dev_err(&chip->devs, + "unable to cdev_device_add() %s, major %d, minor %d, err=3D%d\n", + dev_name(&chip->devs), MAJOR(chip->devs.devt), + MINOR(chip->devs.devt), rc); + goto err_put_devs; + } + + return 0; + +err_put_devs: + put_device(&chip->devs); + + return rc; +} From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C207C38A05 for ; Mon, 18 Apr 2022 13:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243480AbiDRNdx (ORCPT ); Mon, 18 Apr 2022 09:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241215AbiDRNG7 (ORCPT ); Mon, 18 Apr 2022 09:06:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0FEA2A254; Mon, 18 Apr 2022 05:47:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D4BE6101A; Mon, 18 Apr 2022 12:47:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48FEFC385A1; Mon, 18 Apr 2022 12:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286040; bh=bDq4CJx1GKP2PLiTe4/HEQW+6US9MEefoAoHfnXwjMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LYNJXzGGcW0VVR3BzgZ87GUrJrlUDIv56iNYMB+z3S4sP65ZWmsce7pInK1sLtNdO JksW+mT2I334I/OduF1SZvwbUXAK+kd4C+UWiW9iUgoyscvcwa0ohCB7I2RO75Abi8 j/SXBBWTp8D0sGTflukeug0kLBLj5ewINT6p6l74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xie Yongji , Jens Axboe , Lee Jones Subject: [PATCH 4.14 011/284] block: Add a helper to validate the block size Date: Mon, 18 Apr 2022 14:09:52 +0200 Message-Id: <20220418121211.018253515@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xie Yongji commit 570b1cac477643cbf01a45fa5d018430a1fddbce upstream. There are some duplicated codes to validate the block size in block drivers. This limitation actually comes from block layer, so this patch tries to add a new block layer helper for that. Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20211026144015.188-2-xieyongji@bytedance.com Signed-off-by: Jens Axboe Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- include/linux/blkdev.h | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -56,6 +56,14 @@ struct blk_stat_callback; */ #define BLKCG_MAX_POLS 3 =20 +static inline int blk_validate_block_size(unsigned int bsize) +{ + if (bsize < 512 || bsize > PAGE_SIZE || !is_power_of_2(bsize)) + return -EINVAL; + + return 0; +} + typedef void (rq_end_io_fn)(struct request *, blk_status_t); =20 #define BLK_RL_SYNCFULL (1U << 0) From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94289C43217 for ; Mon, 18 Apr 2022 13:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243521AbiDRNd7 (ORCPT ); Mon, 18 Apr 2022 09:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241235AbiDRNHA (ORCPT ); Mon, 18 Apr 2022 09:07:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6E722A26A; Mon, 18 Apr 2022 05:47:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 519B76124A; Mon, 18 Apr 2022 12:47:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59C67C385A1; Mon, 18 Apr 2022 12:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286043; bh=ErH+l6hXTN8Q0qGt8gkT3zRW+oYajTQEEk1rs7dX0yU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fyqZHoqrEMGGyn01GN4LT6+i5IyksFOss0N6U4QYtw9fmP9MWYFwkyoUbnmR8kSoD 5+52sqfFBAFUPf8Ayg8rIY7O+jw+qyoaTcy5DFuxC4UENE6tGy6444qnr/0/w86WCm BywUXoOlBodEDZIUisqGWS3IT/ykmmcyIDGVtx/k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xie Yongji , "Michael S. Tsirkin" , Jens Axboe , Lee Jones Subject: [PATCH 4.14 012/284] virtio-blk: Use blk_validate_block_size() to validate block size Date: Mon, 18 Apr 2022 14:09:53 +0200 Message-Id: <20220418121211.046677405@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xie Yongji commit 57a13a5b8157d9a8606490aaa1b805bafe6c37e1 upstream. The block layer can't support a block size larger than page size yet. And a block size that's too small or not a power of two won't work either. If a misconfigured device presents an invalid block size in configuration space, it will result in the kernel crash something like below: [ 506.154324] BUG: kernel NULL pointer dereference, address: 0000000000000= 008 [ 506.160416] RIP: 0010:create_empty_buffers+0x24/0x100 [ 506.174302] Call Trace: [ 506.174651] create_page_buffers+0x4d/0x60 [ 506.175207] block_read_full_page+0x50/0x380 [ 506.175798] ? __mod_lruvec_page_state+0x60/0xa0 [ 506.176412] ? __add_to_page_cache_locked+0x1b2/0x390 [ 506.177085] ? blkdev_direct_IO+0x4a0/0x4a0 [ 506.177644] ? scan_shadow_nodes+0x30/0x30 [ 506.178206] ? lru_cache_add+0x42/0x60 [ 506.178716] do_read_cache_page+0x695/0x740 [ 506.179278] ? read_part_sector+0xe0/0xe0 [ 506.179821] read_part_sector+0x36/0xe0 [ 506.180337] adfspart_check_ICS+0x32/0x320 [ 506.180890] ? snprintf+0x45/0x70 [ 506.181350] ? read_part_sector+0xe0/0xe0 [ 506.181906] bdev_disk_changed+0x229/0x5c0 [ 506.182483] blkdev_get_whole+0x6d/0x90 [ 506.183013] blkdev_get_by_dev+0x122/0x2d0 [ 506.183562] device_add_disk+0x39e/0x3c0 [ 506.184472] virtblk_probe+0x3f8/0x79b [virtio_blk] [ 506.185461] virtio_dev_probe+0x15e/0x1d0 [virtio] So let's use a block layer helper to validate the block size. Signed-off-by: Xie Yongji Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20211026144015.188-5-xieyongji@bytedance.com Signed-off-by: Jens Axboe Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/block/virtio_blk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -822,9 +822,17 @@ static int virtblk_probe(struct virtio_d err =3D virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE, struct virtio_blk_config, blk_size, &blk_size); - if (!err) + if (!err) { + err =3D blk_validate_block_size(blk_size); + if (err) { + dev_err(&vdev->dev, + "virtio_blk: invalid block size: 0x%x\n", + blk_size); + goto out_free_tags; + } + blk_queue_logical_block_size(q, blk_size); - else + } else blk_size =3D queue_logical_block_size(q); =20 /* Use topology information if available */ From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB6C7C47085 for ; Mon, 18 Apr 2022 13:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243591AbiDRNeH (ORCPT ); Mon, 18 Apr 2022 09:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241266AbiDRNHU (ORCPT ); Mon, 18 Apr 2022 09:07:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBCB2A713; Mon, 18 Apr 2022 05:47:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B590A61278; Mon, 18 Apr 2022 12:47:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DC0DC385A8; Mon, 18 Apr 2022 12:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286047; bh=CGfssEjC7zmIPfD+QZASWR8h/NdHiMkXVZizzvC22YM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nQ7Rs8n+2XRmrky2I0IVEWNk6Da2kgWnv4lWo3DTWnM2DVPfZDuPl2ZBVXZCp7r9b C7qP+AlbYgGSOwqmd8ILzac0QLm856+Qpq59BuWMDLAcR64HF7XGpofQX7GYQJ3zKL S9Mmhfhq+5snGXzYYqA+4MCplS0EXAe3iGzSQ7T0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern Subject: [PATCH 4.14 013/284] USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c Date: Mon, 18 Apr 2022 14:09:54 +0200 Message-Id: <20220418121211.075060084@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Alan Stern commit 1892bf90677abcad7f06e897e308f5c3e3618dd4 upstream. The kernel test robot found a problem with the ene_ub6250 subdriver in usb-storage: It uses structures containing bitfields to represent hardware bits in its SD_STATUS, MS_STATUS, and SM_STATUS bytes. This is not safe; it presumes a particular bit ordering and it assumes the compiler will not insert padding, neither of which is guaranteed. This patch fixes the problem by changing the structures to simple u8 values, with the bitfields replaced by bitmask constants. CC: Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YjOcbuU106UpJ/V8@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/usb/storage/ene_ub6250.c | 153 +++++++++++++++++++---------------= ----- 1 file changed, 75 insertions(+), 78 deletions(-) --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c @@ -251,36 +251,33 @@ static struct us_unusual_dev ene_ub6250_ #define memstick_logaddr(logadr1, logadr0) ((((u16)(logadr1)) << 8) | (log= adr0)) =20 =20 -struct SD_STATUS { - u8 Insert:1; - u8 Ready:1; - u8 MediaChange:1; - u8 IsMMC:1; - u8 HiCapacity:1; - u8 HiSpeed:1; - u8 WtP:1; - u8 Reserved:1; -}; - -struct MS_STATUS { - u8 Insert:1; - u8 Ready:1; - u8 MediaChange:1; - u8 IsMSPro:1; - u8 IsMSPHG:1; - u8 Reserved1:1; - u8 WtP:1; - u8 Reserved2:1; -}; - -struct SM_STATUS { - u8 Insert:1; - u8 Ready:1; - u8 MediaChange:1; - u8 Reserved:3; - u8 WtP:1; - u8 IsMS:1; -}; +/* SD_STATUS bits */ +#define SD_Insert BIT(0) +#define SD_Ready BIT(1) +#define SD_MediaChange BIT(2) +#define SD_IsMMC BIT(3) +#define SD_HiCapacity BIT(4) +#define SD_HiSpeed BIT(5) +#define SD_WtP BIT(6) + /* Bit 7 reserved */ + +/* MS_STATUS bits */ +#define MS_Insert BIT(0) +#define MS_Ready BIT(1) +#define MS_MediaChange BIT(2) +#define MS_IsMSPro BIT(3) +#define MS_IsMSPHG BIT(4) + /* Bit 5 reserved */ +#define MS_WtP BIT(6) + /* Bit 7 reserved */ + +/* SM_STATUS bits */ +#define SM_Insert BIT(0) +#define SM_Ready BIT(1) +#define SM_MediaChange BIT(2) + /* Bits 3-5 reserved */ +#define SM_WtP BIT(6) +#define SM_IsMS BIT(7) =20 struct ms_bootblock_cis { u8 bCistplDEVICE[6]; /* 0 */ @@ -451,9 +448,9 @@ struct ene_ub6250_info { u8 *bbuf; =20 /* for 6250 code */ - struct SD_STATUS SD_Status; - struct MS_STATUS MS_Status; - struct SM_STATUS SM_Status; + u8 SD_Status; + u8 MS_Status; + u8 SM_Status; =20 /* ----- SD Control Data ---------------- */ /*SD_REGISTER SD_Regs; */ @@ -616,7 +613,7 @@ static int sd_scsi_test_unit_ready(struc { struct ene_ub6250_info *info =3D (struct ene_ub6250_info *) us->extra; =20 - if (info->SD_Status.Insert && info->SD_Status.Ready) + if ((info->SD_Status & SD_Insert) && (info->SD_Status & SD_Ready)) return USB_STOR_TRANSPORT_GOOD; else { ene_sd_init(us); @@ -636,7 +633,7 @@ static int sd_scsi_mode_sense(struct us_ 0x0b, 0x00, 0x80, 0x08, 0x00, 0x00, 0x71, 0xc0, 0x00, 0x00, 0x02, 0x00 }; =20 - if (info->SD_Status.WtP) + if (info->SD_Status & SD_WtP) usb_stor_set_xfer_buf(mediaWP, 12, srb); else usb_stor_set_xfer_buf(mediaNoWP, 12, srb); @@ -655,9 +652,9 @@ static int sd_scsi_read_capacity(struct struct ene_ub6250_info *info =3D (struct ene_ub6250_info *) us->extra; =20 usb_stor_dbg(us, "sd_scsi_read_capacity\n"); - if (info->SD_Status.HiCapacity) { + if (info->SD_Status & SD_HiCapacity) { bl_len =3D 0x200; - if (info->SD_Status.IsMMC) + if (info->SD_Status & SD_IsMMC) bl_num =3D info->HC_C_SIZE-1; else bl_num =3D (info->HC_C_SIZE + 1) * 1024 - 1; @@ -707,7 +704,7 @@ static int sd_scsi_read(struct us_data * return USB_STOR_TRANSPORT_ERROR; } =20 - if (info->SD_Status.HiCapacity) + if (info->SD_Status & SD_HiCapacity) bnByte =3D bn; =20 /* set up the command wrapper */ @@ -747,7 +744,7 @@ static int sd_scsi_write(struct us_data return USB_STOR_TRANSPORT_ERROR; } =20 - if (info->SD_Status.HiCapacity) + if (info->SD_Status & SD_HiCapacity) bnByte =3D bn; =20 /* set up the command wrapper */ @@ -1461,7 +1458,7 @@ static int ms_scsi_test_unit_ready(struc struct ene_ub6250_info *info =3D (struct ene_ub6250_info *)(us->extra); =20 /* pr_info("MS_SCSI_Test_Unit_Ready\n"); */ - if (info->MS_Status.Insert && info->MS_Status.Ready) { + if ((info->MS_Status & MS_Insert) && (info->MS_Status & MS_Ready)) { return USB_STOR_TRANSPORT_GOOD; } else { ene_ms_init(us); @@ -1481,7 +1478,7 @@ static int ms_scsi_mode_sense(struct us_ 0x0b, 0x00, 0x80, 0x08, 0x00, 0x00, 0x71, 0xc0, 0x00, 0x00, 0x02, 0x00 }; =20 - if (info->MS_Status.WtP) + if (info->MS_Status & MS_WtP) usb_stor_set_xfer_buf(mediaWP, 12, srb); else usb_stor_set_xfer_buf(mediaNoWP, 12, srb); @@ -1500,7 +1497,7 @@ static int ms_scsi_read_capacity(struct =20 usb_stor_dbg(us, "ms_scsi_read_capacity\n"); bl_len =3D 0x200; - if (info->MS_Status.IsMSPro) + if (info->MS_Status & MS_IsMSPro) bl_num =3D info->MSP_TotalBlock - 1; else bl_num =3D info->MS_Lib.NumberOfLogBlock * info->MS_Lib.blockSize * 2 - = 1; @@ -1655,7 +1652,7 @@ static int ms_scsi_read(struct us_data * if (bn > info->bl_num) return USB_STOR_TRANSPORT_ERROR; =20 - if (info->MS_Status.IsMSPro) { + if (info->MS_Status & MS_IsMSPro) { result =3D ene_load_bincode(us, MSP_RW_PATTERN); if (result !=3D USB_STOR_XFER_GOOD) { usb_stor_dbg(us, "Load MPS RW pattern Fail !!\n"); @@ -1756,7 +1753,7 @@ static int ms_scsi_write(struct us_data if (bn > info->bl_num) return USB_STOR_TRANSPORT_ERROR; =20 - if (info->MS_Status.IsMSPro) { + if (info->MS_Status & MS_IsMSPro) { result =3D ene_load_bincode(us, MSP_RW_PATTERN); if (result !=3D USB_STOR_XFER_GOOD) { pr_info("Load MSP RW pattern Fail !!\n"); @@ -1864,12 +1861,12 @@ static int ene_get_card_status(struct us =20 tmpreg =3D (u16) reg4b; reg4b =3D *(u32 *)(&buf[0x14]); - if (info->SD_Status.HiCapacity && !info->SD_Status.IsMMC) + if ((info->SD_Status & SD_HiCapacity) && !(info->SD_Status & SD_IsMMC)) info->HC_C_SIZE =3D (reg4b >> 8) & 0x3fffff; =20 info->SD_C_SIZE =3D ((tmpreg & 0x03) << 10) | (u16)(reg4b >> 22); info->SD_C_SIZE_MULT =3D (u8)(reg4b >> 7) & 0x07; - if (info->SD_Status.HiCapacity && info->SD_Status.IsMMC) + if ((info->SD_Status & SD_HiCapacity) && (info->SD_Status & SD_IsMMC)) info->HC_C_SIZE =3D *(u32 *)(&buf[0x100]); =20 if (info->SD_READ_BL_LEN > SD_BLOCK_LEN) { @@ -2081,6 +2078,7 @@ static int ene_ms_init(struct us_data *u u16 MSP_BlockSize, MSP_UserAreaBlocks; struct ene_ub6250_info *info =3D (struct ene_ub6250_info *) us->extra; u8 *bbuf =3D info->bbuf; + unsigned int s; =20 printk(KERN_INFO "transport --- ENE_MSInit\n"); =20 @@ -2105,15 +2103,16 @@ static int ene_ms_init(struct us_data *u return USB_STOR_TRANSPORT_ERROR; } /* the same part to test ENE */ - info->MS_Status =3D *(struct MS_STATUS *) bbuf; + info->MS_Status =3D bbuf[0]; =20 - if (info->MS_Status.Insert && info->MS_Status.Ready) { - printk(KERN_INFO "Insert =3D %x\n", info->MS_Status.Insert); - printk(KERN_INFO "Ready =3D %x\n", info->MS_Status.Ready); - printk(KERN_INFO "IsMSPro =3D %x\n", info->MS_Status.IsMSPro); - printk(KERN_INFO "IsMSPHG =3D %x\n", info->MS_Status.IsMSPHG); - printk(KERN_INFO "WtP=3D %x\n", info->MS_Status.WtP); - if (info->MS_Status.IsMSPro) { + s =3D info->MS_Status; + if ((s & MS_Insert) && (s & MS_Ready)) { + printk(KERN_INFO "Insert =3D %x\n", !!(s & MS_Insert)); + printk(KERN_INFO "Ready =3D %x\n", !!(s & MS_Ready)); + printk(KERN_INFO "IsMSPro =3D %x\n", !!(s & MS_IsMSPro)); + printk(KERN_INFO "IsMSPHG =3D %x\n", !!(s & MS_IsMSPHG)); + printk(KERN_INFO "WtP=3D %x\n", !!(s & MS_WtP)); + if (s & MS_IsMSPro) { MSP_BlockSize =3D (bbuf[6] << 8) | bbuf[7]; MSP_UserAreaBlocks =3D (bbuf[10] << 8) | bbuf[11]; info->MSP_TotalBlock =3D MSP_BlockSize * MSP_UserAreaBlocks; @@ -2174,17 +2173,17 @@ static int ene_sd_init(struct us_data *u return USB_STOR_TRANSPORT_ERROR; } =20 - info->SD_Status =3D *(struct SD_STATUS *) bbuf; - if (info->SD_Status.Insert && info->SD_Status.Ready) { - struct SD_STATUS *s =3D &info->SD_Status; + info->SD_Status =3D bbuf[0]; + if ((info->SD_Status & SD_Insert) && (info->SD_Status & SD_Ready)) { + unsigned int s =3D info->SD_Status; =20 ene_get_card_status(us, bbuf); - usb_stor_dbg(us, "Insert =3D %x\n", s->Insert); - usb_stor_dbg(us, "Ready =3D %x\n", s->Ready); - usb_stor_dbg(us, "IsMMC =3D %x\n", s->IsMMC); - usb_stor_dbg(us, "HiCapacity =3D %x\n", s->HiCapacity); - usb_stor_dbg(us, "HiSpeed =3D %x\n", s->HiSpeed); - usb_stor_dbg(us, "WtP =3D %x\n", s->WtP); + usb_stor_dbg(us, "Insert =3D %x\n", !!(s & SD_Insert)); + usb_stor_dbg(us, "Ready =3D %x\n", !!(s & SD_Ready)); + usb_stor_dbg(us, "IsMMC =3D %x\n", !!(s & SD_IsMMC)); + usb_stor_dbg(us, "HiCapacity =3D %x\n", !!(s & SD_HiCapacity)); + usb_stor_dbg(us, "HiSpeed =3D %x\n", !!(s & SD_HiSpeed)); + usb_stor_dbg(us, "WtP =3D %x\n", !!(s & SD_WtP)); } else { usb_stor_dbg(us, "SD Card Not Ready --- %x\n", bbuf[0]); return USB_STOR_TRANSPORT_ERROR; @@ -2206,14 +2205,14 @@ static int ene_init(struct us_data *us) =20 misc_reg03 =3D bbuf[0]; if (misc_reg03 & 0x01) { - if (!info->SD_Status.Ready) { + if (!(info->SD_Status & SD_Ready)) { result =3D ene_sd_init(us); if (result !=3D USB_STOR_XFER_GOOD) return USB_STOR_TRANSPORT_ERROR; } } if (misc_reg03 & 0x02) { - if (!info->MS_Status.Ready) { + if (!(info->MS_Status & MS_Ready)) { result =3D ene_ms_init(us); if (result !=3D USB_STOR_XFER_GOOD) return USB_STOR_TRANSPORT_ERROR; @@ -2312,14 +2311,14 @@ static int ene_transport(struct scsi_cmn =20 /*US_DEBUG(usb_stor_show_command(us, srb)); */ scsi_set_resid(srb, 0); - if (unlikely(!(info->SD_Status.Ready || info->MS_Status.Ready))) + if (unlikely(!(info->SD_Status & SD_Ready) || (info->MS_Status & MS_Ready= ))) result =3D ene_init(us); if (result =3D=3D USB_STOR_XFER_GOOD) { result =3D USB_STOR_TRANSPORT_ERROR; - if (info->SD_Status.Ready) + if (info->SD_Status & SD_Ready) result =3D sd_scsi_irp(us, srb); =20 - if (info->MS_Status.Ready) + if (info->MS_Status & MS_Ready) result =3D ms_scsi_irp(us, srb); } return result; @@ -2383,7 +2382,6 @@ static int ene_ub6250_probe(struct usb_i =20 static int ene_ub6250_resume(struct usb_interface *iface) { - u8 tmp =3D 0; struct us_data *us =3D usb_get_intfdata(iface); struct ene_ub6250_info *info =3D (struct ene_ub6250_info *)(us->extra); =20 @@ -2395,17 +2393,16 @@ static int ene_ub6250_resume(struct usb_ mutex_unlock(&us->dev_mutex); =20 info->Power_IsResum =3D true; - /*info->SD_Status.Ready =3D 0; */ - info->SD_Status =3D *(struct SD_STATUS *)&tmp; - info->MS_Status =3D *(struct MS_STATUS *)&tmp; - info->SM_Status =3D *(struct SM_STATUS *)&tmp; + /* info->SD_Status &=3D ~SD_Ready; */ + info->SD_Status =3D 0; + info->MS_Status =3D 0; + info->SM_Status =3D 0; =20 return 0; } =20 static int ene_ub6250_reset_resume(struct usb_interface *iface) { - u8 tmp =3D 0; struct us_data *us =3D usb_get_intfdata(iface); struct ene_ub6250_info *info =3D (struct ene_ub6250_info *)(us->extra); =20 @@ -2417,10 +2414,10 @@ static int ene_ub6250_reset_resume(struc * the device */ info->Power_IsResum =3D true; - /*info->SD_Status.Ready =3D 0; */ - info->SD_Status =3D *(struct SD_STATUS *)&tmp; - info->MS_Status =3D *(struct MS_STATUS *)&tmp; - info->SM_Status =3D *(struct SM_STATUS *)&tmp; + /* info->SD_Status &=3D ~SD_Ready; */ + info->SD_Status =3D 0; + info->MS_Status =3D 0; + info->SM_Status =3D 0; =20 return 0; } From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C76BFC43219 for ; Mon, 18 Apr 2022 13:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243629AbiDRNeL (ORCPT ); Mon, 18 Apr 2022 09:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241290AbiDRNH2 (ORCPT ); Mon, 18 Apr 2022 09:07:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 763CF2A738; Mon, 18 Apr 2022 05:47:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E41F661253; Mon, 18 Apr 2022 12:47:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE3E3C385A8; Mon, 18 Apr 2022 12:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286050; bh=4bSNL2HCuVxfuFYn5tC2mBPJ2xyv9VI4fvWzI2d5KBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QpE+Q7OSvEZmMfaySajf4qijKu0Avo5xLe52XCZ5dpvBUB7Zi00DUhx0XhWCGWT3+ Mw2zNRTbyEYplcxaptJvljm2QysOYXslQg1m1hiAZT6urIfXerICsVG7Bk8Rat9Q7o Jt1KGmLr2FNdaa5Bm1xoXnFbVq0dXDp6wuSbTjJA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Clark , Mike Leach , Mathieu Poirier , Suzuki K Poulose Subject: [PATCH 4.14 014/284] coresight: Fix TRCCONFIGR.QE sysfs interface Date: Mon, 18 Apr 2022 14:09:55 +0200 Message-Id: <20220418121211.103547244@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: James Clark commit ea75a342aed5ed72c87f38fbe0df2f5df7eae374 upstream. It's impossible to program a valid value for TRCCONFIGR.QE when TRCIDR0.QSUPP=3D=3D0b10. In that case the following is true: Q element support is implemented, and only supports Q elements without instruction counts. TRCCONFIGR.QE can only take the values 0b00 or 0b11. Currently the low bit of QSUPP is checked to see if the low bit of QE can be written to, but as you can see when QSUPP=3D=3D0b10 the low bit is clear= ed making it impossible to ever write the only valid value of 0b11 to QE. 0b10 would be written instead, which is a reserved QE value even for all values of QSUPP. The fix is to allow writing the low bit of QE for any non zero value of QSUPP. This change also ensures that the low bit is always set, even when the user attempts to only set the high bit. Signed-off-by: James Clark Reviewed-by: Mike Leach Fixes: d8c66962084f ("coresight-etm4x: Controls pertaining to the reset, mo= de, pe and events") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220120113047.2839622-2-james.clark@arm.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -379,8 +379,12 @@ static ssize_t mode_store(struct device mode =3D ETM_MODE_QELEM(config->mode); /* start by clearing QE bits */ config->cfg &=3D ~(BIT(13) | BIT(14)); - /* if supported, Q elements with instruction counts are enabled */ - if ((mode & BIT(0)) && (drvdata->q_support & BIT(0))) + /* + * if supported, Q elements with instruction counts are enabled. + * Always set the low bit for any requested mode. Valid combos are + * 0b00, 0b01 and 0b11. + */ + if (mode && drvdata->q_support) config->cfg |=3D BIT(13); /* * if supported, Q elements with and without instruction From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8171C38A2B for ; Mon, 18 Apr 2022 13:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243688AbiDRNeN (ORCPT ); Mon, 18 Apr 2022 09:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241391AbiDRNHw (ORCPT ); Mon, 18 Apr 2022 09:07:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA1392AC66; Mon, 18 Apr 2022 05:47:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 329FE6124A; Mon, 18 Apr 2022 12:47:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 406A5C385A7; Mon, 18 Apr 2022 12:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286053; bh=iPfEOOaZY6SngMtkH2EjLZFnoqkLvslAt+rH43/wWIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=psHjd+DMRGpDidX3kq8vcxoXBqXWOJ/3d1R318lG/gpl0mhoMMzgnQjQUQ67XYW64 fPvPI/k6fwXOgTlcAHQ/lj+RI3BrH24zijjmLsozxWXGcBCTNY2qJ36Od/lCz6mzSY usH0T68aGZA4WVd7zEMf4riX1daFX7UOjWGzvKD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liam Beguin , Peter Rosin , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.14 015/284] iio: inkern: apply consumer scale on IIO_VAL_INT cases Date: Mon, 18 Apr 2022 14:09:56 +0200 Message-Id: <20220418121211.131642179@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liam Beguin commit 1bca97ff95c732a516ebb68da72814194980e0a5 upstream. When a consumer calls iio_read_channel_processed() and the channel has an integer scale, the scale channel scale is applied and the processed value is returned as expected. On the other hand, if the consumer calls iio_convert_raw_to_processed() the scaling factor requested by the consumer is not applied. This for example causes the consumer to process mV when expecting uV. Make sure to always apply the scaling factor requested by the consumer. Fixes: 48e44ce0f881 ("iio:inkern: Add function to read the processed value") Signed-off-by: Liam Beguin Reviewed-by: Peter Rosin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220108205319.2046348-2-liambeguin@gmail.c= om Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/iio/inkern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -612,7 +612,7 @@ static int iio_convert_raw_to_processed_ =20 switch (scale_type) { case IIO_VAL_INT: - *processed =3D raw64 * scale_val; + *processed =3D raw64 * scale_val * scale; break; case IIO_VAL_INT_PLUS_MICRO: if (scale_val2 < 0) From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D370DC4332F for ; Mon, 18 Apr 2022 13:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243944AbiDRNnC (ORCPT ); Mon, 18 Apr 2022 09:43:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241457AbiDRNH6 (ORCPT ); Mon, 18 Apr 2022 09:07:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 200402AE29; Mon, 18 Apr 2022 05:47:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3419161253; Mon, 18 Apr 2022 12:47:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43BCCC385A1; Mon, 18 Apr 2022 12:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286056; bh=7kX7CnvluiWbJU3rkOnN9B/tJ1K7lAW9rQihbi123BI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dz8W+l8AD3iJmvHm2wxnROmgzhrp5J1GXtUochxruuYfnKOUk2Ka+bbLDABqfWTLY sMTfl/JuLnbl3hIrnYjww1rTlfPWnNMYsSO9l42FnAKuAwxJVHsLVybJurwppDoJlF nWdXYUvfa7EREr6h5iutTdxxCoBIh8hNPvfcU34U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liam Beguin , Peter Rosin , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.14 016/284] iio: inkern: apply consumer scale when no channel scale is available Date: Mon, 18 Apr 2022 14:09:57 +0200 Message-Id: <20220418121211.159619760@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liam Beguin commit 14b457fdde38de594a4bc4bd9075019319d978da upstream. When a consumer calls iio_read_channel_processed() and no channel scale is available, it's assumed that the scale is one and the raw value is returned as expected. On the other hand, if the consumer calls iio_convert_raw_to_processed() the scaling factor requested by the consumer is not applied. This for example causes the consumer to process mV when expecting uV. Make sure to always apply the scaling factor requested by the consumer. Fixes: adc8ec5ff183 ("iio: inkern: pass through raw values if no scaling") Signed-off-by: Liam Beguin Reviewed-by: Peter Rosin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220108205319.2046348-3-liambeguin@gmail.c= om Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/iio/inkern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -603,10 +603,10 @@ static int iio_convert_raw_to_processed_ IIO_CHAN_INFO_SCALE); if (scale_type < 0) { /* - * Just pass raw values as processed if no scaling is - * available. + * If no channel scaling is available apply consumer scale to + * raw value and return. */ - *processed =3D raw; + *processed =3D raw * scale; return 0; } From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE158C433FE for ; Mon, 18 Apr 2022 13:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243615AbiDRNmt (ORCPT ); Mon, 18 Apr 2022 09:42:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241517AbiDRNIB (ORCPT ); Mon, 18 Apr 2022 09:08:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52B792AE31; Mon, 18 Apr 2022 05:47:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0848DB80EC0; Mon, 18 Apr 2022 12:47:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CF3FC385A1; Mon, 18 Apr 2022 12:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286059; bh=lFCP5nzLeSmkOcqS5XILgFyL0/GQwVTVtYdNABHyz08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEgSArJLZclO4u5KpkB0AtYDZpoeS8QKqsNaggox764VLWu6zHyClPU9KYdIo94PU 6jL+nBaNz0GnZtEMO3Y9M+6uk+OJ6AmEnqZfcG2pikYprSer5W2mu6JYzQ292p6QsK KLEK4vqx1J+gzibU/Bsi+JG+VMqoUsMohe0rpxWY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liam Beguin , Peter Rosin , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.14 017/284] iio: inkern: make a best effort on offset calculation Date: Mon, 18 Apr 2022 14:09:58 +0200 Message-Id: <20220418121211.187957179@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liam Beguin commit ca85123354e1a65a22170286387b4791997fe864 upstream. iio_convert_raw_to_processed_unlocked() assumes the offset is an integer. Make a best effort to get a valid offset value for fractional cases without breaking implicit truncations. Fixes: 48e44ce0f881 ("iio:inkern: Add function to read the processed value") Signed-off-by: Liam Beguin Reviewed-by: Peter Rosin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220108205319.2046348-4-liambeguin@gmail.c= om Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/iio/inkern.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -591,13 +591,35 @@ EXPORT_SYMBOL_GPL(iio_read_channel_avera static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan, int raw, int *processed, unsigned int scale) { - int scale_type, scale_val, scale_val2, offset; + int scale_type, scale_val, scale_val2; + int offset_type, offset_val, offset_val2; s64 raw64 =3D raw; - int ret; =20 - ret =3D iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_OFFSET); - if (ret >=3D 0) - raw64 +=3D offset; + offset_type =3D iio_channel_read(chan, &offset_val, &offset_val2, + IIO_CHAN_INFO_OFFSET); + if (offset_type >=3D 0) { + switch (offset_type) { + case IIO_VAL_INT: + break; + case IIO_VAL_INT_PLUS_MICRO: + case IIO_VAL_INT_PLUS_NANO: + /* + * Both IIO_VAL_INT_PLUS_MICRO and IIO_VAL_INT_PLUS_NANO + * implicitely truncate the offset to it's integer form. + */ + break; + case IIO_VAL_FRACTIONAL: + offset_val /=3D offset_val2; + break; + case IIO_VAL_FRACTIONAL_LOG2: + offset_val >>=3D offset_val2; + break; + default: + return -EINVAL; + } + + raw64 +=3D offset_val; + } =20 scale_type =3D iio_channel_read(chan, &scale_val, &scale_val2, IIO_CHAN_INFO_SCALE); From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EF78C433F5 for ; Mon, 18 Apr 2022 13:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242909AbiDRNml (ORCPT ); Mon, 18 Apr 2022 09:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241533AbiDRNIC (ORCPT ); Mon, 18 Apr 2022 09:08:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D23172B1BA; Mon, 18 Apr 2022 05:47:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6750461251; Mon, 18 Apr 2022 12:47:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6504BC385A7; Mon, 18 Apr 2022 12:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286062; bh=Hi+qGAM0+K6aRhN2ffkWQJ1vVgUzo9g09tmdPd5/DCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ySL21fj6H1k7yr0sbWl+7Ss+10QH1ly1TeDGGm0Q8anGO0CStPNw7QKQU5NXhsSzB IaSOUPvYDqvQ/wQwTc1hmnUprS28kqA758piTLyjCQrjw5DmEX80TANYlQwZO7gpKB PHyXNTs3mvo+oIs/Bb/WPtmvr8ZkvLWkB0byFbp0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kunihiko Hayashi , Stephen Boyd Subject: [PATCH 4.14 018/284] clk: uniphier: Fix fixed-rate initialization Date: Mon, 18 Apr 2022 14:09:59 +0200 Message-Id: <20220418121211.215907720@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kunihiko Hayashi commit ca85a66710a8a1f6b0719397225c3e9ee0abb692 upstream. Fixed-rate clocks in UniPhier don't have any parent clocks, however, initial data "init.flags" isn't initialized, so it might be determined that there is a parent clock for fixed-rate clock. This sets init.flags to zero as initialization. Cc: Fixes: 734d82f4a678 ("clk: uniphier: add core support code for UniPhier clo= ck driver") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1646808918-30899-1-git-send-email-hayashi.k= unihiko@socionext.com Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/clk/uniphier/clk-uniphier-fixed-rate.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/clk/uniphier/clk-uniphier-fixed-rate.c +++ b/drivers/clk/uniphier/clk-uniphier-fixed-rate.c @@ -33,6 +33,7 @@ struct clk_hw *uniphier_clk_register_fix =20 init.name =3D name; init.ops =3D &clk_fixed_rate_ops; + init.flags =3D 0; init.parent_names =3D NULL; init.num_parents =3D 0; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DB4FC47086 for ; Mon, 18 Apr 2022 13:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243741AbiDRNeR (ORCPT ); Mon, 18 Apr 2022 09:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241601AbiDRNIZ (ORCPT ); Mon, 18 Apr 2022 09:08:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A98421827; Mon, 18 Apr 2022 05:47:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 832FA6124A; Mon, 18 Apr 2022 12:47:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76BDFC385A7; Mon, 18 Apr 2022 12:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286065; bh=0EpLQqBQHjcTpSODKHXy71hIZ4eq3bpxMs0J0sqKlmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pxoe6HbxlLIdeEwGWUswFcDpFBqeuF9iOR5VSsujzqWCcM4QLtYzbBAeYtMFuoBZY SUTgaFJZvsPXwGfv/6aowBrSLPVclJNsRdkpSfo9Fadb+LTf26zWR0zgQunypWGGhm JH/Lqp2w/+LdpKPBxramBtrbMdx/A04elIqKzn84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Jann Horn , "Eric W. Biederman" Subject: [PATCH 4.14 019/284] ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE Date: Mon, 18 Apr 2022 14:10:00 +0200 Message-Id: <20220418121211.243931743@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jann Horn commit ee1fee900537b5d9560e9f937402de5ddc8412f3 upstream. Setting PTRACE_O_SUSPEND_SECCOMP is supposed to be a highly privileged operation because it allows the tracee to completely bypass all seccomp filters on kernels with CONFIG_CHECKPOINT_RESTORE=3Dy. It is only supposed = to be settable by a process with global CAP_SYS_ADMIN, and only if that process is not subject to any seccomp filters at all. However, while these permission checks were done on the PTRACE_SETOPTIONS path, they were missing on the PTRACE_SEIZE path, which also sets user-specified ptrace flags. Move the permissions checks out into a helper function and let both ptrace_attach() and ptrace_setoptions() call it. Cc: stable@kernel.org Fixes: 13c4a90119d2 ("seccomp: add ptrace options for suspend/resume") Signed-off-by: Jann Horn Link: https://lkml.kernel.org/r/20220319010838.1386861-1-jannh@google.com Signed-off-by: Eric W. Biederman Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- kernel/ptrace.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -370,6 +370,26 @@ bool ptrace_may_access(struct task_struc return !err; } =20 +static int check_ptrace_options(unsigned long data) +{ + if (data & ~(unsigned long)PTRACE_O_MASK) + return -EINVAL; + + if (unlikely(data & PTRACE_O_SUSPEND_SECCOMP)) { + if (!IS_ENABLED(CONFIG_CHECKPOINT_RESTORE) || + !IS_ENABLED(CONFIG_SECCOMP)) + return -EINVAL; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + if (seccomp_mode(¤t->seccomp) !=3D SECCOMP_MODE_DISABLED || + current->ptrace & PT_SUSPEND_SECCOMP) + return -EPERM; + } + return 0; +} + static int ptrace_attach(struct task_struct *task, long request, unsigned long addr, unsigned long flags) @@ -381,8 +401,16 @@ static int ptrace_attach(struct task_str if (seize) { if (addr !=3D 0) goto out; + /* + * This duplicates the check in check_ptrace_options() because + * ptrace_attach() and ptrace_setoptions() have historically + * used different error codes for unknown ptrace options. + */ if (flags & ~(unsigned long)PTRACE_O_MASK) goto out; + retval =3D check_ptrace_options(flags); + if (retval) + return retval; flags =3D PT_PTRACED | PT_SEIZED | (flags << PT_OPT_FLAG_SHIFT); } else { flags =3D PT_PTRACED; @@ -655,22 +683,11 @@ int ptrace_writedata(struct task_struct static int ptrace_setoptions(struct task_struct *child, unsigned long data) { unsigned flags; + int ret; =20 - if (data & ~(unsigned long)PTRACE_O_MASK) - return -EINVAL; - - if (unlikely(data & PTRACE_O_SUSPEND_SECCOMP)) { - if (!IS_ENABLED(CONFIG_CHECKPOINT_RESTORE) || - !IS_ENABLED(CONFIG_SECCOMP)) - return -EINVAL; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - - if (seccomp_mode(¤t->seccomp) !=3D SECCOMP_MODE_DISABLED || - current->ptrace & PT_SUSPEND_SECCOMP) - return -EPERM; - } + ret =3D check_ptrace_options(data); + if (ret) + return ret; =20 /* Avoid intermediate state when all opts are cleared */ flags =3D child->ptrace; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32B82C433EF for ; Mon, 18 Apr 2022 13:43:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239366AbiDRNm1 (ORCPT ); Mon, 18 Apr 2022 09:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241689AbiDRNI3 (ORCPT ); Mon, 18 Apr 2022 09:08:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7599C2B27B; Mon, 18 Apr 2022 05:47:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2AF3CB80E4B; Mon, 18 Apr 2022 12:47:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D422C385A7; Mon, 18 Apr 2022 12:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286072; bh=hSjoxYGD0LqCdflEGlp2q8yQwCPWJI2u6IK7aPgXHWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yJ/wv0bQ3n6SvaqqklvFdwF9JqaBmbyQUrGe6/3yDT3nDx38BVAXHwLtO8kPxtsaK cdzYt/ZI/DHi0tJxL9oS8555NGBipXK6uG8oc67N3AjSQcbQp9zP+CkgpddMVw/HzP C0h1GFcR+SWjfTOyE3qWEMIq/ti6KkJqEn4WdliA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Levin , Jonathan Corbet , Bagas Sanjaya Subject: [PATCH 4.14 020/284] Documentation: add link to stable release candidate tree Date: Mon, 18 Apr 2022 14:10:01 +0200 Message-Id: <20220418121211.271650450@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bagas Sanjaya commit 587d39b260c4d090166314d64be70b1f6a26b0b5 upstream. There is also stable release candidate tree. Mention it, however with a warning that the tree is for testing purposes. Cc: Greg Kroah-Hartman Cc: Sasha Levin Cc: Jonathan Corbet Cc: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220314113329.485372-5-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- Documentation/process/stable-kernel-rules.rst | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/Documentation/process/stable-kernel-rules.rst +++ b/Documentation/process/stable-kernel-rules.rst @@ -173,6 +173,15 @@ Trees =20 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git =20 + - The release candidate of all stable kernel versions can be found at: + + https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stabl= e-rc.git/ + + .. warning:: + The -stable-rc tree is a snapshot in time of the stable-queue tree a= nd + will change frequently, hence will be rebased often. It should only = be + used for testing purposes (e.g. to be consumed by CI systems). + =20 Review committee ---------------- From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A2C1C47087 for ; Mon, 18 Apr 2022 13:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243859AbiDRNed (ORCPT ); Mon, 18 Apr 2022 09:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241690AbiDRNI3 (ORCPT ); Mon, 18 Apr 2022 09:08:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA3902BB10; Mon, 18 Apr 2022 05:47:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 76BFE6124A; Mon, 18 Apr 2022 12:47:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67303C385A7; Mon, 18 Apr 2022 12:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286075; bh=zhJ5U1YZxDlUhpAyqcBaDDvBQU/WxbXPrdfuwDDlr7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bFKi10us4LI2umGymyFPdfAv4iPpC9obFYtQtokpn00BYEb4iSLxxWVKhk/Y3rcze W5g8wbKo38LD3Xg+BbcnOhmpD3qX48T7F4+5Ypwj3whM6DSyn+1qDXIXBZmIP9jXCe 7W6hIAsKbW6fmayK+oV1MlingjGUQcurPCVrcEW4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Levin , Jonathan Corbet , Bagas Sanjaya Subject: [PATCH 4.14 021/284] Documentation: update stable tree link Date: Mon, 18 Apr 2022 14:10:02 +0200 Message-Id: <20220418121211.299972977@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bagas Sanjaya commit 555d44932c67e617d89bc13c81c7efac5b51fcfa upstream. The link to stable tree is redirected to https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git. Update accordingly. Cc: Greg Kroah-Hartman Cc: Sasha Levin Cc: Jonathan Corbet Cc: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220314113329.485372-6-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- Documentation/process/stable-kernel-rules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Documentation/process/stable-kernel-rules.rst +++ b/Documentation/process/stable-kernel-rules.rst @@ -171,7 +171,7 @@ Trees - The finalized and tagged releases of all stable kernels can be found in separate branches per version at: =20 - https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git + https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git =20 - The release candidate of all stable kernel versions can be found at: From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4983BC38A2C for ; Mon, 18 Apr 2022 13:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243804AbiDRNec (ORCPT ); Mon, 18 Apr 2022 09:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241707AbiDRNI3 (ORCPT ); Mon, 18 Apr 2022 09:08:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8DB42BB2E; Mon, 18 Apr 2022 05:47:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 859EE6101A; Mon, 18 Apr 2022 12:47:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A0C9C385B9; Mon, 18 Apr 2022 12:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286079; bh=amW2hFM92tvyuVZjGN5xY5lUXYySeaJjV+QHyK7Jlms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVEofAvA+qZkSKSP2Htd93gIBImNVH4YDB0x+GJCOjsBFZR4G4vwww0GWo1aU3Pe3 /ArckrUazXFwjqQbC3AuB+7yUAFp2FAbgXXBiCbYBnEw0wHcfPxcM8gr6+v/V49nFN d5tb+QE8ZieY5+S6S2bbKOjtqtZbkfXtoUFzPqco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Trond Myklebust Subject: [PATCH 4.14 022/284] SUNRPC: avoid race between mod_timer() and del_timer_sync() Date: Mon, 18 Apr 2022 14:10:03 +0200 Message-Id: <20220418121211.327937970@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: NeilBrown commit 3848e96edf4788f772d83990022fa7023a233d83 upstream. xprt_destory() claims XPRT_LOCKED and then calls del_timer_sync(). Both xprt_unlock_connect() and xprt_release() call ->release_xprt() which drops XPRT_LOCKED and *then* xprt_schedule_autodisconnect() which calls mod_timer(). This may result in mod_timer() being called *after* del_timer_sync(). When this happens, the timer may fire long after the xprt has been freed, and run_timer_softirq() will probably crash. The pairing of ->release_xprt() and xprt_schedule_autodisconnect() is always called under ->transport_lock. So if we take ->transport_lock to call del_timer_sync(), we can be sure that mod_timer() will run first (if it runs at all). Cc: stable@vger.kernel.org Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- net/sunrpc/xprt.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1520,7 +1520,14 @@ static void xprt_destroy(struct rpc_xprt */ wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_UNINTERRUPTIBLE); =20 + /* + * xprt_schedule_autodisconnect() can run after XPRT_LOCKED + * is cleared. We use ->transport_lock to ensure the mod_timer() + * can only run *before* del_time_sync(), never after. + */ + spin_lock(&xprt->transport_lock); del_timer_sync(&xprt->timer); + spin_unlock(&xprt->transport_lock); =20 /* * Destroy sockets etc from the system workqueue so they can From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE28BC433EF for ; Mon, 18 Apr 2022 13:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243802AbiDRNmU (ORCPT ); Mon, 18 Apr 2022 09:42:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241764AbiDRNIa (ORCPT ); Mon, 18 Apr 2022 09:08:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD3C72C114; Mon, 18 Apr 2022 05:48:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E5F6961256; Mon, 18 Apr 2022 12:48:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D491CC385A7; Mon, 18 Apr 2022 12:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286082; bh=TY6spYhMggnEkLYKEkBTsFgJaAlJwopjPFVTkWP82EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gKRhzPQbxfv6cEyWv+Iw8C0j3X/jt78/+xDFHZwetxlKb2pOCMlals4W/FXhJLqBc 3fPUy51DMu+P/7OlB+Rv9WnkA83F3vNl3+Ko5Nk4w9QD74oXym/BEkvVSlAeTb6VRx aSEaVL3OemAlSwkzWouj4gXJd416sY0k6Ee63x14= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chuck Lever Subject: [PATCH 4.14 023/284] NFSD: prevent underflow in nfssvc_decode_writeargs() Date: Mon, 18 Apr 2022 14:10:04 +0200 Message-Id: <20220418121211.356029123@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dan Carpenter commit 184416d4b98509fb4c3d8fc3d6dc1437896cc159 upstream. Smatch complains: fs/nfsd/nfsxdr.c:341 nfssvc_decode_writeargs() warn: no lower bound on 'args->len' Change the type to unsigned to prevent this issue. Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Signed-off-by: Chuck Lever Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- fs/nfsd/nfsproc.c | 2 +- fs/nfsd/xdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c @@ -227,7 +227,7 @@ nfsd_proc_write(struct svc_rqst *rqstp) __be32 nfserr; unsigned long cnt =3D argp->len; =20 - dprintk("nfsd: WRITE %s %d bytes at %d\n", + dprintk("nfsd: WRITE %s %u bytes at %d\n", SVCFH_fmt(&argp->fh), argp->len, argp->offset); =20 --- a/fs/nfsd/xdr.h +++ b/fs/nfsd/xdr.h @@ -33,7 +33,7 @@ struct nfsd_readargs { struct nfsd_writeargs { svc_fh fh; __u32 offset; - int len; + __u32 len; int vlen; }; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 612FEC433EF for ; Mon, 18 Apr 2022 13:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243256AbiDRNhd (ORCPT ); Mon, 18 Apr 2022 09:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241867AbiDRNIe (ORCPT ); Mon, 18 Apr 2022 09:08:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70E42C655; Mon, 18 Apr 2022 05:48:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2FE3961268; Mon, 18 Apr 2022 12:48:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24C6BC385A7; Mon, 18 Apr 2022 12:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286085; bh=q1vKdk3kHmzjciSUyf4Qz2XI3CxCsuIyWQCjFJhdjUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRmzWHVxW/MQ+YHgMGIShwiN50PuL8WByPkmhva/w6XNefmJ6TUXAx4Nmgfi///df tR/+yaBp7jeQfQcVG/X8B1GT4rJa4EqXSQg31yFDNwtPz6Pl4Jd3aWeg/LNiypb3r2 UcTnppXLx2xCXlpdP17WtqKZfP+pzMrszyGVIbk4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sam Protsenko , Chanho Park Subject: [PATCH 4.14 024/284] pinctrl: samsung: drop pin banks references on error paths Date: Mon, 18 Apr 2022 14:10:05 +0200 Message-Id: <20220418121211.384754947@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Krzysztof Kozlowski commit 50ebd19e3585b9792e994cfa8cbee8947fe06371 upstream. The driver iterates over its devicetree children with for_each_child_of_node() and stores for later found node pointer. This has to be put in error paths to avoid leak during re-probing. Fixes: ab663789d697 ("pinctrl: samsung: Match pin banks with their device n= odes") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Chanho Park Link: https://lore.kernel.org/r/20220111201426.326777-2-krzysztof.kozlowski= @canonical.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/pinctrl/samsung/pinctrl-samsung.c | 30 +++++++++++++++++++++++--= ----- 1 file changed, 23 insertions(+), 7 deletions(-) --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -975,6 +975,16 @@ samsung_pinctrl_get_soc_data_for_of_alia return &(of_data->ctrl[id]); } =20 +static void samsung_banks_of_node_put(struct samsung_pinctrl_drv_data *d) +{ + struct samsung_pin_bank *bank; + unsigned int i; + + bank =3D d->pin_banks; + for (i =3D 0; i < d->nr_banks; ++i, ++bank) + of_node_put(bank->of_node); +} + /* retrieve the soc specific data */ static const struct samsung_pin_ctrl * samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, @@ -1089,19 +1099,19 @@ static int samsung_pinctrl_probe(struct if (ctrl->retention_data) { drvdata->retention_ctrl =3D ctrl->retention_data->init(drvdata, ctrl->retention_data); - if (IS_ERR(drvdata->retention_ctrl)) - return PTR_ERR(drvdata->retention_ctrl); + if (IS_ERR(drvdata->retention_ctrl)) { + ret =3D PTR_ERR(drvdata->retention_ctrl); + goto err_put_banks; + } } =20 ret =3D samsung_pinctrl_register(pdev, drvdata); if (ret) - return ret; + goto err_put_banks; =20 ret =3D samsung_gpiolib_register(pdev, drvdata); - if (ret) { - samsung_pinctrl_unregister(pdev, drvdata); - return ret; - } + if (ret) + goto err_unregister; =20 if (ctrl->eint_gpio_init) ctrl->eint_gpio_init(drvdata); @@ -1111,6 +1121,12 @@ static int samsung_pinctrl_probe(struct platform_set_drvdata(pdev, drvdata); =20 return 0; + +err_unregister: + samsung_pinctrl_unregister(pdev, drvdata); +err_put_banks: + samsung_banks_of_node_put(drvdata); + return ret; } =20 /** From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70EFBC38A2D for ; Mon, 18 Apr 2022 13:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243884AbiDRNeg (ORCPT ); Mon, 18 Apr 2022 09:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241937AbiDRNIi (ORCPT ); Mon, 18 Apr 2022 09:08:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E910340F6; Mon, 18 Apr 2022 05:48:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6136961254; Mon, 18 Apr 2022 12:48:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D5CCC385A7; Mon, 18 Apr 2022 12:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286088; bh=A4b2a4onVwfZ3Z/PUXwNCCP2ru+RSO2yvt2SPsiVLO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vZUiAURXMoVqIk2BzNb69/bW+mXjHeNW8hOVboFrSsqIsRyfOjnxRevjUul2xYtmH sTtdacnpJUUVW2ah+lWNd/Dv2kBavLM01L2fNS+4NKd0RO+iBN132dPJwpHCsfQHXI KsSKsVG3jvLnqkUOoZh8gdnrDp8mTXH+2mLsSm1Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Haas , Hangyu Hua , Marc Kleine-Budde Subject: [PATCH 4.14 025/284] can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path Date: Mon, 18 Apr 2022 14:10:06 +0200 Message-Id: <20220418121211.412923013@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Hangyu Hua commit c70222752228a62135cee3409dccefd494a24646 upstream. There is no need to call dev_kfree_skb() when usb_submit_urb() fails beacause can_put_echo_skb() deletes the original skb and can_free_echo_skb() deletes the cloned skb. Link: https://lore.kernel.org/all/20220228083639.38183-1-hbh25y@gmail.com Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB i= nterface") Cc: stable@vger.kernel.org Cc: Sebastian Haas Signed-off-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/can/usb/ems_usb.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c @@ -834,7 +834,6 @@ static netdev_tx_t ems_usb_start_xmit(st =20 usb_unanchor_urb(urb); usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); - dev_kfree_skb(skb); =20 atomic_dec(&dev->active_tx_urbs); From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA17EC433F5 for ; Mon, 18 Apr 2022 13:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243744AbiDRNmG (ORCPT ); Mon, 18 Apr 2022 09:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241999AbiDRNIk (ORCPT ); Mon, 18 Apr 2022 09:08:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 972A3344F5; Mon, 18 Apr 2022 05:48:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EAA56B80D9C; Mon, 18 Apr 2022 12:48:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FEADC385A1; Mon, 18 Apr 2022 12:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286091; bh=UyDGyEQHkN4jo5VfUZ5gpnpySdseI/gx5qNUCF+oui0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnlGzATyNJDjuv/yQRunzIRh8IJZ9qFlR2H8Dk49M/+4rF/IsfTWEZVBPy2zEqWpf jPcy0i2hAAhGlqPtUHvvGiKz8vQqW+GPr6nbklm4S3GvG75xmv36czjSlFlcIVaBfx QFptBmXTAu6h14whB8aAse8QjbZoxGR4sF7cQHiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Baokun Li , Richard Weinberger Subject: [PATCH 4.14 026/284] jffs2: fix use-after-free in jffs2_clear_xattr_subsystem Date: Mon, 18 Apr 2022 14:10:07 +0200 Message-Id: <20220418121211.440524148@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Baokun Li commit 4c7c44ee1650677fbe89d86edbad9497b7679b5c upstream. When we mount a jffs2 image, assume that the first few blocks of the image are normal and contain at least one xattr-related inode, but the next block is abnormal. As a result, an error is returned in jffs2_scan_eraseblock(). jffs2_clear_xattr_subsystem() is then called in jffs2_build_filesystem() and then again in jffs2_do_fill_super(). Finally we can observe the following report: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BUG: KASAN: use-after-free in jffs2_clear_xattr_subsystem+0x95/0x6ac Read of size 8 at addr ffff8881243384e0 by task mount/719 Call Trace: dump_stack+0x115/0x16b jffs2_clear_xattr_subsystem+0x95/0x6ac jffs2_do_fill_super+0x84f/0xc30 jffs2_fill_super+0x2ea/0x4c0 mtd_get_sb+0x254/0x400 mtd_get_sb_by_nr+0x4f/0xd0 get_tree_mtd+0x498/0x840 jffs2_get_tree+0x25/0x30 vfs_get_tree+0x8d/0x2e0 path_mount+0x50f/0x1e50 do_mount+0x107/0x130 __se_sys_mount+0x1c5/0x2f0 __x64_sys_mount+0xc7/0x160 do_syscall_64+0x45/0x70 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Allocated by task 719: kasan_save_stack+0x23/0x60 __kasan_kmalloc.constprop.0+0x10b/0x120 kasan_slab_alloc+0x12/0x20 kmem_cache_alloc+0x1c0/0x870 jffs2_alloc_xattr_ref+0x2f/0xa0 jffs2_scan_medium.cold+0x3713/0x4794 jffs2_do_mount_fs.cold+0xa7/0x2253 jffs2_do_fill_super+0x383/0xc30 jffs2_fill_super+0x2ea/0x4c0 [...] Freed by task 719: kmem_cache_free+0xcc/0x7b0 jffs2_free_xattr_ref+0x78/0x98 jffs2_clear_xattr_subsystem+0xa1/0x6ac jffs2_do_mount_fs.cold+0x5e6/0x2253 jffs2_do_fill_super+0x383/0xc30 jffs2_fill_super+0x2ea/0x4c0 [...] The buggy address belongs to the object at ffff8881243384b8 which belongs to the cache jffs2_xattr_ref of size 48 The buggy address is located 40 bytes inside of 48-byte region [ffff8881243384b8, ffff8881243384e8) [...] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The triggering of the BUG is shown in the following stack: Reported-by: Hulk Robot Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing ----------------------------------------------------------- jffs2_fill_super jffs2_do_fill_super jffs2_do_mount_fs jffs2_build_filesystem jffs2_scan_medium jffs2_scan_eraseblock <--- ERROR jffs2_clear_xattr_subsystem <--- free jffs2_clear_xattr_subsystem <--- free again ----------------------------------------------------------- An error is returned in jffs2_do_mount_fs(). If the error is returned by jffs2_sum_init(), the jffs2_clear_xattr_subsystem() does not need to be executed. If the error is returned by jffs2_build_filesystem(), the jffs2_clear_xattr_subsystem() also does not need to be executed again. So move jffs2_clear_xattr_subsystem() from 'out_inohash' to 'out_root' to fix this UAF problem. Fixes: aa98d7cf59b5 ("[JFFS2][XATTR] XATTR support on JFFS2 (version. 5)") Cc: stable@vger.kernel.org Reported-by: Hulk Robot Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/jffs2/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -597,8 +597,8 @@ out_root: jffs2_free_ino_caches(c); jffs2_free_raw_node_refs(c); kvfree(c->blocks); - out_inohash: jffs2_clear_xattr_subsystem(c); + out_inohash: kfree(c->inocache_list); out_wbuf: jffs2_flash_cleanup(c); From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86F95C47088 for ; Mon, 18 Apr 2022 13:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243918AbiDRNek (ORCPT ); Mon, 18 Apr 2022 09:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242046AbiDRNIm (ORCPT ); Mon, 18 Apr 2022 09:08:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94FBB34652; Mon, 18 Apr 2022 05:48:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A527B80E44; Mon, 18 Apr 2022 12:48:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59B0BC385A1; Mon, 18 Apr 2022 12:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286094; bh=5IqUjJTSOJ5iA71G3v7PMy802c6wfxcw7Yd0aVsWReA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0O+PPTbAPz2fj6asuXTJbr9UZ7kSkOQrudWDMDSOCG+SPSOkvjJBZ1dHoEAaCSpI0 Hgle6NLTbcC+bn4SqVn++YnUgnTdYjtWwjR4hdPb87OaN2dlHsPTPBTx9GYO56Gt4B zpqpvEsvpRQYRe35nzQ49eqzBb4Nic2vhMh84Juw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baokun Li , Richard Weinberger Subject: [PATCH 4.14 027/284] jffs2: fix memory leak in jffs2_do_mount_fs Date: Mon, 18 Apr 2022 14:10:08 +0200 Message-Id: <20220418121211.468896417@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Baokun Li commit d051cef784de4d54835f6b6836d98a8f6935772c upstream. If jffs2_build_filesystem() in jffs2_do_mount_fs() returns an error, we can observe the following kmemleak report: Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing -------------------------------------------- unreferenced object 0xffff88811b25a640 (size 64): comm "mount", pid 691, jiffies 4294957728 (age 71.952s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_init+0x86/0x130 [] jffs2_do_mount_fs+0x798/0xac0 [] jffs2_do_fill_super+0x383/0xc30 [] jffs2_fill_super+0x2ea/0x4c0 [...] unreferenced object 0xffff88812c760000 (size 65536): comm "mount", pid 691, jiffies 4294957728 (age 71.952s) hex dump (first 32 bytes): bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ backtrace: [] __kmalloc+0x6b9/0x910 [] jffs2_sum_init+0xd7/0x130 [] jffs2_do_mount_fs+0x798/0xac0 [] jffs2_do_fill_super+0x383/0xc30 [] jffs2_fill_super+0x2ea/0x4c0 [...] -------------------------------------------- This is because the resources allocated in jffs2_sum_init() are not released. Call jffs2_sum_exit() to release these resources to solve the problem. Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time i= mprovement)") Cc: stable@vger.kernel.org Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/jffs2/build.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c @@ -415,13 +415,15 @@ int jffs2_do_mount_fs(struct jffs2_sb_in jffs2_free_ino_caches(c); jffs2_free_raw_node_refs(c); ret =3D -EIO; - goto out_free; + goto out_sum_exit; } =20 jffs2_calc_trigger_levels(c); =20 return 0; =20 + out_sum_exit: + jffs2_sum_exit(c); out_free: kvfree(c->blocks); From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82E73C433EF for ; Mon, 18 Apr 2022 13:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243675AbiDRNly (ORCPT ); Mon, 18 Apr 2022 09:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242126AbiDRNIp (ORCPT ); Mon, 18 Apr 2022 09:08:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0657134B80; Mon, 18 Apr 2022 05:48:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 25856B80E4E; Mon, 18 Apr 2022 12:48:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62838C385A1; Mon, 18 Apr 2022 12:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286097; bh=NcRu25js3toUPx0KLfzmrjPtNYkGWmP5Qed61QgN4e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vub1YS/uqv9TanzgBHcXyTKurynUtV6Q/AZgFcxkCQ3DYXfgZmOj90fn4biG1LEfb iHoEza1UamnD+Twti5evArEiyKflbxYfcapxfej6oQSvJlgc1Gph7r3kRxuTxIOK/e JWwX6hhAlRvh7vjLWclHY22lGsyNEyIiijFhQ4XI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baokun Li , Richard Weinberger Subject: [PATCH 4.14 028/284] jffs2: fix memory leak in jffs2_scan_medium Date: Mon, 18 Apr 2022 14:10:09 +0200 Message-Id: <20220418121211.496495273@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Baokun Li commit 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df upstream. If an error is returned in jffs2_scan_eraseblock() and some memory has been added to the jffs2_summary *s, we can observe the following kmemleak report: Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing -------------------------------------------- unreferenced object 0xffff88812b889c40 (size 64): comm "mount", pid 692, jiffies 4294838325 (age 34.288s) hex dump (first 32 bytes): 40 48 b5 14 81 88 ff ff 01 e0 31 00 00 00 50 00 @H........1...P. 00 00 01 00 00 00 01 00 00 00 02 00 00 00 09 08 ................ backtrace: [] __kmalloc+0x613/0x910 [] jffs2_sum_add_dirent_mem+0x5c/0xa0 [] jffs2_scan_medium.cold+0x36e5/0x4794 [] jffs2_do_mount_fs.cold+0xa7/0x2267 [] jffs2_do_fill_super+0x383/0xc30 [] jffs2_fill_super+0x2ea/0x4c0 [] mtd_get_sb+0x254/0x400 [] mtd_get_sb_by_nr+0x4f/0xd0 [] get_tree_mtd+0x498/0x840 [] jffs2_get_tree+0x25/0x30 [] vfs_get_tree+0x8d/0x2e0 [] path_mount+0x50f/0x1e50 [] do_mount+0x107/0x130 [] __se_sys_mount+0x1c5/0x2f0 [] __x64_sys_mount+0xc7/0x160 [] do_syscall_64+0x45/0x70 unreferenced object 0xffff888114b54840 (size 32): comm "mount", pid 692, jiffies 4294838325 (age 34.288s) hex dump (first 32 bytes): c0 75 b5 14 81 88 ff ff 02 e0 02 00 00 00 02 00 .u.............. 00 00 84 00 00 00 44 00 00 00 6b 6b 6b 6b 6b a5 ......D...kkkkk. backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_add_inode_mem+0x54/0x90 [] jffs2_scan_medium.cold+0x4481/0x4794 [...] unreferenced object 0xffff888114b57280 (size 32): comm "mount", pid 692, jiffies 4294838393 (age 34.357s) hex dump (first 32 bytes): 10 d5 6c 11 81 88 ff ff 08 e0 05 00 00 00 01 00 ..l............. 00 00 38 02 00 00 28 00 00 00 6b 6b 6b 6b 6b a5 ..8...(...kkkkk. backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_add_xattr_mem+0x54/0x90 [] jffs2_scan_medium.cold+0x298c/0x4794 [...] unreferenced object 0xffff8881116cd510 (size 16): comm "mount", pid 692, jiffies 4294838395 (age 34.355s) hex dump (first 16 bytes): 00 00 00 00 00 00 00 00 09 e0 60 02 00 00 6b a5 ..........`...k. backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_add_xref_mem+0x54/0x90 [] jffs2_scan_medium.cold+0x3a20/0x4794 [...] -------------------------------------------- Therefore, we should call jffs2_sum_reset_collected(s) on exit to release the memory added in s. In addition, a new tag "out_buf" is added to prevent the NULL pointer reference caused by s being NULL. (thanks to Zhang Yi for this analysis) Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time i= mprovement)") Cc: stable@vger.kernel.org Co-developed-with: Zhihao Cheng Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/jffs2/scan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -136,7 +136,7 @@ int jffs2_scan_medium(struct jffs2_sb_in if (!s) { JFFS2_WARNING("Can't allocate memory for summary\n"); ret =3D -ENOMEM; - goto out; + goto out_buf; } } =20 @@ -274,13 +274,15 @@ int jffs2_scan_medium(struct jffs2_sb_in } ret =3D 0; out: + jffs2_sum_reset_collected(s); + kfree(s); + out_buf: if (buf_size) kfree(flashbuf); #ifndef __ECOS else mtd_unpoint(c->mtd, 0, c->mtd->size); #endif - kfree(s); return ret; } From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C08B9C433EF for ; Mon, 18 Apr 2022 13:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243020AbiDRNlv (ORCPT ); Mon, 18 Apr 2022 09:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242194AbiDRNIs (ORCPT ); Mon, 18 Apr 2022 09:08:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DBBD34BB7; Mon, 18 Apr 2022 05:48:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5DB6EB80EC3; Mon, 18 Apr 2022 12:48:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C992C385A1; Mon, 18 Apr 2022 12:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286101; bh=oiI2TiSaTV9kIrqX9NLfq5KU0LaWl0CGs/l2tECg9zU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V4xXJNUzwQvZJQC4lpjemw+ZckyFZENbj+zfSyP+2+1iSDEHDcqeojE9km6lzhJl5 cOGyxF4lcCtpvE/jirD8aSntMpG5F+ywdGZnjsXdm9orI4Zejz2wh0m+vSTNGdJ8BW BpbZuB7i/fLzCDOgE+uE3RhsNnNZXWKmFYv3exX8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alistair Popple , David Hildenbrand , Mel Gorman , John Hubbard , Zi Yan , Anshuman Khandual , Oscar Salvador , Andrew Morton , Linus Torvalds Subject: [PATCH 4.14 029/284] mm/pages_alloc.c: dont create ZONE_MOVABLE beyond the end of a node Date: Mon, 18 Apr 2022 14:10:10 +0200 Message-Id: <20220418121211.524286151@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Alistair Popple commit ddbc84f3f595cf1fc8234a191193b5d20ad43938 upstream. ZONE_MOVABLE uses the remaining memory in each node. Its starting pfn is also aligned to MAX_ORDER_NR_PAGES. It is possible for the remaining memory in a node to be less than MAX_ORDER_NR_PAGES, meaning there is not enough room for ZONE_MOVABLE on that node. Unfortunately this condition is not checked for. This leads to zone_movable_pfn[] getting set to a pfn greater than the last pfn in a node. calculate_node_totalpages() then sets zone->present_pages to be greater than zone->spanned_pages which is invalid, as spanned_pages represents the maximum number of pages in a zone assuming no holes. Subsequently it is possible free_area_init_core() will observe a zone of size zero with present pages. In this case it will skip setting up the zone, including the initialisation of free_lists[]. However populated_zone() checks zone->present_pages to see if a zone has memory available. This is used by iterators such as walk_zones_in_node(). pagetypeinfo_showfree() uses this to walk the free_list of each zone in each node, which are assumed to be initialised due to the zone not being empty. As free_area_init_core() never initialised the free_lists[] this results in the following kernel crash when trying to read /proc/pagetypeinfo: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC NOPTI CPU: 0 PID: 456 Comm: cat Not tainted 5.16.0 #461 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2= 014 RIP: 0010:pagetypeinfo_show+0x163/0x460 Code: 9e 82 e8 80 57 0e 00 49 8b 06 b9 01 00 00 00 4c 39 f0 75 16 e9 65 0= 2 00 00 48 83 c1 01 48 81 f9 a0 86 01 00 0f 84 48 02 00 00 <48> 8b 00 4c 39= f0 75 e7 48 c7 c2 80 a2 e2 82 48 c7 c6 79 ef e3 82 RSP: 0018:ffffc90001c4bd10 EFLAGS: 00010003 RAX: 0000000000000000 RBX: ffff88801105f638 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 000000000000068b RDI: ffff8880163dc68b RBP: ffffc90001c4bd90 R08: 0000000000000001 R09: ffff8880163dc67e R10: 656c6261766f6d6e R11: 6c6261766f6d6e55 R12: ffff88807ffb4a00 R13: ffff88807ffb49f8 R14: ffff88807ffb4580 R15: ffff88807ffb3000 FS: 00007f9c83eff5c0(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000= 000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000013c8e000 CR4: 0000000000350ef0 Call Trace: seq_read_iter+0x128/0x460 proc_reg_read_iter+0x51/0x80 new_sync_read+0x113/0x1a0 vfs_read+0x136/0x1d0 ksys_read+0x70/0xf0 __x64_sys_read+0x1a/0x20 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Fix this by checking that the aligned zone_movable_pfn[] does not exceed the end of the node, and if it does skip creating a movable zone on this node. Link: https://lkml.kernel.org/r/20220215025831.2113067-1-apopple@nvidia.com Fixes: 2a1e274acf0b ("Create the ZONE_MOVABLE zone") Signed-off-by: Alistair Popple Acked-by: David Hildenbrand Acked-by: Mel Gorman Cc: John Hubbard Cc: Zi Yan Cc: Anshuman Khandual Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- mm/page_alloc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6502,10 +6502,17 @@ restart: =20 out2: /* Align start of ZONE_MOVABLE on all nids to MAX_ORDER_NR_PAGES */ - for (nid =3D 0; nid < MAX_NUMNODES; nid++) + for (nid =3D 0; nid < MAX_NUMNODES; nid++) { + unsigned long start_pfn, end_pfn; + zone_movable_pfn[nid] =3D roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES); =20 + get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); + if (zone_movable_pfn[nid] >=3D end_pfn) + zone_movable_pfn[nid] =3D 0; + } + out: /* restore the node_state */ node_states[N_MEMORY] =3D saved_node_state; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6E24C3527D for ; Mon, 18 Apr 2022 13:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241060AbiDRNev (ORCPT ); Mon, 18 Apr 2022 09:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242349AbiDRNJB (ORCPT ); Mon, 18 Apr 2022 09:09:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 516713527C; Mon, 18 Apr 2022 05:48:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E8B4B80E4E; Mon, 18 Apr 2022 12:48:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2FB5C385A7; Mon, 18 Apr 2022 12:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286108; bh=KiSj6vfkh011hVWQtDl5MCnk+5dB9e9ROWDaE3GoJcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iFslvezeWr7eAF7ZtmjxsDAXkzinNgaNraD0qtYZL5ib5ix1tUHIGBnNK0CECQ58b CC6w4QfsFb0cB2xOPdbpHfMestNjp39RBHJpMUZ/eYbUz6tdkOOYZDU+14VKfrHUxw LQvdv9q+Vfn2ZK6HqH/T0vNUOQsVW5oRGsJBBxIk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hugh Dickins , Oleg Nesterov , "Liam R. Howlett" , Vlastimil Babka , Andrew Morton , Linus Torvalds Subject: [PATCH 4.14 030/284] mempolicy: mbind_range() set_policy() after vma_merge() Date: Mon, 18 Apr 2022 14:10:11 +0200 Message-Id: <20220418121211.552381656@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Hugh Dickins commit 4e0906008cdb56381638aa17d9c32734eae6d37a upstream. v2.6.34 commit 9d8cebd4bcd7 ("mm: fix mbind vma merge problem") introduced vma_merge() to mbind_range(); but unlike madvise, mlock and mprotect, it put a "continue" to next vma where its precedents go to update flags on current vma before advancing: that left vma with the wrong setting in the infamous vma_merge() case 8. v3.10 commit 1444f92c8498 ("mm: merging memory blocks resets mempolicy") tried to fix that in vma_adjust(), without fully understanding the issue. v3.11 commit 3964acd0dbec ("mm: mempolicy: fix mbind_range() && vma_adjust() interaction") reverted that, and went about the fix in the right way, but chose to optimize out an unnecessary mpol_dup() with a prior mpol_equal() test. But on tmpfs, that also pessimized out the vital call to its ->set_policy(), leaving the new mbind unenforced. The user visible effect was that the pages got allocated on the local node (happened to be 0), after the mbind() caller had specifically asked for them to be allocated on node 1. There was not any page migration involved in the case reported: the pages simply got allocated on the wrong node. Just delete that optimization now (though it could be made conditional on vma not having a set_policy). Also remove the "next" variable: it turned out to be blameless, but also pointless. Link: https://lkml.kernel.org/r/319e4db9-64ae-4bca-92f0-ade85d342ff@google.= com Fixes: 3964acd0dbec ("mm: mempolicy: fix mbind_range() && vma_adjust() inte= raction") Signed-off-by: Hugh Dickins Acked-by: Oleg Nesterov Reviewed-by: Liam R. Howlett Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- mm/mempolicy.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -727,7 +727,6 @@ static int vma_replace_policy(struct vm_ static int mbind_range(struct mm_struct *mm, unsigned long start, unsigned long end, struct mempolicy *new_pol) { - struct vm_area_struct *next; struct vm_area_struct *prev; struct vm_area_struct *vma; int err =3D 0; @@ -743,8 +742,7 @@ static int mbind_range(struct mm_struct if (start > vma->vm_start) prev =3D vma; =20 - for (; vma && vma->vm_start < end; prev =3D vma, vma =3D next) { - next =3D vma->vm_next; + for (; vma && vma->vm_start < end; prev =3D vma, vma =3D vma->vm_next) { vmstart =3D max(start, vma->vm_start); vmend =3D min(end, vma->vm_end); =20 @@ -758,10 +756,6 @@ static int mbind_range(struct mm_struct new_pol, vma->vm_userfaultfd_ctx); if (prev) { vma =3D prev; - next =3D vma->vm_next; - if (mpol_equal(vma_policy(vma), new_pol)) - continue; - /* vma_merge() joined vma && vma->next, case 8 */ goto replace; } if (vma->vm_start !=3D vmstart) { From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 728E6C433F5 for ; Mon, 18 Apr 2022 13:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242803AbiDRNl3 (ORCPT ); Mon, 18 Apr 2022 09:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242448AbiDRNJH (ORCPT ); Mon, 18 Apr 2022 09:09:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FBD635A87; Mon, 18 Apr 2022 05:48:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F3274B80D9C; Mon, 18 Apr 2022 12:48:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356F5C385A7; Mon, 18 Apr 2022 12:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286111; bh=tS0bT0Ob+m2K2tG+sUf7Vtwmj0hwg1nLUyR2Yj1v28w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDtfbO4GleTsILMLNeV5CvhAhbGXthJvVa/Uq7M9iqDAR2UcVzH6ppORyKvE4a+rQ JfMHq946FQ3Qfo3oV7NOIKtCUcU+I/9VPYZyMpPnMlpNDIWUHuAWExLKlhKkTBHXR2 Rs8EUKjy63S2wDU/EjF4/U1IuPya+ZrZLebxPPy4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Jack Wang , Damien Le Moal , "Martin K. Petersen" Subject: [PATCH 4.14 031/284] scsi: libsas: Fix sas_ata_qc_issue() handling of NCQ NON DATA commands Date: Mon, 18 Apr 2022 14:10:12 +0200 Message-Id: <20220418121211.580662692@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Damien Le Moal commit 8454563e4c2aafbfb81a383ab423ea8b9b430a25 upstream. To detect for the DMA_NONE (no data transfer) DMA direction, sas_ata_qc_issue() tests if the command protocol is ATA_PROT_NODATA. This test does not include the ATA_CMD_NCQ_NON_DATA command as this command protocol is defined as ATA_PROT_NCQ_NODATA (equal to ATA_PROT_FLAG_NCQ) and not as ATA_PROT_NODATA. To include both NCQ and non-NCQ commands when testing for the DMA_NONE DMA direction, use "!ata_is_data()". Link: https://lore.kernel.org/r/20220220031810.738362-2-damien.lemoal@opens= ource.wdc.com Fixes: 176ddd89171d ("scsi: libsas: Reset num_scatter if libata marks qc as= NODATA") Cc: stable@vger.kernel.org Reviewed-by: John Garry Reviewed-by: Jack Wang Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/scsi/libsas/sas_ata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -220,7 +220,7 @@ static unsigned int sas_ata_qc_issue(str task->total_xfer_len =3D qc->nbytes; task->num_scatter =3D qc->n_elem; task->data_dir =3D qc->dma_dir; - } else if (qc->tf.protocol =3D=3D ATA_PROT_NODATA) { + } else if (!ata_is_data(qc->tf.protocol)) { task->data_dir =3D DMA_NONE; } else { for_each_sg(qc->sg, sg, qc->n_elem, si) From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7151BC433FE for ; Mon, 18 Apr 2022 13:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243430AbiDRNhk (ORCPT ); Mon, 18 Apr 2022 09:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242481AbiDRNJJ (ORCPT ); Mon, 18 Apr 2022 09:09:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDDB235AA4; Mon, 18 Apr 2022 05:48:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 850AEB80E4B; Mon, 18 Apr 2022 12:48:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8314C385A1; Mon, 18 Apr 2022 12:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286115; bh=Jbek3RH1Q9L3rOLcqgTTv2pDWqjqTznyGw/Jbp7pOlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LERuLMq1U0dESh9bB591X078hGWT3cMHhtbhWntFIimofEtDGSdLDcfqrWso5FKPb h+GkYTXrrE/FNFTss89r4K2pi1r+VlDhivjKql6TiVQQ52juMtqa/CSluIEbG4nlqI 5VJBP0AsavxcRAZqMtiM9K2PwQTDrEdzDLxcQhkE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Chopra , Ariel Elior , "David S. Miller" Subject: [PATCH 4.14 032/284] qed: display VF trust config Date: Mon, 18 Apr 2022 14:10:13 +0200 Message-Id: <20220418121211.608674664@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Manish Chopra commit 4e6e6bec7440b9b76f312f28b1f4e944eebb3abc upstream. Driver does support SR-IOV VFs trust configuration but it does not display it when queried via ip link utility. Cc: stable@vger.kernel.org Fixes: f990c82c385b ("qed*: Add support for ndo_set_vf_trust") Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c @@ -4587,6 +4587,7 @@ static int qed_get_vf_config(struct qed_ tx_rate =3D vf_info->tx_rate; ivi->max_tx_rate =3D tx_rate ? tx_rate : link.speed; ivi->min_tx_rate =3D qed_iov_get_vf_min_rate(hwfn, vf_id); + ivi->trusted =3D vf_info->is_trusted_request; =20 return 0; } From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 904B5C4332F for ; Mon, 18 Apr 2022 13:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243494AbiDRNhs (ORCPT ); Mon, 18 Apr 2022 09:37:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242511AbiDRNJL (ORCPT ); Mon, 18 Apr 2022 09:09:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D09A35AB2; Mon, 18 Apr 2022 05:48:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 16B816124A; Mon, 18 Apr 2022 12:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0053BC385A7; Mon, 18 Apr 2022 12:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286118; bh=xt/3ZgTb5M7UCbB0uEeBZlI135Cdciw7Ms4/z7SMJ/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pq8FDHVJFIGetdOgpRk3fRJ4WpuBA86V+QFFtHwmWIm/Y+ekUqEPuN2vNJgiV7XKS /9SWousDT+6+s0LEOhiZDNG1iCGRUE/V+fakBWDjiy+5ESWo4jp6w2R2qxycAvHwAZ V8NIESFODuvh9mwUO8ATZys8Pl9io9/CcqO7L9p4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Chopra , Ariel Elior , "David S. Miller" Subject: [PATCH 4.14 033/284] qed: validate and restrict untrusted VFs vlan promisc mode Date: Mon, 18 Apr 2022 14:10:14 +0200 Message-Id: <20220418121211.636992623@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Manish Chopra commit cbcc44db2cf7b836896733acc0e5ea966136ed22 upstream. Today when VFs are put in promiscuous mode, they can request PF to configure device for them to receive all VLANs traffic regardless of what vlan is configured by the PF (via ip link) and PF allows this config request regardless of whether VF is trusted or not. >From security POV, when VLAN is configured for VF through PF (via ip link), honour such config requests from VF only when they are configured to be trusted, otherwise restrict such VFs vlan promisc mode config. Cc: stable@vger.kernel.org Fixes: f990c82c385b ("qed*: Add support for ndo_set_vf_trust") Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 28 +++++++++++++++++++++++= +++-- drivers/net/ethernet/qlogic/qed/qed_sriov.h | 1 + 2 files changed, 27 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c @@ -2996,12 +2996,16 @@ static int qed_iov_pre_update_vport(stru u8 mask =3D QED_ACCEPT_UCAST_UNMATCHED | QED_ACCEPT_MCAST_UNMATCHED; struct qed_filter_accept_flags *flags =3D ¶ms->accept_flags; struct qed_public_vf_info *vf_info; + u16 tlv_mask; + + tlv_mask =3D BIT(QED_IOV_VP_UPDATE_ACCEPT_PARAM) | + BIT(QED_IOV_VP_UPDATE_ACCEPT_ANY_VLAN); =20 /* Untrusted VFs can't even be trusted to know that fact. * Simply indicate everything is configured fine, and trace * configuration 'behind their back'. */ - if (!(*tlvs & BIT(QED_IOV_VP_UPDATE_ACCEPT_PARAM))) + if (!(*tlvs & tlv_mask)) return 0; =20 vf_info =3D qed_iov_get_public_vf_info(hwfn, vfid, true); @@ -3018,6 +3022,13 @@ static int qed_iov_pre_update_vport(stru flags->tx_accept_filter &=3D ~mask; } =20 + if (params->update_accept_any_vlan_flg) { + vf_info->accept_any_vlan =3D params->accept_any_vlan; + + if (vf_info->forced_vlan && !vf_info->is_trusted_configured) + params->accept_any_vlan =3D false; + } + return 0; } =20 @@ -4920,6 +4931,12 @@ static void qed_iov_handle_trust_change( =20 params.update_ctl_frame_check =3D 1; params.mac_chk_en =3D !vf_info->is_trusted_configured; + params.update_accept_any_vlan_flg =3D 0; + + if (vf_info->accept_any_vlan && vf_info->forced_vlan) { + params.update_accept_any_vlan_flg =3D 1; + params.accept_any_vlan =3D vf_info->accept_any_vlan; + } =20 if (vf_info->rx_accept_mode & mask) { flags->update_rx_mode_config =3D 1; @@ -4935,13 +4952,20 @@ static void qed_iov_handle_trust_change( if (!vf_info->is_trusted_configured) { flags->rx_accept_filter &=3D ~mask; flags->tx_accept_filter &=3D ~mask; + params.accept_any_vlan =3D false; } =20 if (flags->update_rx_mode_config || flags->update_tx_mode_config || - params.update_ctl_frame_check) + params.update_ctl_frame_check || + params.update_accept_any_vlan_flg) { + DP_VERBOSE(hwfn, QED_MSG_IOV, + "vport update config for %s VF[abs 0x%x rel 0x%x]\n", + vf_info->is_trusted_configured ? "trusted" : "untrusted", + vf->abs_vf_id, vf->relative_vf_id); qed_sp_vport_update(hwfn, ¶ms, QED_SPQ_MODE_EBLOCK, NULL); + } } } =20 --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.h +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.h @@ -88,6 +88,7 @@ struct qed_public_vf_info { bool is_trusted_request; u8 rx_accept_mode; u8 tx_accept_mode; + bool accept_any_vlan; }; =20 struct qed_iov_vf_init_params { From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61AAAC433EF for ; Mon, 18 Apr 2022 13:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242456AbiDRNlV (ORCPT ); Mon, 18 Apr 2022 09:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242605AbiDRNJP (ORCPT ); Mon, 18 Apr 2022 09:09:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D9135DF4; Mon, 18 Apr 2022 05:48:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D8973B80E59; Mon, 18 Apr 2022 12:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 488DEC385A1; Mon, 18 Apr 2022 12:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286121; bh=dVNejMXjJk3oR17huPBy37qYuDa6sLu0pwHocqLu2mc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VADiWZC+4xZBG8O9IAUUIw4SqurNT3d+qb6ZdjZvBSg4pX/9SupFOqNgWof41Ya/i ej18jH8vGQn9RyGY+yAAoICVidMKp6Qhv6fQqfwCOxe63LK0SsFI8GgsQesRQzFEE6 F3Ng8QSs6CzJeUN0MAa9kKTdR2kWVaAaGL3OBmUo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= , Hans de Goede , Peter Hutterer , Benjamin Tissoires , Dmitry Torokhov Subject: [PATCH 4.14 034/284] Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads" Date: Mon, 18 Apr 2022 14:10:15 +0200 Message-Id: <20220418121211.665171937@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jos=C3=A9 Exp=C3=B3sito commit 8b188fba75195745026e11d408e4a7e94e01d701 upstream. This reverts commit 37ef4c19b4c659926ce65a7ac709ceaefb211c40. The touchpad present in the Dell Precision 7550 and 7750 laptops reports a HID_DG_BUTTONTYPE of type MT_BUTTONTYPE_CLICKPAD. However, the device is not a clickpad, it is a touchpad with physical buttons. In order to fix this issue, a quirk for the device was introduced in libinput [1] [2] to disable the INPUT_PROP_BUTTONPAD property: [Precision 7x50 Touchpad] MatchBus=3Di2c MatchUdevType=3Dtouchpad MatchDMIModalias=3Ddmi:*svnDellInc.:pnPrecision7?50* AttrInputPropDisable=3DINPUT_PROP_BUTTONPAD However, because of the change introduced in 37ef4c19b4 ("Input: clear BTN_RIGHT/MIDDLE on buttonpads") the BTN_RIGHT key bit is not mapped anymore breaking the device right click button and making impossible to workaround it in user space. In order to avoid breakage on other present or future devices, revert the patch causing the issue. Signed-off-by: Jos=C3=A9 Exp=C3=B3sito Reviewed-by: Hans de Goede Acked-by: Peter Hutterer Acked-by: Benjamin Tissoires Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220321184404.20025-1-jose.exposito89@gmai= l.com Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/input/input.c | 6 ------ 1 file changed, 6 deletions(-) --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -2120,12 +2120,6 @@ int input_register_device(struct input_d /* KEY_RESERVED is not supposed to be transmitted to userspace. */ __clear_bit(KEY_RESERVED, dev->keybit); =20 - /* Buttonpads should not map BTN_RIGHT and/or BTN_MIDDLE. */ - if (test_bit(INPUT_PROP_BUTTONPAD, dev->propbit)) { - __clear_bit(BTN_RIGHT, dev->keybit); - __clear_bit(BTN_MIDDLE, dev->keybit); - } - /* Make sure that bitmasks not mentioned in dev->evbit are clean. */ input_cleanse_bitmasks(dev); =20 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07B33C433F5 for ; Mon, 18 Apr 2022 13:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242641AbiDRNfa (ORCPT ); Mon, 18 Apr 2022 09:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242639AbiDRNJR (ORCPT ); Mon, 18 Apr 2022 09:09:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599813614E; Mon, 18 Apr 2022 05:48:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7AD9460FB6; Mon, 18 Apr 2022 12:48:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7338FC385A1; Mon, 18 Apr 2022 12:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286124; bh=6118wY5SUqvaOGFyKq6KoocM37LhFJT1VLYB+36B0Ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BEGAlTBUDQB6DUBfUPay87sPa3P5Q/NCcbZi8qtUgjVHcI+TDyGQQ7aE3fWFf9INs /3kG9gP9IOCB5wCFj/U/kvu+gLHvsO675jVHLTyM7sbGuDDhDFVxrSTlYODfmGSmBi DR+6L2aqBPcEUCzgs5BcsAgdDVyR+JQsVINxCzzE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaomeng Tong , Takashi Iwai Subject: [PATCH 4.14 035/284] ALSA: cs4236: fix an incorrect NULL check on list iterator Date: Mon, 18 Apr 2022 14:10:16 +0200 Message-Id: <20220418121211.693125219@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xiaomeng Tong commit 0112f822f8a6d8039c94e0bc9b264d7ffc5d4704 upstream. The bug is here: err =3D snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev); The list iterator value 'cdev' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found. To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'cdev' as a dedicated pointer to point to the found element. And snd_card_cs423x_pnp() itself has NULL check for cdev. Cc: stable@vger.kernel.org Fixes: c2b73d1458014 ("ALSA: cs4236: cs4232 and cs4236 driver merge to solv= e PnP BIOS detection") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327060822.4735-1-xiam0nd.tong@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- sound/isa/cs423x/cs4236.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c @@ -559,7 +559,7 @@ static int snd_cs423x_pnpbios_detect(str static int dev; int err; struct snd_card *card; - struct pnp_dev *cdev; + struct pnp_dev *cdev, *iter; char cid[PNP_ID_LEN]; =20 if (pnp_device_is_isapnp(pdev)) @@ -575,9 +575,11 @@ static int snd_cs423x_pnpbios_detect(str strcpy(cid, pdev->id[0].id); cid[5] =3D '1'; cdev =3D NULL; - list_for_each_entry(cdev, &(pdev->protocol->devices), protocol_list) { - if (!strcmp(cdev->id[0].id, cid)) + list_for_each_entry(iter, &(pdev->protocol->devices), protocol_list) { + if (!strcmp(iter->id[0].id, cid)) { + cdev =3D iter; break; + } } err =3D snd_cs423x_card_new(&pdev->dev, dev, &card); if (err < 0) From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F8F4C433F5 for ; Mon, 18 Apr 2022 13:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242274AbiDRNfQ (ORCPT ); Mon, 18 Apr 2022 09:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242688AbiDRNJU (ORCPT ); Mon, 18 Apr 2022 09:09:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 511E636173; Mon, 18 Apr 2022 05:48:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A504061267; Mon, 18 Apr 2022 12:48:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F208C385A1; Mon, 18 Apr 2022 12:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286128; bh=ppHpru4VsQzJxITMdZEUGtbM4eqf231wGeMtdnZLn78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TmBrCtWb+uwMn+RNwBccyaM1Fsp8Z/9x2ePMJOlDS3SdNhVEJhoLxPp3MqWjoicKU Lq0zTBM9Evu7/jWnn7bYC+or5Ul2NAi+mWClVDRGNnVOrYuqsGWYSpv19rGUawG4fp CQn2c7XeR4Dqxz3kXVgtzLzbq8VXc3qbtuSaAsns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars Ellenberg , =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= , Jens Axboe Subject: [PATCH 4.14 036/284] drbd: fix potential silent data corruption Date: Mon, 18 Apr 2022 14:10:17 +0200 Message-Id: <20220418121211.721427897@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Ellenberg commit f4329d1f848ac35757d9cc5487669d19dfc5979c upstream. Scenario: Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --------- bio chain generated by blk_queue_split(). Some split bio fails and propagates its error status to the "parent" bio. But then the (last part of the) parent bio itself completes without error. We would clobber the already recorded error status with BLK_STS_OK, causing silent data corruption. Reproducer: ----------- How to trigger this in the real world within seconds: DRBD on top of degraded parity raid, small stripe_cache_size, large read_ahead setting. Drop page cache (sysctl vm.drop_caches=3D1, fadvise "DONTNEED", umount and mount again, "reboot"). Cause significant read ahead. Large read ahead request is split by blk_queue_split(). Parts of the read ahead that are already in the stripe cache, or find an available stripe cache to use, can be serviced. Parts of the read ahead that would need "too much work", would need to wait for a "stripe_head" to become available, are rejected immediately. For larger read ahead requests that are split in many pieces, it is very likely that some "splits" will be serviced, but then the stripe cache is exhausted/busy, and the remaining ones will be rejected. Signed-off-by: Lars Ellenberg Signed-off-by: Christoph B=C3=B6hmwalder Cc: # 4.13.x Link: https://lore.kernel.org/r/20220330185551.3553196-1-christoph.boehmwal= der@linbit.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/drbd/drbd_req.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -207,7 +207,8 @@ void start_new_tl_epoch(struct drbd_conn void complete_master_bio(struct drbd_device *device, struct bio_and_error *m) { - m->bio->bi_status =3D errno_to_blk_status(m->error); + if (unlikely(m->error)) + m->bio->bi_status =3D errno_to_blk_status(m->error); bio_endio(m->bio); dec_ap_bio(device); } From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2E86C3525B for ; Mon, 18 Apr 2022 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244164AbiDRNn3 (ORCPT ); Mon, 18 Apr 2022 09:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241827AbiDRNQw (ORCPT ); Mon, 18 Apr 2022 09:16:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C9B13B3D4; Mon, 18 Apr 2022 05:51:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0DE56B80E4B; Mon, 18 Apr 2022 12:51:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52ECEC385A7; Mon, 18 Apr 2022 12:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286289; bh=1oyP9Yl4iCnmhceZBjK/ORLjx4DgeqKe6WkA2MqXfLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJOwMTVokgn2nqkOGQXbLwjv2EWEJOsWALDX61yhkg9u12D9YFaehEgbOXEjk2LcK hYOAI6NuNlIDxvOv2wBAF58P/veoYB+c86H7KiwYfqmmqeVQmljYTqMDb4mJXmS6rd W74QJi1TzrLHo8V03Z96Y/mnZdpIhzDTzV9lHPLY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sakari Ailus , "Rafael J. Wysocki" Subject: [PATCH 4.14 037/284] ACPI: properties: Consistently return -ENOENT if there are no more references Date: Mon, 18 Apr 2022 14:10:18 +0200 Message-Id: <20220418121211.750050000@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sakari Ailus commit babc92da5928f81af951663fc436997352e02d3a upstream. __acpi_node_get_property_reference() is documented to return -ENOENT if the caller requests a property reference at an index that does not exist, not -EINVAL which it actually does. Fix this by returning -ENOENT consistenly, independently of whether the property value is a plain reference or a package. Fixes: c343bc2ce2c6 ("ACPI: properties: Align return codes of __acpi_node_g= et_property_reference()") Cc: 4.14+ # 4.14+ Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/acpi/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -601,7 +601,7 @@ int __acpi_node_get_property_reference(c */ if (obj->type =3D=3D ACPI_TYPE_LOCAL_REFERENCE) { if (index) - return -EINVAL; + return -ENOENT; =20 ret =3D acpi_bus_get_device(obj->reference.handle, &device); if (ret) From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BDBFC433F5 for ; Mon, 18 Apr 2022 13:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242901AbiDRNgO (ORCPT ); Mon, 18 Apr 2022 09:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243422AbiDRNKH (ORCPT ); Mon, 18 Apr 2022 09:10:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4745737BDA; Mon, 18 Apr 2022 05:49:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ECB9FB80EDB; Mon, 18 Apr 2022 12:49:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23B99C385A1; Mon, 18 Apr 2022 12:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286153; bh=FjNegvRkVwiBOy2n8U5PjkNWCM1IxJIfAj3VatT+cxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xx0w9ZDLyasvlHQI+qyvc5U1og+0CSQQJhnQu7rb4FIMyEEbY8rtktXa17Dbp6yCe RQ5LQYVxzyNwarxv9La2ULjlPGdTi3WcTIsa5Yfet7iIvTranIJZN13NQ/P+uxPma9 dzQgZb5k8eIqH6ZJdFHeGvsywMl7z1lvez8fppIU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Duoming Zhou , Lin Ma , "David S. Miller" Subject: [PATCH 4.14 038/284] drivers: hamradio: 6pack: fix UAF bug caused by mod_timer() Date: Mon, 18 Apr 2022 14:10:19 +0200 Message-Id: <20220418121211.778389648@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Duoming Zhou commit efe4186e6a1b54bf38b9e05450d43b0da1fd7739 upstream. When a 6pack device is detaching, the sixpack_close() will act to cleanup necessary resources. Although del_timer_sync() in sixpack_close() won't return if there is an active timer, one could use mod_timer() in sp_xmit_on_air() to wake up timer again by calling userspace syscall such as ax25_sendmsg(), ax25_connect() and ax25_ioctl(). This unexpected waked handler, sp_xmit_on_air(), realizes nothing about the undergoing cleanup and may still call pty_write() to use driver layer resources that have already been released. One of the possible race conditions is shown below: (USE) | (FREE) ax25_sendmsg() | ax25_queue_xmit() | ... | sp_xmit() | sp_encaps() | sixpack_close() sp_xmit_on_air() | del_timer_sync(&sp->tx_t) mod_timer(&sp->tx_t,...) | ... | unregister_netdev() | ... (wait a while) | tty_release() | tty_release_struct() | release_tty() sp_xmit_on_air() | tty_kref_put(tty_struct) //FREE pty_write(tty_struct) //USE | ... The corresponding fail log is shown below: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BUG: KASAN: use-after-free in __run_timers.part.0+0x170/0x470 Write of size 8 at addr ffff88800a652ab8 by task swapper/2/0 ... Call Trace: ... queue_work_on+0x3f/0x50 pty_write+0xcd/0xe0pty_write+0xcd/0xe0 sp_xmit_on_air+0xb2/0x1f0 call_timer_fn+0x28/0x150 __run_timers.part.0+0x3c2/0x470 run_timer_softirq+0x3b/0x80 __do_softirq+0xf1/0x380 ... This patch reorders the del_timer_sync() after the unregister_netdev() to avoid UAF bugs. Because the unregister_netdev() is well synchronized, it flushs out any pending queues, waits the refcount of net_device decreases to zero and removes net_device from kernel. There is not any running routines after executing unregister_netdev(). Therefore, we could not arouse timer from userspace again. Signed-off-by: Duoming Zhou Reviewed-by: Lin Ma Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/hamradio/6pack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -685,14 +685,14 @@ static void sixpack_close(struct tty_str */ netif_stop_queue(sp->dev); =20 + unregister_netdev(sp->dev); + del_timer_sync(&sp->tx_t); del_timer_sync(&sp->resync_t); =20 /* Free all 6pack frame buffers. */ kfree(sp->rbuff); kfree(sp->xbuff); - - unregister_netdev(sp->dev); } =20 /* Perform I/O control on an active 6pack channel. */ From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C509AC43217 for ; Mon, 18 Apr 2022 13:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243572AbiDRNiI (ORCPT ); Mon, 18 Apr 2022 09:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243686AbiDRNKX (ORCPT ); Mon, 18 Apr 2022 09:10:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1AE2114C; Mon, 18 Apr 2022 05:49:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A3F8B80E4B; Mon, 18 Apr 2022 12:49:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41891C385A1; Mon, 18 Apr 2022 12:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286188; bh=Cw2NlYAm/sub3uTEA3b2qIyrR3JDeMkKrC26amsoKtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ts/rh33Lvr1y1PinEXLgkc31/cfbM0VOwmScVuMPmhq33fKUupYcUdLpsBN0VURcn U1v7PbTU1kTQxJNhpId0RIx3vt3G/jwSTGnFtzrIJR0NLnXZySxOoFo3PovirdLaKE bJZkx4cs6SyhuirVfvRdnIuO1fTwcCPgMEEXeQH8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Helge Deller Subject: [PATCH 4.14 039/284] video: fbdev: sm712fb: Fix crash in smtcfb_read() Date: Mon, 18 Apr 2022 14:10:20 +0200 Message-Id: <20220418121211.806496442@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Helge Deller commit bd771cf5c4254511cc4abb88f3dab3bd58bdf8e8 upstream. Zheyu Ma reported this crash in the sm712fb driver when reading three bytes from the framebuffer: BUG: unable to handle page fault for address: ffffc90001ffffff RIP: 0010:smtcfb_read+0x230/0x3e0 Call Trace: vfs_read+0x198/0xa00 ? do_sys_openat2+0x27d/0x350 ? __fget_light+0x54/0x340 ksys_read+0xce/0x190 do_syscall_64+0x43/0x90 Fix it by removing the open-coded endianess fixup-code and by moving the pointer post decrement out the fb_readl() function. Reported-by: Zheyu Ma Signed-off-by: Helge Deller Tested-by: Zheyu Ma Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/video/fbdev/sm712fb.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1047,7 +1047,7 @@ static ssize_t smtcfb_read(struct fb_inf if (count + p > total_size) count =3D total_size - p; =20 - buffer =3D kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL); + buffer =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!buffer) return -ENOMEM; =20 @@ -1059,25 +1059,14 @@ static ssize_t smtcfb_read(struct fb_inf while (count) { c =3D (count > PAGE_SIZE) ? PAGE_SIZE : count; dst =3D buffer; - for (i =3D c >> 2; i--;) { - *dst =3D fb_readl(src++); - *dst =3D big_swap(*dst); + for (i =3D (c + 3) >> 2; i--;) { + u32 val; + + val =3D fb_readl(src); + *dst =3D big_swap(val); + src++; dst++; } - if (c & 3) { - u8 *dst8 =3D (u8 *)dst; - u8 __iomem *src8 =3D (u8 __iomem *)src; - - for (i =3D c & 3; i--;) { - if (i & 1) { - *dst8++ =3D fb_readb(++src8); - } else { - *dst8++ =3D fb_readb(--src8); - src8 +=3D 2; - } - } - src =3D (u32 __iomem *)src8; - } =20 if (copy_to_user(buf, buffer, c)) { err =3D -EFAULT; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C940FC433F5 for ; Mon, 18 Apr 2022 13:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243035AbiDRNj0 (ORCPT ); Mon, 18 Apr 2022 09:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240391AbiDRNKy (ORCPT ); Mon, 18 Apr 2022 09:10:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 666AA39804; Mon, 18 Apr 2022 05:50:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B6FD3B80E4B; Mon, 18 Apr 2022 12:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7952BC385A7; Mon, 18 Apr 2022 12:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286224; bh=i7d4IMjg68LsHEXJVgI+Q2DYKMuVrFSB7ixi9ScfLgg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NyaRY2PwjjAv2GaaEEWM4dGghFIMojlKHuSt0JUwn9bQlnHAFbnWG6js8mxuAyVX3 cUI5XayAw1WETRHA/xmjyGG0PiQDM50QQlLp4t6a3ZyGvWSi1CQJIWdCxUPaGR4+np X5im3nvUFaFBK8hradAwRCG2euPeMn9UVQ9nu0C0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Michael Schmitz , Helge Deller Subject: [PATCH 4.14 040/284] video: fbdev: atari: Atari 2 bpp (STe) palette bugfix Date: Mon, 18 Apr 2022 14:10:21 +0200 Message-Id: <20220418121211.834573736@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Michael Schmitz commit c8be5edbd36ceed2ff3d6b8f8e40643c3f396ea3 upstream. The code to set the shifter STe palette registers has a long standing operator precedence bug, manifesting as colors set on a 2 bits per pixel frame buffer coming up with a distinctive blue tint. Add parentheses around the calculation of the per-color palette data before shifting those into their respective bit field position. This bug goes back a long way (2.4 days at the very least) so there won't be a Fixes: tag. Tested on ARAnyM as well on Falcon030 hardware. Cc: stable@vger.kernel.org Reported-by: Geert Uytterhoeven Link: https://lore.kernel.org/all/CAMuHMdU3ievhXxKR_xi_v3aumnYW7UNUO6qMdhgf= yWTyVSsCkQ@mail.gmail.com Tested-by: Michael Schmitz Tested-by: Geert Uytterhoeven Signed-off-by: Michael Schmitz Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/video/fbdev/atafb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -1713,9 +1713,9 @@ static int falcon_setcolreg(unsigned int ((blue & 0xfc00) >> 8)); if (regno < 16) { shifter_tt.color_reg[regno] =3D - (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | - (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | - ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); + ((((red & 0xe000) >> 13) | ((red & 0x1000) >> 12)) << 8) | + ((((green & 0xe000) >> 13) | ((green & 0x1000) >> 12)) << 4) | + ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); ((u32 *)info->pseudo_palette)[regno] =3D ((red & 0xf800) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11)); @@ -2001,9 +2001,9 @@ static int stste_setcolreg(unsigned int green >>=3D 12; if (ATARIHW_PRESENT(EXTD_SHIFTER)) shifter_tt.color_reg[regno] =3D - (((red & 0xe) >> 1) | ((red & 1) << 3) << 8) | - (((green & 0xe) >> 1) | ((green & 1) << 3) << 4) | - ((blue & 0xe) >> 1) | ((blue & 1) << 3); + ((((red & 0xe) >> 1) | ((red & 1) << 3)) << 8) | + ((((green & 0xe) >> 1) | ((green & 1) << 3)) << 4) | + ((blue & 0xe) >> 1) | ((blue & 1) << 3); else shifter_tt.color_reg[regno] =3D ((red & 0xe) << 7) | From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E65AC433EF for ; Mon, 18 Apr 2022 13:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242628AbiDRNlj (ORCPT ); Mon, 18 Apr 2022 09:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242044AbiDRNNS (ORCPT ); Mon, 18 Apr 2022 09:13:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 542362DA9C; Mon, 18 Apr 2022 05:50:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8E5B861256; Mon, 18 Apr 2022 12:50:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4184C385A1; Mon, 18 Apr 2022 12:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286258; bh=64WSwsWMU/xKi1MR4L5fR0tWrt3NkgAciY9O3eHCo/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A122EymkK11CdiN3Vr0/DTGUjvPYbA9gT1J8CCgPuqVMb8DjGyHx3zrmUUbeViiT+ QeMyrT9VVDe4l+F56hLou0vuZnmjCSJtaeeDiND2WVHrO1t2wg/Tx3v4+K6+U7Z2Yt IAuT+PXB+CSgBle+YAckHt8krlpclGLCz9igWgFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tudor Ambarus , Alexander Dahl , Nicolas Ferre Subject: [PATCH 4.14 041/284] ARM: dts: at91: sama5d2: Fix PMERRLOC resource size Date: Mon, 18 Apr 2022 14:10:22 +0200 Message-Id: <20220418121211.862607178@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Tudor Ambarus commit 0fb578a529ac7aca326a9fa475b4a6f58a756fda upstream. PMERRLOC resource size was set to 0x100, which resulted in HSMC_ERRLOCx register being truncated to offset x =3D 21, causing error correction to fail if more than 22 bit errors and if 24 or 32 bit error correction was supported. Fixes: d9c41bf30cf8 ("ARM: dts: at91: Declare EBI/NAND controllers") Signed-off-by: Tudor Ambarus Cc: # 4.13.x Acked-by: Alexander Dahl Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220111132301.906712-1-tudor.ambarus@micro= chip.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/arm/boot/dts/sama5d2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm/boot/dts/sama5d2.dtsi +++ b/arch/arm/boot/dts/sama5d2.dtsi @@ -1121,7 +1121,7 @@ pmecc: ecc-engine@f8014070 { compatible =3D "atmel,sama5d2-pmecc"; reg =3D <0xf8014070 0x490>, - <0xf8014500 0x100>; + <0xf8014500 0x200>; }; }; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54BA3C43219 for ; Mon, 18 Apr 2022 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244030AbiDRNnH (ORCPT ); Mon, 18 Apr 2022 09:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240108AbiDRNPH (ORCPT ); Mon, 18 Apr 2022 09:15:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B50243AA51; Mon, 18 Apr 2022 05:51:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 179AEB80E4E; Mon, 18 Apr 2022 12:51:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57C7FC385A7; Mon, 18 Apr 2022 12:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286273; bh=BG6+ol7tstZEZfMzxUu8U5+g5hiNZCpTOjP+NXtT7/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X1Tl56wCyoMaVMVoaKtUw+1yk/ChNZuLeG/48hX/9fHdgn/y/fpYjlKpi7O0msfsF /5bBEPdLS+LbYOpK38ZzCvbNzGRr6hwo7yXGY+HjtVfJ1VFbW0iwv5Rr/DHbDXEXEZ pODig9Ea/EqFSmUlYhhu2KbFZaYaQEl3fs4gXxm0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Marek Szyprowski , Alim Akhtar Subject: [PATCH 4.14 042/284] ARM: dts: exynos: fix UART3 pins configuration in Exynos5250 Date: Mon, 18 Apr 2022 14:10:23 +0200 Message-Id: <20220418121211.891209440@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Krzysztof Kozlowski commit 372d7027fed43c8570018e124cf78b89523a1f8e upstream. The gpa1-4 pin was put twice in UART3 pin configuration of Exynos5250, instead of proper pin gpa1-5. Fixes: f8bfe2b050f3 ("ARM: dts: add pin state information in client nodes f= or Exynos5 platforms") Cc: Signed-off-by: Krzysztof Kozlowski Tested-by: Marek Szyprowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20211230195325.328220-1-krzysztof.kozlowski= @canonical.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm/boot/dts/exynos5250-pinctrl.dtsi +++ b/arch/arm/boot/dts/exynos5250-pinctrl.dtsi @@ -257,7 +257,7 @@ }; =20 uart3_data: uart3-data { - samsung,pins =3D "gpa1-4", "gpa1-4"; + samsung,pins =3D "gpa1-4", "gpa1-5"; samsung,pin-function =3D ; samsung,pin-pud =3D ; samsung,pin-drv =3D ; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95E4CC4167E for ; Mon, 18 Apr 2022 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244097AbiDRNnU (ORCPT ); Mon, 18 Apr 2022 09:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241596AbiDRNQE (ORCPT ); Mon, 18 Apr 2022 09:16:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CFF53AA45; Mon, 18 Apr 2022 05:51:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7168EB80E44; Mon, 18 Apr 2022 12:51:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3CB9C385A8; Mon, 18 Apr 2022 12:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286277; bh=BJBLKKozBQ3LMK27fkuFAL4FdufGjxSsOVDfTpbzpKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gOY6nguIzLgwGWD7TZ2uDltEcacQaWy1kpkDiu5ohpqNs7KxxFxZeFBFEkUDFJsLp j1XssXSAXAmQ+0wt153S/XwrbgF/02xIeI3jv7VKhyL+opZtx2mEHNbQgmtQVIQRTy 0v5W5BuqMjCkQddrP2DOoTf0Rr4CYF4Yfs/ISDgU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Alim Akhtar Subject: [PATCH 4.14 043/284] ARM: dts: exynos: add missing HDMI supplies on SMDK5250 Date: Mon, 18 Apr 2022 14:10:24 +0200 Message-Id: <20220418121211.919491128@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Krzysztof Kozlowski commit 60a9914cb2061ba612a3f14f6ad329912b486360 upstream. Add required VDD supplies to HDMI block on SMDK5250. Without them, the HDMI driver won't probe. Because of lack of schematics, use same supplies as on Arndale 5250 board (voltage matches). Cc: # v3.15+ Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220208171823.226211-2-krzysztof.kozlowski= @canonical.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/arm/boot/dts/exynos5250-smdk5250.dts | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -117,6 +117,9 @@ =20 &hdmi { hpd-gpios =3D <&gpx3 7 GPIO_ACTIVE_HIGH>; + vdd-supply =3D <&ldo8_reg>; + vdd_osc-supply =3D <&ldo10_reg>; + vdd_pll-supply =3D <&ldo8_reg>; }; =20 &i2c_0 { From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 738A6C4321E for ; Mon, 18 Apr 2022 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244063AbiDRNnQ (ORCPT ); Mon, 18 Apr 2022 09:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241503AbiDRNQE (ORCPT ); Mon, 18 Apr 2022 09:16:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 364C23AA41; Mon, 18 Apr 2022 05:51:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B633561287; Mon, 18 Apr 2022 12:51:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF746C385A1; Mon, 18 Apr 2022 12:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286280; bh=uyKI9NfuAsg1H7QgPgrX80qRQkedSTzgCAc8mfglP2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jfj/535+N2UrLqDo7EDwnEMs26JqMi6YWMzgTcG99h4+UoDJDCqUQL+TVrEbmXigw C4DYAvG0ex0+4dVmnBkbNXH3kN4PfS8lI4OrsfK44EMaM+lQu7IRIsIyqEeArIBLJJ R3QRHIXNb1SqOryz9To15wcvACT8z+JDZTddcmwY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Alim Akhtar Subject: [PATCH 4.14 044/284] ARM: dts: exynos: add missing HDMI supplies on SMDK5420 Date: Mon, 18 Apr 2022 14:10:25 +0200 Message-Id: <20220418121211.948260093@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Krzysztof Kozlowski commit 453a24ded415f7fce0499c6b0a2c7b28f84911f2 upstream. Add required VDD supplies to HDMI block on SMDK5420. Without them, the HDMI driver won't probe. Because of lack of schematics, use same supplies as on Arndale Octa and Odroid XU3 boards (voltage matches). Cc: # v3.15+ Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220208171823.226211-3-krzysztof.kozlowski= @canonical.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/arm/boot/dts/exynos5420-smdk5420.dts | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/arm/boot/dts/exynos5420-smdk5420.dts +++ b/arch/arm/boot/dts/exynos5420-smdk5420.dts @@ -133,6 +133,9 @@ hpd-gpios =3D <&gpx3 7 GPIO_ACTIVE_HIGH>; pinctrl-names =3D "default"; pinctrl-0 =3D <&hdmi_hpd_irq>; + vdd-supply =3D <&ldo6_reg>; + vdd_osc-supply =3D <&ldo7_reg>; + vdd_pll-supply =3D <&ldo6_reg>; }; =20 &hsi2c_4 { From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5092C4167B for ; Mon, 18 Apr 2022 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244127AbiDRNnX (ORCPT ); Mon, 18 Apr 2022 09:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241474AbiDRNQV (ORCPT ); Mon, 18 Apr 2022 09:16:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63DEF3B282; Mon, 18 Apr 2022 05:51:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CC2B261267; Mon, 18 Apr 2022 12:51:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0B34C385A7; Mon, 18 Apr 2022 12:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286283; bh=3o60MGbp90aXjEh3M/qITHvtekpeqDke9s29V/+7rjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SXvFO8y56D8bLUsnkDW+wDELomPnWqpj4MeS0s1pBUC2xxT+x+6J+z0Z1BKcndf/+ dp0d4BOUe9vliTd9QJkV1LI6DDL2dXQjImg6bUSiy7Ol/SnOIpeG51pOWYBKnImOjF 4LAvAuRSKpIAnwmeJOts3LQU+9UMVc7okEjuuGsU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Stable@vger.kernel.org, Christian Lamparter , Kalle Valo Subject: [PATCH 4.14 045/284] carl9170: fix missing bit-wise or operator for tx_params Date: Mon, 18 Apr 2022 14:10:26 +0200 Message-Id: <20220418121211.976950077@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Colin Ian King commit 02a95374b5eebdbd3b6413fd7ddec151d2ea75a1 upstream. Currently tx_params is being re-assigned with a new value and the previous setting IEEE80211_HT_MCS_TX_RX_DIFF is being overwritten. The assignment operator is incorrect, the original intent was to bit-wise or the value in. Fix this by replacing the =3D operator with |=3D instead. Kudos to Christian Lamparter for suggesting the correct fix. Fixes: fe8ee9ad80b2 ("carl9170: mac80211 glue and command interface") Signed-off-by: Colin Ian King Cc: Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220125004406.344422-1-colin.i.king@gmail.= com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/wireless/ath/carl9170/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c @@ -1922,7 +1922,7 @@ static int carl9170_parse_eeprom(struct WARN_ON(!(tx_streams >=3D 1 && tx_streams <=3D IEEE80211_HT_MCS_TX_MAX_STREAMS)); =20 - tx_params =3D (tx_streams - 1) << + tx_params |=3D (tx_streams - 1) << IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT; =20 carl9170_band_2GHz.ht_cap.mcs.tx_params |=3D tx_params; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3EBCC41535 for ; Mon, 18 Apr 2022 13:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244148AbiDRNn1 (ORCPT ); Mon, 18 Apr 2022 09:43:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241766AbiDRNQk (ORCPT ); Mon, 18 Apr 2022 09:16:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F9F3B2A4; Mon, 18 Apr 2022 05:51:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 081066124E; Mon, 18 Apr 2022 12:51:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAFF0C385A1; Mon, 18 Apr 2022 12:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286286; bh=ougz0A3GVQnfqTBVPOaUoq+OCwWMjMUSH082GbCyOXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Otd9kC6fR/nTvGvsSrXTxvAuQqMCU+a53EFhfqI2VgkeHJqloNkhGPlAxxAke74FT 8O484v+WPeIC1AYciCNpOWGYy5ymSusTommMurPoIjRZjH0mmM/0NNST+W0RVuhzng DrPswGRgKrTkNoTTROU5TVft+ct+aVM/NBxE5y0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Pandruvada , "Rafael J. Wysocki" Subject: [PATCH 4.14 046/284] thermal: int340x: Increase bitmap size Date: Mon, 18 Apr 2022 14:10:27 +0200 Message-Id: <20220418121212.005004311@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Srinivas Pandruvada commit 668f69a5f863b877bc3ae129efe9a80b6f055141 upstream. The number of policies are 10, so can't be supported by the bitmap size of u8. Even though there are no platfoms with these many policies, but for correctness increase to u32. Signed-off-by: Srinivas Pandruvada Fixes: 16fc8eca1975 ("thermal/int340x_thermal: Add additional UUIDs") Cc: 5.1+ # 5.1+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/thermal/int340x_thermal/int3400_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/thermal/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/int340x_thermal/int3400_thermal.c @@ -53,7 +53,7 @@ struct int3400_thermal_priv { struct art *arts; int trt_count; struct trt *trts; - u8 uuid_bitmap; + u32 uuid_bitmap; int rel_misc_dev_res; int current_uuid_index; }; From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E2DEC433F5 for ; Mon, 18 Apr 2022 13:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243814AbiDRNi1 (ORCPT ); Mon, 18 Apr 2022 09:38:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243485AbiDRNKL (ORCPT ); Mon, 18 Apr 2022 09:10:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D8937BE3; Mon, 18 Apr 2022 05:49:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33B1EB80E59; Mon, 18 Apr 2022 12:49:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 669A8C385A9; Mon, 18 Apr 2022 12:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286156; bh=LMlQNGlYN3hy8CPToMdfFBPok9Av3xw6NjdEtCImleg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPVOlaCKADZVVNekCzlfb0TNxDAgrzY9bW6aip/6mqypSBxeak0IShYUeZ+7Bsww1 bnRSDpBMYPsiss5MwlLY2xjPXIb8bPYddsJdH5TWUXbgG5DAruBGCN1t7M2N1myf5t EsKg28B+UE/d/pDYbiLB4N8VYKN5dL9iDSzm73Co= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Dirk=20M=C3=BCller?= , Paul Menzel , Song Liu Subject: [PATCH 4.14 047/284] lib/raid6/test: fix multiple definition linking error Date: Mon, 18 Apr 2022 14:10:28 +0200 Message-Id: <20220418121212.034023729@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dirk M=C3=BCller commit a5359ddd052860bacf957e65fe819c63e974b3a6 upstream. GCC 10+ defaults to -fno-common, which enforces proper declaration of external references using "extern". without this change a link would fail with: lib/raid6/test/algos.c:28: multiple definition of `raid6_call'; lib/raid6/test/test.c:22: first defined here the pq.h header that is included already includes an extern declaration so we can just remove the redundant one here. Cc: Signed-off-by: Dirk M=C3=BCller Reviewed-by: Paul Menzel Signed-off-by: Song Liu Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- lib/raid6/test/test.c | 1 - 1 file changed, 1 deletion(-) --- a/lib/raid6/test/test.c +++ b/lib/raid6/test/test.c @@ -22,7 +22,6 @@ #define NDISKS 16 /* Including P and Q */ =20 const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SI= ZE))); -struct raid6_calls raid6_call; =20 char *dataptrs[NDISKS]; char data[NDISKS][PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62A61C433EF for ; Mon, 18 Apr 2022 13:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242349AbiDRNk1 (ORCPT ); Mon, 18 Apr 2022 09:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243146AbiDRNJv (ORCPT ); Mon, 18 Apr 2022 09:09:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CA33377E6; Mon, 18 Apr 2022 05:49:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB30861267; Mon, 18 Apr 2022 12:49:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92AF5C385A8; Mon, 18 Apr 2022 12:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286160; bh=3SzeC/Gz/Ac+TTZClLIUog0e21eiXA/HtE2IFS8FnkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Am3RNPLkFGglxlpZZjJxeNhypSOK1vnpDNQmLX/eRU+ZRYs8PiPwkvIFMfdM8ErJw 2Lw68/AYCZnK2Zn4dzJA+ENSers/e8iK/MQQcRL+eDpJ7lJC0CM1r6d0+HzBaSdjtS gkEHh3YOcYIv6/yeFMbX99WSfPrQ4l2HcC5Ccx0s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan-Benedict Glaw , Sudip Mukherjee , "Maciej W. Rozycki" , Thomas Bogendoerfer Subject: [PATCH 4.14 048/284] DEC: Limit PMAX memory probing to R3k systems Date: Mon, 18 Apr 2022 14:10:29 +0200 Message-Id: <20220418121212.062614390@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Maciej W. Rozycki commit 244eae91a94c6dab82b3232967d10eeb9dfa21c6 upstream. Recent tightening of the opcode table in binutils so as to consistently disallow the assembly or disassembly of CP0 instructions not supported by the processor architecture chosen has caused a regression like below: arch/mips/dec/prom/locore.S: Assembler messages: arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this process= or: r4600 (mips3) `rfe' in a piece of code used to probe for memory with PMAX DECstation models, which have non-REX firmware. Those computers always have an R2000 CPU and consequently the exception handler used in memory probing uses the RFE instruction, which those processors use. While adding 64-bit support this code was correctly excluded for 64-bit configurations, however it should have also been excluded for irrelevant 32-bit configurations. Do this now then, and only enable PMAX memory probing for R3k systems. Reported-by: Jan-Benedict Glaw Reported-by: Sudip Mukherjee Signed-off-by: Maciej W. Rozycki Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org # v2.6.12+ Signed-off-by: Thomas Bogendoerfer Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- arch/mips/dec/prom/Makefile | 2 +- arch/mips/include/asm/dec/prom.h | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) --- a/arch/mips/dec/prom/Makefile +++ b/arch/mips/dec/prom/Makefile @@ -5,4 +5,4 @@ =20 lib-y +=3D init.o memory.o cmdline.o identify.o console.o =20 -lib-$(CONFIG_32BIT) +=3D locore.o +lib-$(CONFIG_CPU_R3000) +=3D locore.o --- a/arch/mips/include/asm/dec/prom.h +++ b/arch/mips/include/asm/dec/prom.h @@ -47,16 +47,11 @@ */ #define REX_PROM_MAGIC 0x30464354 =20 -#ifdef CONFIG_64BIT - -#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ - -#else /* !CONFIG_64BIT */ - -#define prom_is_rex(magic) ((magic) =3D=3D REX_PROM_MAGIC) - -#endif /* !CONFIG_64BIT */ - +/* KN04 and KN05 are REX PROMs, so only do the check for R3k systems. */ +static inline bool prom_is_rex(u32 magic) +{ + return !IS_ENABLED(CONFIG_CPU_R3000) || magic =3D=3D REX_PROM_MAGIC; +} =20 /* * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6247FC433EF for ; Mon, 18 Apr 2022 13:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242362AbiDRNgC (ORCPT ); Mon, 18 Apr 2022 09:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243221AbiDRNJ5 (ORCPT ); Mon, 18 Apr 2022 09:09:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2839E37A0A; Mon, 18 Apr 2022 05:49:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6BA66124D; Mon, 18 Apr 2022 12:49:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D401FC385A1; Mon, 18 Apr 2022 12:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286163; bh=5Z78gfGHfHm7csyWYfRHlrzotpJOLnNIrOIF5IitPrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PIDphFe7g2FBmLJ7HzBZrxzYsVEYrL1+TFB95cJXbvXWbD44JaZvT7iZyGXy1m7QX T7ZqghQ2JFW+ZIijOoJFqkZMCRH1IQcC+FbxCxWD2SHvjCw4J2/JdyNzSeNX0BvMRJ ZXvoQKP0dDyjnul7Al/x4/fcZZg0rHy7P/8mEEeY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Lad, Prabhakar" , Johan Hovold , Hans Verkuil , Mauro Carvalho Chehab , Lad@vger.kernel.org Subject: [PATCH 4.14 049/284] media: davinci: vpif: fix unbalanced runtime PM get Date: Mon, 18 Apr 2022 14:10:30 +0200 Message-Id: <20220418121212.091259923@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Johan Hovold commit 4a321de239213300a714fa0353a5f1272d381a44 upstream. Make sure to balance the runtime PM usage counter on driver unbind. Fixes: 407ccc65bfd2 ("[media] davinci: vpif: add pm_runtime support") Cc: stable@vger.kernel.org # 3.9 Cc: Lad, Prabhakar Signed-off-by: Johan Hovold Reviewed-by: Lad Prabhakar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/media/platform/davinci/vpif.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/media/platform/davinci/vpif.c +++ b/drivers/media/platform/davinci/vpif.c @@ -495,6 +495,7 @@ static int vpif_probe(struct platform_de =20 static int vpif_remove(struct platform_device *pdev) { + pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; } From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45FE3C433F5 for ; Mon, 18 Apr 2022 13:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242449AbiDRNgS (ORCPT ); Mon, 18 Apr 2022 09:36:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243516AbiDRNKM (ORCPT ); Mon, 18 Apr 2022 09:10:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2CA838793; Mon, 18 Apr 2022 05:49:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1661061254; Mon, 18 Apr 2022 12:49:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A9A6C385A1; Mon, 18 Apr 2022 12:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286166; bh=3ONAA+db7xXX+XCtiELFowQDfk4co1geMc+6o3v+NJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SrwmrRWsrkzFoVNM3J7ecedrPdR3W+yc7rK6YX8RQgMDlkuo2AbiHr0YuXzzVsJ4r 3Kxm1XPyzByUlha+DWmoI0vuHxJgFDayGJgy3Okd2JlXGqR3u0ZYBs5Y/Jpo2CywY8 3XnmtJOsnDIqE9YF1AYdGprCEBWjcu7RbZ+DYdSQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arend van Spriel , Hector Martin , Andy Shevchenko , Kalle Valo Subject: [PATCH 4.14 050/284] brcmfmac: firmware: Allocate space for default boardrev in nvram Date: Mon, 18 Apr 2022 14:10:31 +0200 Message-Id: <20220418121212.119599509@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Hector Martin commit d19d8e3ba256f81ea4a27209dbbd1f0a00ef1903 upstream. If boardrev is missing from the NVRAM we add a default one, but this might need more space in the output buffer than was allocated. Ensure we have enough padding for this in the buffer. Fixes: 46f2b38a91b0 ("brcmfmac: insert default boardrev in nvram data if mi= ssing") Reviewed-by: Arend van Spriel Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Reviewed-by: Andy Shevchenko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220131160713.245637-3-marcan@marcan.st Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -216,6 +216,8 @@ static int brcmf_init_nvram_parser(struc size =3D BRCMF_FW_MAX_NVRAM_SIZE; else size =3D data_len; + /* Add space for properties we may add */ + size +=3D strlen(BRCMF_FW_DEFAULT_BOARDREV) + 1; /* Alloc for extra 0 byte + roundup by 4 + length field */ size +=3D 1 + 3 + sizeof(u32); nvp->nvram =3D kzalloc(size, GFP_KERNEL); From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC603C4167B for ; Mon, 18 Apr 2022 13:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243966AbiDRNiq (ORCPT ); Mon, 18 Apr 2022 09:38:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243437AbiDRNKI (ORCPT ); Mon, 18 Apr 2022 09:10:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07C4D37BE1; Mon, 18 Apr 2022 05:49:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 05613B80E44; Mon, 18 Apr 2022 12:49:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E6D1C385A7; Mon, 18 Apr 2022 12:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286169; bh=1nM13nlbIB+HiWGBninAH9KPbQgWQELzSTvvps9GEwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F1oFuGjAs+k8zeG1B4eLw1C4bhgksikJ9n/ogDyPQFivlJ1jogc1nvihtZmP7zHDM Yk8NV2+v9OSLbIb+TWlQT5cajKQFHCC3JMQor+Aihi2jCv4xDTJ/1UV+nGatwh4n/L ShZ+nhGrfA98X/tM/l3YZJs+IK+zeheAOsQ7inoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Arend van Spriel , Andy Shevchenko , Hector Martin , Kalle Valo Subject: [PATCH 4.14 051/284] brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio Date: Mon, 18 Apr 2022 14:10:32 +0200 Message-Id: <20220418121212.147667602@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Hector Martin commit 9466987f246758eb7e9071ae58005253f631271e upstream. The alignment check was wrong (e.g. & 4 instead of & 3), and the logic was also inefficient if the length was not a multiple of 4, since it would needlessly fall back to copying the entire buffer bytewise. We already have a perfectly good memcpy_toio function, so just call that instead of rolling our own copy logic here. brcmf_pcie_init_ringbuffers was already using it anyway. Fixes: 9e37f045d5e7 ("brcmfmac: Adding PCIe bus layer support.") Reviewed-by: Linus Walleij Reviewed-by: Arend van Spriel Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220131160713.245637-6-marcan@marcan.st Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 48 +----------= ----- 1 file changed, 4 insertions(+), 44 deletions(-) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -22,6 +22,7 @@ #include #include #include +#include #include =20 #include @@ -429,47 +430,6 @@ brcmf_pcie_write_ram32(struct brcmf_pcie =20 =20 static void -brcmf_pcie_copy_mem_todev(struct brcmf_pciedev_info *devinfo, u32 mem_offs= et, - void *srcaddr, u32 len) -{ - void __iomem *address =3D devinfo->tcm + mem_offset; - __le32 *src32; - __le16 *src16; - u8 *src8; - - if (((ulong)address & 4) || ((ulong)srcaddr & 4) || (len & 4)) { - if (((ulong)address & 2) || ((ulong)srcaddr & 2) || (len & 2)) { - src8 =3D (u8 *)srcaddr; - while (len) { - iowrite8(*src8, address); - address++; - src8++; - len--; - } - } else { - len =3D len / 2; - src16 =3D (__le16 *)srcaddr; - while (len) { - iowrite16(le16_to_cpu(*src16), address); - address +=3D 2; - src16++; - len--; - } - } - } else { - len =3D len / 4; - src32 =3D (__le32 *)srcaddr; - while (len) { - iowrite32(le32_to_cpu(*src32), address); - address +=3D 4; - src32++; - len--; - } - } -} - - -static void brcmf_pcie_copy_dev_tomem(struct brcmf_pciedev_info *devinfo, u32 mem_offs= et, void *dstaddr, u32 len) { @@ -1454,8 +1414,8 @@ static int brcmf_pcie_download_fw_nvram( return err; =20 brcmf_dbg(PCIE, "Download FW %s\n", devinfo->fw_name); - brcmf_pcie_copy_mem_todev(devinfo, devinfo->ci->rambase, - (void *)fw->data, fw->size); + memcpy_toio(devinfo->tcm + devinfo->ci->rambase, + (void *)fw->data, fw->size); =20 resetintr =3D get_unaligned_le32(fw->data); release_firmware(fw); @@ -1469,7 +1429,7 @@ static int brcmf_pcie_download_fw_nvram( brcmf_dbg(PCIE, "Download NVRAM %s\n", devinfo->nvram_name); address =3D devinfo->ci->rambase + devinfo->ci->ramsize - nvram_len; - brcmf_pcie_copy_mem_todev(devinfo, address, nvram, nvram_len); + memcpy_toio(devinfo->tcm + address, nvram, nvram_len); brcmf_fw_nvram_free(nvram); } else { brcmf_dbg(PCIE, "No matching NVRAM file found %s\n", From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC941C43217 for ; Mon, 18 Apr 2022 13:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243926AbiDRNih (ORCPT ); Mon, 18 Apr 2022 09:38:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243438AbiDRNKI (ORCPT ); Mon, 18 Apr 2022 09:10:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FCF237BFF; Mon, 18 Apr 2022 05:49:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 253DAB80D9C; Mon, 18 Apr 2022 12:49:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7095EC385A9; Mon, 18 Apr 2022 12:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286172; bh=sBAlfitv7a3m15anPihIPdD3jKEWTRAgL6gHf+iR2EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TxsF93e5RLHypZZ8AOZHMboIjrlL6pn7VVTBXjPMxHiFejCFAzCVkuIXG0AJqiy0f uI4ZlV3nnwj3LFhXxTveACDMBDlTH2rvkTlVCzUeM5akPZjg6HUrairzRJSQsMdTS8 lyvIp1ebZUrXzTeme3bFHkINDcnPOQ8T4VMs9zpw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liguang Zhang , Bjorn Helgaas , Lukas Wunner Subject: [PATCH 4.14 052/284] PCI: pciehp: Clear cmd_busy bit in polling mode Date: Mon, 18 Apr 2022 14:10:33 +0200 Message-Id: <20220418121212.175619271@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liguang Zhang commit 92912b175178c7e895f5e5e9f1e30ac30319162b upstream. Writes to a Downstream Port's Slot Control register are PCIe hotplug "commands." If the Port supports Command Completed events, software must wait for a command to complete before writing to Slot Control again. pcie_do_write_cmd() sets ctrl->cmd_busy when it writes to Slot Control. If software notification is enabled, i.e., PCI_EXP_SLTCTL_HPIE and PCI_EXP_SLTCTL_CCIE are set, ctrl->cmd_busy is cleared by pciehp_isr(). But when software notification is disabled, as it is when pcie_init() powers off an empty slot, pcie_wait_cmd() uses pcie_poll_cmd() to poll for command completion, and it neglects to clear ctrl->cmd_busy, which leads to spurious timeouts: pcieport 0000:00:03.0: pciehp: Timeout on hotplug command 0x01c0 (issued = 2264 msec ago) pcieport 0000:00:03.0: pciehp: Timeout on hotplug command 0x05c0 (issued = 2288 msec ago) Clear ctrl->cmd_busy in pcie_poll_cmd() when it detects a Command Completed event (PCI_EXP_SLTSTA_CC). [bhelgaas: commit log] Fixes: a5dd4b4b0570 ("PCI: pciehp: Wait for hotplug command completion wher= e necessary") Link: https://lore.kernel.org/r/20211111054258.7309-1-zhangliguang@linux.al= ibaba.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D215143 Link: https://lore.kernel.org/r/20211126173309.GA12255@wunner.de Signed-off-by: Liguang Zhang Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/pci/hotplug/pciehp_hpc.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -120,6 +120,8 @@ static int pcie_poll_cmd(struct controll if (slot_status & PCI_EXP_SLTSTA_CC) { pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, PCI_EXP_SLTSTA_CC); + ctrl->cmd_busy =3D 0; + smp_mb(); return 1; } if (timeout < 0) From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D17FBC433F5 for ; Mon, 18 Apr 2022 13:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242523AbiDRNhJ (ORCPT ); Mon, 18 Apr 2022 09:37:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243707AbiDRNKY (ORCPT ); Mon, 18 Apr 2022 09:10:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A07DD26DE; Mon, 18 Apr 2022 05:49:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 613F7B80EE1; Mon, 18 Apr 2022 12:49:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3C81C385A8; Mon, 18 Apr 2022 12:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286176; bh=jSmZMcvSkSe1LBly2aT57pfhxF45RhCNh/KbiUBO+tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vy4bwrnYISuvWwKwfO7p1TLc1gv9M7OKAucsHyrWPjdwURYO6bFkd0ny7TU8tv6L8 Fq9YmyYWaJIm6PVUvtmNwahaUbHIJh0XNKOr8bpTNvyvBK5jUeoVqQb8ag/U7pPRYK NOumCVJUKIeR9vZm+HI8zZhT1yjTEHI/xY9Sdyyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 053/284] crypto: authenc - Fix sleep in atomic context in decrypt_tail Date: Mon, 18 Apr 2022 14:10:34 +0200 Message-Id: <20220418121212.204177542@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Herbert Xu [ Upstream commit 66eae850333d639fc278d6f915c6fc01499ea893 ] The function crypto_authenc_decrypt_tail discards its flags argument and always relies on the flags from the original request when starting its sub-request. This is clearly wrong as it may cause the SLEEPABLE flag to be set when it shouldn't. Fixes: 92d95ba91772 ("crypto: authenc - Convert to new AEAD interface") Reported-by: Corentin Labbe Signed-off-by: Herbert Xu Tested-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- crypto/authenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/authenc.c b/crypto/authenc.c index 053287dfad65..533e811a0899 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -268,7 +268,7 @@ static int crypto_authenc_decrypt_tail(struct aead_requ= est *req, dst =3D scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); =20 skcipher_request_set_tfm(skreq, ctx->enc); - skcipher_request_set_callback(skreq, aead_request_flags(req), + skcipher_request_set_callback(skreq, flags, req->base.complete, req->base.data); skcipher_request_set_crypt(skreq, src, dst, req->cryptlen - authsize, req->iv); --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A75EDC433F5 for ; Mon, 18 Apr 2022 13:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242196AbiDRNgm (ORCPT ); Mon, 18 Apr 2022 09:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243756AbiDRNK0 (ORCPT ); Mon, 18 Apr 2022 09:10:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5BE6172; Mon, 18 Apr 2022 05:49:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77B23B80E4E; Mon, 18 Apr 2022 12:49:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B14E1C385A7; Mon, 18 Apr 2022 12:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286179; bh=F3GUFIFxn3xZhMHv+WyQhBku19qiHak4wQw1BJOJxO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VhcTdB1Gwta6Zrcrw5fdl1C+PSaNlLc41kcqo1xps/8j6zpZxhJCQpHjtkRWvDrXv Ls6Gr4So9td2e5cefrPm61tZA84BkJKPaBpFLJttpAYe4Jllmwg/5ouSaUACT2ufGR UsimkxXiPH2BEJtE7BO2hzP9yBt638fthqV6P0fc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomas Paukrt , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 054/284] crypto: mxs-dcp - Fix scatterlist processing Date: Mon, 18 Apr 2022 14:10:35 +0200 Message-Id: <20220418121212.232001320@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Tomas Paukrt [ Upstream commit 28e9b6d8199a3f124682b143800c2dacdc3d70dd ] This patch fixes a bug in scatterlist processing that may cause incorrect A= ES block encryption/decryption. Fixes: 2e6d793e1bf0 ("crypto: mxs-dcp - Use sg_mapping_iter to copy data") Signed-off-by: Tomas Paukrt Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/crypto/mxs-dcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index e986be405411..3e4068badffd 100644 --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c @@ -328,7 +328,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_= request *arq) memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128); } =20 - for_each_sg(req->src, src, sg_nents(src), i) { + for_each_sg(req->src, src, sg_nents(req->src), i) { src_buf =3D sg_virt(src); len =3D sg_dma_len(src); tlen +=3D len; --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5909BC433EF for ; Mon, 18 Apr 2022 13:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242934AbiDRNg2 (ORCPT ); Mon, 18 Apr 2022 09:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243538AbiDRNKN (ORCPT ); Mon, 18 Apr 2022 09:10:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D30381BB; Mon, 18 Apr 2022 05:49:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6EC261256; Mon, 18 Apr 2022 12:49:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4AB2C385A7; Mon, 18 Apr 2022 12:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286182; bh=2OoyKwpv7vWB8e0xZfFtSi74rRIOR51x8Ps0LTdmj9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b08OYjPlvmmXv45aNJWpeTCWXcIqdn3iyZzYByia4QhdmHrSgEmvbEjGSUPYPiai+ wtGLW8g+FDaC7PkaN0gTOVRTL4SXRYJJjNj49C7+QkSDmtA0Z0ql8yluWHOJFSElmM K0SowosXT6jSiGAe2Wg8ukZ3asFEkUrJdncAXXSI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 4.14 055/284] spi: tegra114: Add missing IRQ check in tegra_spi_probe Date: Mon, 18 Apr 2022 14:10:36 +0200 Message-Id: <20220418121212.259396931@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin [ Upstream commit 4f92724d4b92c024e721063f520d66e11ca4b54b ] This func misses checking for platform_get_irq()'s call and may passes the negative error codes to request_threaded_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with invalid IRQ #s. Fixes: f333a331adfa ("spi/tegra114: add spi driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220128165238.25615-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/spi/spi-tegra114.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index 0e1a8d7aa322..9758b7f7e92f 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -1136,6 +1136,10 @@ static int tegra_spi_probe(struct platform_device *p= dev) tspi->phys =3D r->start; =20 spi_irq =3D platform_get_irq(pdev, 0); + if (spi_irq < 0) { + ret =3D spi_irq; + goto exit_free_master; + } tspi->irq =3D spi_irq; =20 tspi->clk =3D devm_clk_get(&pdev->dev, "spi"); --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99EF4C433F5 for ; Mon, 18 Apr 2022 13:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242579AbiDRNhT (ORCPT ); Mon, 18 Apr 2022 09:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243911AbiDRNKf (ORCPT ); Mon, 18 Apr 2022 09:10:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B39C38BCB; Mon, 18 Apr 2022 05:49:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0CC0161267; Mon, 18 Apr 2022 12:49:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0F89C385A7; Mon, 18 Apr 2022 12:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286185; bh=3SRV4St52/FhRN6i2PSM1NQl46JAcRfsEjy14dO9vks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fPUW7bKQJRyUNrU08vcvHC/TRojFwexokC7QpuOPJQcMBbvmBWBN2ydyezFjsG6nJ 7DO1q5bldiJlUfCz45iIEutLzmT2MVoHUrffHCmp8yC+JeLr5hRkgvC7mk4kP1A6Ow wLg7K+a4KtKmdhThpUgCYficVu7XzXOxt/H18nEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "kernelci.org bot" , Muhammad Usama Anjum , Dave Hansen , Sasha Levin Subject: [PATCH 4.14 056/284] selftests/x86: Add validity check and allow field splitting Date: Mon, 18 Apr 2022 14:10:37 +0200 Message-Id: <20220418121212.287228499@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Muhammad Usama Anjum [ Upstream commit b06e15ebd5bfb670f93c7f11a29b8299c1178bc6 ] Add check to test if CC has a string. CC can have multiple sub-strings like "ccache gcc". Erorr pops up if it is treated as single string and double quotes are used around it. This can be fixed by removing the quotes and not treating CC as a single string. Fixes: e9886ace222e ("selftests, x86: Rework x86 target architecture detect= ion") Reported-by: "kernelci.org bot" Signed-off-by: Muhammad Usama Anjum Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220214184109.3739179-2-usama.anjum@collab= ora.com Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- tools/testing/selftests/x86/check_cc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/x86/check_cc.sh b/tools/testing/selfte= sts/x86/check_cc.sh index 172d3293fb7b..356689c56397 100755 --- a/tools/testing/selftests/x86/check_cc.sh +++ b/tools/testing/selftests/x86/check_cc.sh @@ -7,7 +7,7 @@ CC=3D"$1" TESTPROG=3D"$2" shift 2 =20 -if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then +if [ -n "$CC" ] && $CC -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then echo 1 else echo 0 --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FE43C433F5 for ; Mon, 18 Apr 2022 13:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240027AbiDRNg5 (ORCPT ); Mon, 18 Apr 2022 09:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243729AbiDRNKY (ORCPT ); Mon, 18 Apr 2022 09:10:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1375E272A; Mon, 18 Apr 2022 05:49:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7814F61254; Mon, 18 Apr 2022 12:49:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6ACF6C385A1; Mon, 18 Apr 2022 12:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286191; bh=77qcZ1Uzak7g1HQpiucAyiTuDej5Yx4twTR1oQQDeQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gj1XhWoB2wkVx2xVwEOklXDy40a5yHHNV01nUiGtZ/dAhVLiTFwDT7ENsJVvSCtPf iKYzsoA3g4LjH2SBPTkEf4tz+1gAJmyXOa9WX7U3uokmC4UEYW57ttDIKjCYBFwQh+ f89Z/Icenfs24Z8s9CBHeQfo/AcW+p4WkeO5OgJQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wang Qing , Andy Shevchenko , Mark Brown , Sasha Levin Subject: [PATCH 4.14 057/284] spi: pxa2xx-pci: Balance reference count for PCI DMA device Date: Mon, 18 Apr 2022 14:10:38 +0200 Message-Id: <20220418121212.315243090@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Andy Shevchenko [ Upstream commit 609d7ffdc42199a0ec949db057e3b4be6745d6c5 ] The pci_get_slot() increases its reference count, the caller must decrement the reference count by calling pci_dev_put(). Fixes: 743485ea3bee ("spi: pxa2xx-pci: Do a specific setup in a separate fu= nction") Fixes: 25014521603f ("spi: pxa2xx-pci: Enable DMA for Intel Merrifield") Reported-by: Wang Qing Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220223191637.31147-1-andriy.shevchenko@li= nux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/spi/spi-pxa2xx-pci.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index 1736a48bbcce..54e316eb0891 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -72,14 +72,23 @@ static bool lpss_dma_filter(struct dma_chan *chan, void= *param) return true; } =20 +static void lpss_dma_put_device(void *dma_dev) +{ + pci_dev_put(dma_dev); +} + static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) { struct pci_dev *dma_dev; + int ret; =20 c->num_chipselect =3D 1; c->max_clk_rate =3D 50000000; =20 dma_dev =3D pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); + ret =3D devm_add_action_or_reset(&dev->dev, lpss_dma_put_device, dma_dev); + if (ret) + return ret; =20 if (c->tx_param) { struct dw_dma_slave *slave =3D c->tx_param; @@ -103,8 +112,9 @@ static int lpss_spi_setup(struct pci_dev *dev, struct p= xa_spi_info *c) =20 static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) { - struct pci_dev *dma_dev =3D pci_get_slot(dev->bus, PCI_DEVFN(21, 0)); struct dw_dma_slave *tx, *rx; + struct pci_dev *dma_dev; + int ret; =20 switch (PCI_FUNC(dev->devfn)) { case 0: @@ -129,6 +139,11 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct= pxa_spi_info *c) return -ENODEV; } =20 + dma_dev =3D pci_get_slot(dev->bus, PCI_DEVFN(21, 0)); + ret =3D devm_add_action_or_reset(&dev->dev, lpss_dma_put_device, dma_dev); + if (ret) + return ret; + tx =3D c->tx_param; tx->dma_dev =3D &dma_dev->dev; =20 --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A6EAC433F5 for ; Mon, 18 Apr 2022 13:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242308AbiDRNgt (ORCPT ); Mon, 18 Apr 2022 09:36:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243775AbiDRNK1 (ORCPT ); Mon, 18 Apr 2022 09:10:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E7B38BE6; Mon, 18 Apr 2022 05:49:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 37EA9B80D9C; Mon, 18 Apr 2022 12:49:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A41BFC385A1; Mon, 18 Apr 2022 12:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286195; bh=Z+memAqozLRat+c4a6Ee/jBxhRozmCAnZLdoYOh8JHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UoqpJnaPg7LYlsVS3CfayeQKxLVOyCKvjnpMdHJFRCrlk9Y9ieN4YMkLG/xHyoq3w 7TWac5XwGenvi6g6mFz7nNhPwbKfNOYB4lT/BZr/laaR6GPXAlRxMyigqbrwgIgKtE 3L/P2uqoYZDHij19qgpi4g0jPIYK7lewvcTubPvc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Patrick Rudolph , Marcello Sylvester Bauer , Alan Tull , Guenter Roeck , Sasha Levin Subject: [PATCH 4.14 058/284] hwmon: (pmbus) Add mutex to regulator ops Date: Mon, 18 Apr 2022 14:10:39 +0200 Message-Id: <20220418121212.343156460@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Patrick Rudolph [ Upstream commit 686d303ee6301261b422ea51e64833d7909a2c36 ] On PMBUS devices with multiple pages, the regulator ops need to be protected with the update mutex. This prevents accidentally changing the page in a separate thread while operating on the PMBUS_OPERATION register. Tested on Infineon xdpe11280 while a separate thread polls for sensor data. Signed-off-by: Patrick Rudolph Signed-off-by: Marcello Sylvester Bauer Link: https://lore.kernel.org/r/b991506bcbf665f7af185945f70bf9d5cf04637c.16= 45804976.git.sylv@sylv.io Fixes: ddbb4db4ced1b ("hwmon: (pmbus) Add regulator support") Cc: Alan Tull Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/hwmon/pmbus/pmbus_core.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_c= ore.c index cb9064ac4977..66c72aedde5e 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -1861,10 +1861,14 @@ static int pmbus_regulator_is_enabled(struct regula= tor_dev *rdev) { struct device *dev =3D rdev_get_dev(rdev); struct i2c_client *client =3D to_i2c_client(dev->parent); + struct pmbus_data *data =3D i2c_get_clientdata(client); u8 page =3D rdev_get_id(rdev); int ret; =20 + mutex_lock(&data->update_lock); ret =3D pmbus_read_byte_data(client, page, PMBUS_OPERATION); + mutex_unlock(&data->update_lock); + if (ret < 0) return ret; =20 @@ -1875,11 +1879,17 @@ static int _pmbus_regulator_on_off(struct regulator= _dev *rdev, bool enable) { struct device *dev =3D rdev_get_dev(rdev); struct i2c_client *client =3D to_i2c_client(dev->parent); + struct pmbus_data *data =3D i2c_get_clientdata(client); u8 page =3D rdev_get_id(rdev); + int ret; =20 - return pmbus_update_byte_data(client, page, PMBUS_OPERATION, - PB_OPERATION_CONTROL_ON, - enable ? PB_OPERATION_CONTROL_ON : 0); + mutex_lock(&data->update_lock); + ret =3D pmbus_update_byte_data(client, page, PMBUS_OPERATION, + PB_OPERATION_CONTROL_ON, + enable ? PB_OPERATION_CONTROL_ON : 0); + mutex_unlock(&data->update_lock); + + return ret; } =20 static int pmbus_regulator_enable(struct regulator_dev *rdev) --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7996FC433FE for ; Mon, 18 Apr 2022 13:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243734AbiDRNiW (ORCPT ); Mon, 18 Apr 2022 09:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243861AbiDRNKa (ORCPT ); Mon, 18 Apr 2022 09:10:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A2C6387AF; Mon, 18 Apr 2022 05:50:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 531A8B80E44; Mon, 18 Apr 2022 12:49:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B40C0C385A1; Mon, 18 Apr 2022 12:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286198; bh=KTN0X4FW5gLMAt9HwX2qa26OsxYjrrPzmMtT5dx7FlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GWeg6El1MwT5lDg7jsoz2BHl1TqDovwdtmC7+jHx+oNCMrsCw2EqAbI3vnwajvJjr mZDRsH1E9ONiK1JqqqKk3Qx41faqgePdqBS0IYgkLni3a9OCnO5fIAmUEG0RfZVpu2 IOTtpfXp87X6TqNK7BF1t7utKuK1iGyX+PbxPnPo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , Armin Wolf , Hans de Goede , Sasha Levin Subject: [PATCH 4.14 059/284] hwmon: (sch56xx-common) Replace WDOG_ACTIVE with WDOG_HW_RUNNING Date: Mon, 18 Apr 2022 14:10:40 +0200 Message-Id: <20220418121212.371027809@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Armin Wolf [ Upstream commit 647d6f09bea7dacf4cdb6d4ea7e3051883955297 ] If the watchdog was already enabled by the BIOS after booting, the watchdog infrastructure needs to regularly send keepalives to prevent a unexpected reset. WDOG_ACTIVE only serves as an status indicator for userspace, we want to use WDOG_HW_RUNNING instead. Since my Fujitsu Esprimo P720 does not support the watchdog, this change is compile-tested only. Suggested-by: Guenter Roeck Fixes: fb551405c0f8 (watchdog: sch56xx: Use watchdog core) Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220131211935.3656-5-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- drivers/hwmon/sch56xx-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c index bda3d5285586..e1c4e6937a64 100644 --- a/drivers/hwmon/sch56xx-common.c +++ b/drivers/hwmon/sch56xx-common.c @@ -437,7 +437,7 @@ struct sch56xx_watchdog_data *sch56xx_watchdog_register= (struct device *parent, if (nowayout) set_bit(WDOG_NO_WAY_OUT, &data->wddev.status); if (output_enable & SCH56XX_WDOG_OUTPUT_ENABLE) - set_bit(WDOG_ACTIVE, &data->wddev.status); + set_bit(WDOG_HW_RUNNING, &data->wddev.status); =20 /* Since the watchdog uses a downcounter there is no register to read the BIOS set timeout from (if any was set at all) -> --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACFA5C4332F for ; Mon, 18 Apr 2022 13:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243889AbiDRNi3 (ORCPT ); Mon, 18 Apr 2022 09:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243948AbiDRNKi (ORCPT ); Mon, 18 Apr 2022 09:10:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD503917F; Mon, 18 Apr 2022 05:50:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F3C73B80E4B; Mon, 18 Apr 2022 12:50:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29AFAC385A7; Mon, 18 Apr 2022 12:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286201; bh=YTVxqVxYQM8WIfXeWtG3qYntEBSl/XW6V02J/yT4i6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EfpRxqR1vnXPryg/f2mqNCPUdbMKGZbTHPTX+BTLXC3d0XXmGR0rBpLdZ94XGiTZR 4g0lTf3z3yCdzYQTIHnLhcrGFzksmnFWgwcNXW8J3/9+NYitP4EzDdmuiSly6+ec4V 08yJKl6cytWkPog5lgMW09vzfu1mJ97CRxETid50= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Igor Zhbanov , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.14 060/284] PM: hibernate: fix __setup handler error handling Date: Mon, 18 Apr 2022 14:10:41 +0200 Message-Id: <20220418121212.398792645@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Randy Dunlap [ Upstream commit ba7ffcd4c4da374b0f64666354eeeda7d3827131 ] If an invalid value is used in "resumedelay=3D", it is silently ignored. Add a warning message and then let the __setup handler return 1 to indicate that the kernel command line option has been handled. Fixes: 317cf7e5e85e3 ("PM / hibernate: convert simple_strtoul to kstrtoul") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing --- kernel/power/hibernate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index e68b1c20ad3d..f4ecb23c9194 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -1186,7 +1186,7 @@ static int __init resumedelay_setup(char *str) int rc =3D kstrtouint(str, 0, &resume_delay); =20 if (rc) - return rc; + pr_warn("resumedelay: bad option string '%s'\n", str); return 1; } =20 --=20 2.34.1 From nobody Mon May 11 02:04:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3841C433F5 for ; Mon, 18 Apr 2022 13:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242907AbiDRNhX (ORCPT ); Mon, 18 Apr 2022 09:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243847AbiDRNKa (ORCPT ); Mon, 18 Apr 2022 09:10:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 060B838DB7; Mon, 18 Apr 2022 05:50:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A744861254; Mon, 18 Apr 2022 12:50:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0B78C385A1; Mon, 18 Apr 2022 12:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286205; bh=bEM7qOBc7IJVNEaG71DewBv/7O4ZTdXmvVxauwwLXro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ksy/vLLf4SRrWjiYc9ooVgyyi7xvC7eDHKMVsPlVmMM4hEqFoGXlrEaN3r9d2JRf+ TSiOhezjZRJK3vjPrYVdKNmLipGAqP+mTH0Y/aAc9NBjFPu2H41JvHinExMZS7neaD c5FrwqE0FlTISOFjdKhEWMmX3v/93oJWFJuYg468= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Igor Zhbanov , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.14 061/284] PM: suspend: fix return value of __setup handler Date: Mon, 18 Apr 2022 14:10:42 +0200 Message-Id: <20220418121212.426726556@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Randy Dunlap [ Upstream commit 7a64ca17e4dd50d5f910769167f3553902777844 ] If an invalid option is given for "test_suspend=3D