From patchwork Mon Sep 21 16:27:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ACA5C43466 for ; Mon, 21 Sep 2020 16:31:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEF8020757 for ; Mon, 21 Sep 2020 16:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705906; bh=ecsvlo9UBqAPM2bD3BSH+XYt4vPsp5ip8aNxOrUp9wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=F+Uac7RZOXHGrM5qgGYKpPUgMMHFPx3QNUGUS1ZWQeczai/WIbC3HxnU2mWey8ggm nfYpicxYZWwCPzaFBvjWlVMkyqOIsY56VFUCtRDJZa/n6oC77aiMLX6023mfC3QAht eZL0yrzM0scGTETEmrAljUC6OtfGBMtx8/P19KZY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728074AbgIUQbp (ORCPT ); Mon, 21 Sep 2020 12:31:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727248AbgIUQbp (ORCPT ); Mon, 21 Sep 2020 12:31:45 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B71123998; Mon, 21 Sep 2020 16:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705904; bh=ecsvlo9UBqAPM2bD3BSH+XYt4vPsp5ip8aNxOrUp9wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r60pPDlykqbUeFBeSOl1gJ+2eJUvrE5V305nzlxlQh2KMJPv9zbKUc1OxnKPcqw1N bbbQ+ralq9OW/D8I3tYdEtfyff/Fss7JoskdINKF7I1VyphS/cLXVO6Q8CWwtHe9ww A/TtA85H7eLsycQKS7Ik2bfBl6n95cPaR4swkzcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Jason Yan , Luo Jiaxing , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.4 02/46] scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA Date: Mon, 21 Sep 2020 18:27:18 +0200 Message-Id: <20200921162033.467085682@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Luo Jiaxing [ Upstream commit 53de092f47ff40e8d4d78d590d95819d391bf2e0 ] It was discovered that sdparm will fail when attempting to disable write cache on a SATA disk connected via libsas. In the ATA command set the write cache state is controlled through the SET FEATURES operation. This is roughly corresponds to MODE SELECT in SCSI and the latter command is what is used in the SCSI-ATA translation layer. A subtle difference is that a MODE SELECT carries data whereas SET FEATURES is defined as a non-data command in ATA. Set the DMA data direction to DMA_NONE if the requested ATA command is identified as non-data. [mkp: commit desc] Fixes: fa1c1e8f1ece ("[SCSI] Add SATA support to libsas") Link: https://lore.kernel.org/r/1598426666-54544-1-git-send-email-luojiaxing@huawei.com Reviewed-by: John Garry Reviewed-by: Jason Yan Signed-off-by: Luo Jiaxing Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/libsas/sas_ata.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 6f5e2720ffad1..68b33abeaa5fa 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -224,7 +224,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) task->num_scatter = si; } - task->data_dir = qc->dma_dir; + if (qc->tf.protocol == ATA_PROT_NODATA) + task->data_dir = DMA_NONE; + else + task->data_dir = qc->dma_dir; task->scatter = qc->sg; task->ata_task.retry_count = 1; task->task_state_flags = SAS_TASK_STATE_PENDING; From patchwork Mon Sep 21 16:27:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E1F2C43468 for ; Mon, 21 Sep 2020 16:33:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3046F239D1 for ; Mon, 21 Sep 2020 16:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706018; bh=HPVoBkwWM2VEuHSnaDmJ4BHUWkB/Y6RRhjh/6SvnQNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NSB+CGr0OyZO5O5V6sUiJuTxGw8kxM+15LBWh8veXgIKALph84mlBu1Zj65Tq6oAQ twdsraPPgTlLOfbUHKQL6V9fceNiY4OzsgwDkFKkjaHkSaHaK3hI9Sq2wAKxfuccNm HBAZhaqRRpf08Y3ysEJIp7E+QRdCAtmpVeKLxC2I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728614AbgIUQdX (ORCPT ); Mon, 21 Sep 2020 12:33:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728580AbgIUQdJ (ORCPT ); Mon, 21 Sep 2020 12:33:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DC6B2399C; Mon, 21 Sep 2020 16:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705988; bh=HPVoBkwWM2VEuHSnaDmJ4BHUWkB/Y6RRhjh/6SvnQNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2O1nVnKnj/1qhYK3rvHVgFV/kOZMIDsCbcYBCMoAxg6FXODXfWsDP3TdfaGE+MFw/ q7pofdtvoL2JOGw+o7+YUQJ+zLHxQNMpL2ABPdpTNEEGJxolWM+NMQWyckx8OvevzC 14q+wLEExWYL8gMvsBEF4eM/jcqm6UiCCajEMkMY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Willem de Bruijn , Martin Schiller , Xie He , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 03/46] drivers/net/wan/lapbether: Added needed_tailroom Date: Mon, 21 Sep 2020 18:27:19 +0200 Message-Id: <20200921162033.512856614@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xie He [ Upstream commit 1ee39c1448c4e0d480c5b390e2db1987561fb5c2 ] The underlying Ethernet device may request necessary tailroom to be allocated by setting needed_tailroom. This driver should also set needed_tailroom to request the tailroom needed by the underlying Ethernet device to be allocated. Cc: Willem de Bruijn Cc: Martin Schiller Signed-off-by: Xie He Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/wan/lapbether.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 6eb0f7a85e531..5befc7f3f0e7a 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -343,6 +343,7 @@ static int lapbeth_new_device(struct net_device *dev) */ ndev->needed_headroom = -1 + 3 + 2 + dev->hard_header_len + dev->needed_headroom; + ndev->needed_tailroom = dev->needed_tailroom; lapbeth = netdev_priv(ndev); lapbeth->axdev = ndev; From patchwork Mon Sep 21 16:27:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35620C43469 for ; Mon, 21 Sep 2020 16:31:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA4972399C for ; Mon, 21 Sep 2020 16:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705917; bh=sCSX/hkS/jZYAfpuxjYlfWkuz9jej7DqloL+c37m8TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uPG3pHhARjzfarX9iNw3hcjd8NDcWSxgkVPUlrifwUOgMNsetTFJeQB+ansXuBAnq fkVAAjF8y4+nOF2gh/Wn3hKL6jynurP3QtsK+0Xw1DAK5uOVsJuDt5x7J8tBy9USNh VvK6KZLpjFuAYbwTcRZdZ/nst2r1P6llVcB5Rz24= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727248AbgIUQbw (ORCPT ); Mon, 21 Sep 2020 12:31:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:56920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgIUQbu (ORCPT ); Mon, 21 Sep 2020 12:31:50 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 59408235F9; Mon, 21 Sep 2020 16:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705909; bh=sCSX/hkS/jZYAfpuxjYlfWkuz9jej7DqloL+c37m8TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kf3URe3/mbPiCcvi/HCA0PO1z7CDV2AcHdP8eFg/ZhhGjb803q76eCT5EWRSg23UX MieuSt6nj8dcuSnAxAi5n95JI/EmKPy8q1cnF2Pz+5jW4ps2DZygaNUEXVh2JU6aNl pDxhc1ikObNHf4/cczcfKgK0MyGtaYuaG4HnK5lo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 04/46] firestream: Fix memleak in fs_open Date: Mon, 21 Sep 2020 18:27:20 +0200 Message-Id: <20200921162033.560497929@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu [ Upstream commit 15ac5cdafb9202424206dc5bd376437a358963f9 ] When make_rate() fails, vcc should be freed just like other error paths in fs_open(). Signed-off-by: Dinghao Liu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/firestream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 04b39d0da8681..70708608ab1e7 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -1009,6 +1009,7 @@ static int fs_open(struct atm_vcc *atm_vcc) error = make_rate (pcr, r, &tmc0, NULL); if (error) { kfree(tc); + kfree(vcc); return error; } } From patchwork Mon Sep 21 16:27:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AAE7C43466 for ; Mon, 21 Sep 2020 16:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03B6D23976 for ; Mon, 21 Sep 2020 16:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705951; bh=WR+g6BJmosRtwJSoMvEhD8ZZWYEATjLLIsh6e4mzX3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=z/j/dQdrAFL/mG1oqSGhfZCSp/9SfPpMRYILt2sPyWJh0NS+mbWzI5Am1SNhVQh7E YgGiH9RzY3pnDKb+fJ5BkI6PR/hRN9lzB3p0FOHHl/lPfbhiOoaIJ/Q5yjr1AHquQ1 CoK8kROWmv13tHRYFIXVS/xHZeFlGlt5jDYEqEUI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728459AbgIUQca (ORCPT ); Mon, 21 Sep 2020 12:32:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:57700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728437AbgIUQcS (ORCPT ); Mon, 21 Sep 2020 12:32:18 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4FE2D23976; Mon, 21 Sep 2020 16:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705937; bh=WR+g6BJmosRtwJSoMvEhD8ZZWYEATjLLIsh6e4mzX3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5MJhiasE486khI8/3p+wtGZrEAMWRF8wvpPJDa9RL7jj4LfFYkDNNDP+jXICh9nF SD1j9Yyl9CJoBVqzlAoRdB8S0/jMFSjbNdRG+FXqSSGjvZ7I7inpu6W55A8n5gPLfO c0Delyx/0820DOg9SnlZC7Bn/aTYynbxil2hgmBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schiller , Xie He , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 05/46] drivers/net/wan/lapbether: Set network_header before transmitting Date: Mon, 21 Sep 2020 18:27:21 +0200 Message-Id: <20200921162033.607039773@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xie He [ Upstream commit 91244d108441013b7367b3b4dcc6869998676473 ] Set the skb's network_header before it is passed to the underlying Ethernet device for transmission. This patch fixes the following issue: When we use this driver with AF_PACKET sockets, there would be error messages of: protocol 0805 is buggy, dev (Ethernet interface name) printed in the system "dmesg" log. This is because skbs passed down to the Ethernet device for transmission don't have their network_header properly set, and the dev_queue_xmit_nit function in net/core/dev.c complains about this. Reason of setting the network_header to this place (at the end of the Ethernet header, and at the beginning of the Ethernet payload): Because when this driver receives an skb from the Ethernet device, the network_header is also set at this place. Cc: Martin Schiller Signed-off-by: Xie He Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/wan/lapbether.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 5befc7f3f0e7a..c6db9a4e7c457 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -213,6 +213,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) skb->dev = dev = lapbeth->ethdev; + skb_reset_network_header(skb); + dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0); dev_queue_xmit(skb); From patchwork Mon Sep 21 16:27:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFA76C43465 for ; Mon, 21 Sep 2020 17:06:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5A802085B for ; Mon, 21 Sep 2020 17:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707986; bh=tIOfyw3sGlQevEyMvVuvA1c9woYOZlctdRJSPiBhURs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HaY9kXpTAwcDxSFknhPtIELePKkdiMcDet2ug+AW3S9ZLOS/IbOedFr2mgrADfWK3 f4bNH2Qg/OUCXOnpEisKlZcB7EUWXIKcD2NKmZEx086vzf8eERrQBAtfDB3UHvwpzn bEn8ALAR/2eNHVk/F4Hu+GNw9vbu/8tjJPFYF+Q0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728528AbgIURGL (ORCPT ); Mon, 21 Sep 2020 13:06:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:58550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728529AbgIUQcq (ORCPT ); Mon, 21 Sep 2020 12:32:46 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85A3D23998; Mon, 21 Sep 2020 16:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705966; bh=tIOfyw3sGlQevEyMvVuvA1c9woYOZlctdRJSPiBhURs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tzwW7WmXxYsk79zHTo1lNURrClmMi/VvAR5QhKap/9P4jKdeYb+I5MtxEgyLh+mDw iGhRXOlxctkisJ5X7mlvnP9IjT96QuzXLdCjLb4HlyFG75upj5+4J9fKf8JW+S4SKY b9nxv0zawsUv/CKbbQj7kYIivFTI0EjPoxzJ4Tmo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Darrick J. Wong" , Eric Sandeen , Dave Chinner , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.4 06/46] xfs: initialize the shortform attr header padding entry Date: Mon, 21 Sep 2020 18:27:22 +0200 Message-Id: <20200921162033.655852337@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Darrick J. Wong [ Upstream commit 125eac243806e021f33a1fdea3687eccbb9f7636 ] Don't leak kernel memory contents into the shortform attr fork. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Sasha Levin --- fs/xfs/libxfs/xfs_attr_leaf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index 445a3f2f871fb..da8747b870df3 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -514,8 +514,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args) ASSERT(ifp->if_flags & XFS_IFINLINE); } xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK); - hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data; - hdr->count = 0; + hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data; + memset(hdr, 0, sizeof(*hdr)); hdr->totsize = cpu_to_be16(sizeof(*hdr)); xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); } From patchwork Mon Sep 21 16:27:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263548 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24A7AC43466 for ; Mon, 21 Sep 2020 17:06:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE55E2084C for ; Mon, 21 Sep 2020 17:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707964; bh=toxpiCs541mFXqnbYYRXvxXpCq2dj5tqD33uJsEyZ7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jG5AaGF5cihq1UGfUQRxsK+4TKwFhq8mVdWZXe7pXt6PEehy8+FrwV6gH2hAE6YFF HUfWk6iP08A9Pezx+ZmxO9DnAjxJTa1kUl/eLxpaM7tjLSDz63V0F0niiuPF04tqkD IRlKuDXwB40cQ3hsMND8RoL19rnT6EqMAOVkqyjs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728568AbgIUQdF (ORCPT ); Mon, 21 Sep 2020 12:33:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbgIUQdB (ORCPT ); Mon, 21 Sep 2020 12:33:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 055B72399C; Mon, 21 Sep 2020 16:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705973; bh=toxpiCs541mFXqnbYYRXvxXpCq2dj5tqD33uJsEyZ7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k+guYuYpT7rqmaNArokn18mR+hhgbr9q20yJAKhnK4GieNfCZE2exobAECP/Dy1xR xuuSYpR/hR5nxalAixG1ATW5Rd2uAWb3zEax42kExESYdY9dTAzmuAp4NkPnj48oKy tUQrwymB/ij3Ftn2IhEV4RiaI/a8i0JfJk7FbTcI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schiller , Xie He , Krzysztof Halasa , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 07/46] drivers/net/wan/hdlc_cisco: Add hard_header_len Date: Mon, 21 Sep 2020 18:27:23 +0200 Message-Id: <20200921162033.700922943@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xie He [ Upstream commit 1a545ebe380bf4c1433e3c136e35a77764fda5ad ] This driver didn't set hard_header_len. This patch sets hard_header_len for it according to its header_ops->create function. This driver's header_ops->create function (cisco_hard_header) creates a header of (struct hdlc_header), so hard_header_len should be set to sizeof(struct hdlc_header). Cc: Martin Schiller Signed-off-by: Xie He Acked-by: Krzysztof Halasa Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/wan/hdlc_cisco.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c index 3f20808b5ff82..f8ed079d8bc3e 100644 --- a/drivers/net/wan/hdlc_cisco.c +++ b/drivers/net/wan/hdlc_cisco.c @@ -377,6 +377,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) memcpy(&state(hdlc)->settings, &new_settings, size); spin_lock_init(&state(hdlc)->lock); dev->header_ops = &cisco_header_ops; + dev->hard_header_len = sizeof(struct hdlc_header); dev->type = ARPHRD_CISCO; netif_dormant_on(dev); return 0; From patchwork Mon Sep 21 16:27:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD232C43468 for ; Mon, 21 Sep 2020 16:33:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A2942399C for ; Mon, 21 Sep 2020 16:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705986; bh=M0PtdWcYxeBelsDbpwDJEsRn7qwzPiUFqHU6byxnTwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XkuTTR1SQemXLuWeykLq1ljEHYQEYPy7RqR2C17SEClO2/s4aQ8kYKmG3a5/nCs2t Fq476+ELRfo9EYGqcV6o1bHTZfZOEhLunsVTvf7vCFE0mLk3ML4kSLfEILxhxAKuAE YxTD+PnCvsf8KEQfdo0Jh3eYflYfAQEf2kbj0SPg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728566AbgIUQdF (ORCPT ); Mon, 21 Sep 2020 12:33:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbgIUQdB (ORCPT ); Mon, 21 Sep 2020 12:33:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82F19239A1; Mon, 21 Sep 2020 16:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705976; bh=M0PtdWcYxeBelsDbpwDJEsRn7qwzPiUFqHU6byxnTwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sq3gL1JwXX69fvz7TvLR5DYq8foIYJylHMgu/Okcm4Wj9l0z/iAJa1XA1UhLLqvao EuR9CbpQNtqexF7nzu05WF/E8w25TG3HKCLhAQ7Y2a2wNwtnZmZmZ8gUF08EymYXN6 hP05c6mmM6FCy1bo2nBqZG+EE3u/ql0VG5K+nLmg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rander Wang , Ranjani Sridharan , Pierre-Louis Bossart , Bard Liao , Guennadi Liakhovetski , Kai Vehmanen , Takashi Iwai , Sasha Levin Subject: [PATCH 4.4 08/46] ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled Date: Mon, 21 Sep 2020 18:27:24 +0200 Message-Id: <20200921162033.750486651@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rander Wang [ Upstream commit 13774d81f38538c5fa2924bdcdfa509155480fa6 ] In snd_hdac_device_init pm_runtime_set_active is called to increase child_count in parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be invoked to clean up a HD-audio extended codec base device. At this time the child_count of parent is not decreased, which makes parent device can't get suspended. This patch calls pm_runtime_set_suspended to decrease child_count in parent device in snd_hdac_device_exit to match with snd_hdac_device_init. pm_runtime_set_suspended can make sure that it will not decrease child_count if the device is already suspended. Signed-off-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200902154218.1440441-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/hda/hdac_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index e361024eabb63..020ec48f39048 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -123,6 +123,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init); void snd_hdac_device_exit(struct hdac_device *codec) { pm_runtime_put_noidle(&codec->dev); + /* keep balance of runtime PM child_count in parent device */ + pm_runtime_set_suspended(&codec->dev); snd_hdac_bus_remove_device(codec->bus, codec); kfree(codec->vendor_name); kfree(codec->chip_name); From patchwork Mon Sep 21 16:27:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC276C43465 for ; Mon, 21 Sep 2020 16:33:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7177423998 for ; Mon, 21 Sep 2020 16:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705985; bh=NQKH7qV+mvGMmdYVsn+drBg78YJ7yUGWecvlsGgCjo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iNI7HhPIwnO30+V4pgJRge36jHZ+GeveJ4G4bmzpJfOtItTRDCLtNCSqf6fxgKS/0 5NhSEacPLmYPYpK75O3yy9FJFitrLr9PmD5YDaD4Hxm1TneUXkzzfeqtgHRE/dHt+e JfqyH0GjNHh/frxOTXp9DpfLS8DlDsj5qjNVZ6KA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbgIUQdC (ORCPT ); Mon, 21 Sep 2020 12:33:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:58922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728560AbgIUQdB (ORCPT ); Mon, 21 Sep 2020 12:33:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 45D35239D2; Mon, 21 Sep 2020 16:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705978; bh=NQKH7qV+mvGMmdYVsn+drBg78YJ7yUGWecvlsGgCjo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d5qxqBBQfns28YBQ+DRNI9elsnDym1cTMQlMJFkjjC+ws0lOd/6hcHmdSU0ilIH+6 ZfqhmD/64SJrtexOwIUVZ4lBdNVq0BBOE4moUvTe9yIoODo7/LC+1zN0lp/a018w+9 vcQCEh0uhYPXsQMwHYalBL7RMkWVJu+CqHczlh/o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Leon Romanovsky , Linus Torvalds , Sasha Levin Subject: [PATCH 4.4 09/46] gcov: Disable gcov build with GCC 10 Date: Mon, 21 Sep 2020 18:27:25 +0200 Message-Id: <20200921162033.802338275@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leon Romanovsky [ Upstream commit cfc905f158eaa099d6258031614d11869e7ef71c ] GCOV built with GCC 10 doesn't initialize n_function variable. This produces different kernel panics as was seen by Colin in Ubuntu and me in FC 32. As a workaround, let's disable GCOV build for broken GCC 10 version. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1891288 Link: https://lore.kernel.org/lkml/20200827133932.3338519-1-leon@kernel.org Link: https://lore.kernel.org/lkml/CAHk-=whbijeSdSvx-Xcr0DPMj0BiwhJ+uiNnDSVZcr_h_kg7UA@mail.gmail.com/ Cc: Colin Ian King Signed-off-by: Leon Romanovsky Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- kernel/gcov/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig index 1276aabaab550..1d78ed19a3512 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig @@ -3,6 +3,7 @@ menu "GCOV-based kernel profiling" config GCOV_KERNEL bool "Enable gcov-based kernel profiling" depends on DEBUG_FS + depends on !CC_IS_GCC || GCC_VERSION < 100000 select CONSTRUCTORS if !UML default n ---help--- From patchwork Mon Sep 21 16:27:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 091A7C43468 for ; Mon, 21 Sep 2020 17:06:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B48A02073A for ; Mon, 21 Sep 2020 17:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707965; bh=D6ioDQNlnawCrx2GcOF/N/wwukoyQL0N+drj/kH08Bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=W2dm/vsiWBMH7LNhjyM3/S2OlzdeXsmVWdhaMulZsmIY9Osd95J1fYv29jUobOm04 FCcyB7eyFwMYsxycC159t4ACnLFLS7+3HA1RJqBOV5xjeJC/wDVE/fc0YforrlL9xF H05vXnIB3rNr6HWRSXmA//liKeOJGaKUYZAZ9H9c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728564AbgIUQdE (ORCPT ); Mon, 21 Sep 2020 12:33:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728561AbgIUQdB (ORCPT ); Mon, 21 Sep 2020 12:33:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB110239D0; Mon, 21 Sep 2020 16:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705981; bh=D6ioDQNlnawCrx2GcOF/N/wwukoyQL0N+drj/kH08Bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+aCAq4unyKq4VxOjFi39ixKmidyfib1zM3Yhfvzx0UkylNzLfSATiTkE0U/dcOQA aWQoIm4cMUeP4yrgf5fZFNhhESYcjgpBuqc9gNmA/ANThLRpYsXtj5Lpk5v5c3YsNX Gzp3kNcs6N5s6v5zDFRQz85NmMgqqr2QCj3dTHBQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Angelo Compagnucci , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.4 10/46] iio: adc: mcp3422: fix locking scope Date: Mon, 21 Sep 2020 18:27:26 +0200 Message-Id: <20200921162033.840827318@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Angelo Compagnucci commit 3f1093d83d7164e4705e4232ccf76da54adfda85 upstream. Locking should be held for the entire reading sequence involving setting the channel, waiting for the channel switch and reading from the channel. If not, reading from a channel can result mixing with the reading from another channel. Fixes: 07914c84ba30 ("iio: adc: Add driver for Microchip MCP3422/3/4 high resolution ADC") Signed-off-by: Angelo Compagnucci Link: https://lore.kernel.org/r/20200819075525.1395248-1-angelo.compagnucci@gmail.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/mcp3422.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c @@ -98,16 +98,12 @@ static int mcp3422_update_config(struct { int ret; - mutex_lock(&adc->lock); - ret = i2c_master_send(adc->i2c, &newconfig, 1); if (ret > 0) { adc->config = newconfig; ret = 0; } - mutex_unlock(&adc->lock); - return ret; } @@ -140,6 +136,8 @@ static int mcp3422_read_channel(struct m u8 config; u8 req_channel = channel->channel; + mutex_lock(&adc->lock); + if (req_channel != MCP3422_CHANNEL(adc->config)) { config = adc->config; config &= ~MCP3422_CHANNEL_MASK; @@ -152,7 +150,11 @@ static int mcp3422_read_channel(struct m msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]); } - return mcp3422_read(adc, value, &config); + ret = mcp3422_read(adc, value, &config); + + mutex_unlock(&adc->lock); + + return ret; } static int mcp3422_read_raw(struct iio_dev *iio, From patchwork Mon Sep 21 16:27:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309294 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 285E1C43465 for ; Mon, 21 Sep 2020 17:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D75202084C for ; Mon, 21 Sep 2020 17:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707966; bh=UFPr6/llB4vS7xtdsNfY48Ig0GmN/EZmKOo7XcHpDbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y8IiWJzC6F4eeIl2EiwStGzGmNYwsDC8I6kIgjC1524CxoMQYhEmTJZ2ml+JOfsEV cfpB43COJV5Zx2nKJUu3hv1V5zy7AdP1Fo5+wcDlsH5VOwoxyksyzG36vRXadioKkb UrHvvOzMkhOurKgrM1bNO6KL0Lm8jagqaXmBJv4g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728569AbgIURGF (ORCPT ); Mon, 21 Sep 2020 13:06:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728354AbgIUQdE (ORCPT ); Mon, 21 Sep 2020 12:33:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63C6B2396F; Mon, 21 Sep 2020 16:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705983; bh=UFPr6/llB4vS7xtdsNfY48Ig0GmN/EZmKOo7XcHpDbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jexk5/KfxWvO9RUHHeSTpfKVuvaZW0zUeMh0O0zSee8s/xjE/CyP3YlIHdqJBgwAM sCR1Hw0RcIA14Yo4138Trg/9tO3bUb2lQOg/yRbJOgTnhQhDfgHmPVCgzVcUJjXWDz b9gvTTv2PCqu92cisb6L/GZ+EyfC4sDTJNUAOjLc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Angelo Compagnucci , Sasha Levin Subject: [PATCH 4.4 11/46] iio: adc: mcp3422: fix locking on error path Date: Mon, 21 Sep 2020 18:27:27 +0200 Message-Id: <20200921162033.881164155@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Angelo Compagnucci [ Upstream commit a139ffa40f0c24b753838b8ef3dcf6ad10eb7854 ] Reading from the chip should be unlocked on error path else the lock could never being released. Fixes: 07914c84ba30 ("iio: adc: Add driver for Microchip MCP3422/3/4 high resolution ADC") Fixes: 3f1093d83d71 ("iio: adc: mcp3422: fix locking scope") Acked-by: Jonathan Cameron Signed-off-by: Angelo Compagnucci Link: https://lore.kernel.org/r/20200901093218.1500845-1-angelo.compagnucci@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/iio/adc/mcp3422.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c @@ -145,8 +145,10 @@ static int mcp3422_read_channel(struct m config &= ~MCP3422_PGA_MASK; config |= MCP3422_PGA_VALUE(adc->pga[req_channel]); ret = mcp3422_update_config(adc, config); - if (ret < 0) + if (ret < 0) { + mutex_unlock(&adc->lock); return ret; + } msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]); } From patchwork Mon Sep 21 16:27:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 268DDC43466 for ; Mon, 21 Sep 2020 16:33:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E81D7239D0 for ; Mon, 21 Sep 2020 16:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706004; bh=ZnMOBF5X9pk7vKlo2wALEivGY4W8rWnFNiX4BpkSnLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=De9objVOuRfZgLg0R6sOkfYp8TZL1eBC1zbLC172sAECm0L0WV0Qbx+9kD5aKYreJ I8qZ7fEanPl8pJBPloQYgZ38/Hfjdb6UimpLr5IkKQKgl/GJBvYS3MNX7SOxAc7Wuk jeJwHSdWEXzAxGjGumCvz8KJyg26u5G1zcdGiT24= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728617AbgIUQdY (ORCPT ); Mon, 21 Sep 2020 12:33:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:59010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728571AbgIUQdH (ORCPT ); Mon, 21 Sep 2020 12:33:07 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C218223998; Mon, 21 Sep 2020 16:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705986; bh=ZnMOBF5X9pk7vKlo2wALEivGY4W8rWnFNiX4BpkSnLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XcNX6QFm4pxOjoXlOy9UkrMIGLkzmygPI8Ftt663W8Ss3Lhp1IzUvchwXj1gVLhp0 uRR3Vfd4A8lL8a2j0dDLtLOwgZD18xsOLbs5WEX52ocXwnxnTtIb7RKpGGJzOrWvnx uOtITsHLGFjzlGNC4VlKYHdIfRRF9CKzOt3e6jVc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars-Peter Clausen , Jonathan Cameron , Andy Shevchenko , Stable@vger.kernel.org Subject: [PATCH 4.4 12/46] iio:light:ltr501 Fix timestamp alignment issue. Date: Mon, 21 Sep 2020 18:27:28 +0200 Message-Id: <20200921162033.923131993@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron commit 2684d5003490df5398aeafe2592ba9d4a4653998 upstream. One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. Here we use a structure on the stack. The driver already did an explicit memset so no data leak was possible. Forced alignment of ts is not strictly necessary but probably makes the code slightly less fragile. Note there has been some rework in this driver of the years, so no way this will apply cleanly all the way back. Fixes: 2690be905123 ("iio: Add Lite-On ltr501 ambient light / proximity sensor driver") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/iio/light/ltr501.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1218,13 +1218,16 @@ static irqreturn_t ltr501_trigger_handle struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct ltr501_data *data = iio_priv(indio_dev); - u16 buf[8]; + struct { + u16 channels[3]; + s64 ts __aligned(8); + } scan; __le16 als_buf[2]; u8 mask = 0; int j = 0; int ret, psdata; - memset(buf, 0, sizeof(buf)); + memset(&scan, 0, sizeof(scan)); /* figure out which data needs to be ready */ if (test_bit(0, indio_dev->active_scan_mask) || @@ -1243,9 +1246,9 @@ static irqreturn_t ltr501_trigger_handle if (ret < 0) return ret; if (test_bit(0, indio_dev->active_scan_mask)) - buf[j++] = le16_to_cpu(als_buf[1]); + scan.channels[j++] = le16_to_cpu(als_buf[1]); if (test_bit(1, indio_dev->active_scan_mask)) - buf[j++] = le16_to_cpu(als_buf[0]); + scan.channels[j++] = le16_to_cpu(als_buf[0]); } if (mask & LTR501_STATUS_PS_RDY) { @@ -1253,10 +1256,10 @@ static irqreturn_t ltr501_trigger_handle &psdata, 2); if (ret < 0) goto done; - buf[j++] = psdata & LTR501_PS_DATA_MASK; + scan.channels[j++] = psdata & LTR501_PS_DATA_MASK; } - iio_push_to_buffers_with_timestamp(indio_dev, buf, iio_get_time_ns()); + iio_push_to_buffers_with_timestamp(indio_dev, &scan, iio_get_time_ns()); done: iio_trigger_notify_done(indio_dev->trig); From patchwork Mon Sep 21 16:27:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17A18C4346B for ; Mon, 21 Sep 2020 16:31:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D76BF239A1 for ; Mon, 21 Sep 2020 16:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705917; bh=Kikms6u3+toTfKNvKFXkU4+H6n1KmacY2wRUK+4odSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y0fhXGzgwWHHjIMjZ9lOGkRlNaJZQS8IgbgjlaW93w4CwdeMJkLCcFWCE5b9DiQPi cEwCNX6i9II8uFxU4+ZjZO7QGFwpwUXLoTXYVtnNcmHlsvuXV/EcClPI2E7DK/X27C Xk4pxwb6Dd+CCqGFgPCjWTnuVOylE+DjckkRCXSo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbgIUQb5 (ORCPT ); Mon, 21 Sep 2020 12:31:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728286AbgIUQbx (ORCPT ); Mon, 21 Sep 2020 12:31:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5A412399A; Mon, 21 Sep 2020 16:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705912; bh=Kikms6u3+toTfKNvKFXkU4+H6n1KmacY2wRUK+4odSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LZDLNgVGzjG7DEts9X3o4/9q0V3Pth0wT7RbWjHl1ODi/QDerH7d2JBNJXgga0HlE bJdkUwZz7qnpnJI/wZjGF0suR4YvMd2N32SAAAO48BQXgk+kiAVvnoMG5537SIkkDm n95HeqJtlOB6CtM9tzI9dG2NKHbFhDkhPTh/EITY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars-Peter Clausen , Jonathan Cameron , Srinivas Pandruvada , Andy Shevchenko , Stable@vger.kernel.org Subject: [PATCH 4.4 13/46] iio:accel:bmc150-accel: Fix timestamp alignment and prevent data leak. Date: Mon, 21 Sep 2020 18:27:29 +0200 Message-Id: <20200921162033.966266919@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron commit a6f86f724394de3629da63fe5e1b7a4ab3396efe upstream. One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 16 byte array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment ensured by use of an explicit c structure. This data is allocated with kzalloc so no data can leak appart from previous readings. Fixes tag is beyond some major refactoring so likely manual backporting would be needed to get that far back. Whilst the force alignment of the ts is not strictly necessary, it does make the code less fragile. Fixes: 3bbec9773389 ("iio: bmc150_accel: add support for hardware fifo") Reported-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Acked-by: Srinivas Pandruvada Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/iio/accel/bmc150-accel-core.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -198,6 +198,14 @@ struct bmc150_accel_data { struct mutex mutex; u8 fifo_mode, watermark; s16 buffer[8]; + /* + * Ensure there is sufficient space and correct alignment for + * the timestamp if enabled + */ + struct { + __le16 channels[3]; + s64 ts __aligned(8); + } scan; u8 bw_bits; u32 slope_dur; u32 slope_thres; @@ -924,15 +932,16 @@ static int __bmc150_accel_fifo_flush(str * now. */ for (i = 0; i < count; i++) { - u16 sample[8]; int j, bit; j = 0; for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) - memcpy(&sample[j++], &buffer[i * 3 + bit], 2); + memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], + sizeof(data->scan.channels[0])); - iio_push_to_buffers_with_timestamp(indio_dev, sample, tstamp); + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, + tstamp); tstamp += sample_period; } From patchwork Mon Sep 21 16:27:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CDECC4346A for ; Mon, 21 Sep 2020 16:32:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 279CA239A1 for ; Mon, 21 Sep 2020 16:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705947; bh=LsR533p9yB5t7YUneI1L6ClLmqw23x4NqPSlHi85swQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vaUjrA/OTJCINX+E76llSVRG/5rJD6nAYhge7DweUNp5VknvCk8kgdO5HTrbYJ115 VWC/5vgi++o+qLjnHjihc2igI0wlN3i1XmbLLmzcS1H3fd7Fkao87BjQH6r+XQtpA/ cgWLgC9M+52IadgakkLi/4RgVwyEn3PUKILxMmRg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728308AbgIUQb5 (ORCPT ); Mon, 21 Sep 2020 12:31:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:57044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgIUQbz (ORCPT ); Mon, 21 Sep 2020 12:31:55 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FE0C2396F; Mon, 21 Sep 2020 16:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705915; bh=LsR533p9yB5t7YUneI1L6ClLmqw23x4NqPSlHi85swQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Obv0JawuU+X62l0E7R6BI0sno3cXF17CYExy0Le3vcmf8BsJ9GI55YUV50UZbMzYx zNHS+UPWz+2VrIRUPDUQ5CVzYAAQCUtSfZh1Ni1BeX3o6zwbvoGx8CUUJzu303XVQF 9qBzroLZ1KfvTxSVGnmqER+SUEsR1ltLM6ZtVxps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars-Peter Clausen , Peter Meerwald , Jonathan Cameron , Andy Shevchenko , Stable@vger.kernel.org Subject: [PATCH 4.4 14/46] iio:accel:mma8452: Fix timestamp alignment and prevent data leak. Date: Mon, 21 Sep 2020 18:27:30 +0200 Message-Id: <20200921162034.006731941@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron commit 89226a296d816727405d3fea684ef69e7d388bd8 upstream. One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 16 byte u8 array on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment ensured by use of an explicit c structure. This data is allocated with kzalloc so no data can leak appart from previous readings. The additional forcing of the 8 byte alignment of the timestamp is not strictly necessary but makes the code less fragile by making this explicit. Fixes: c7eeea93ac60 ("iio: Add Freescale MMA8452Q 3-axis accelerometer driver") Reported-by: Lars-Peter Clausen Cc: Peter Meerwald Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/iio/accel/mma8452.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -96,6 +96,12 @@ struct mma8452_data { u8 ctrl_reg1; u8 data_cfg; const struct mma_chip_info *chip_info; + + /* Ensure correct alignment of time stamp when present */ + struct { + __be16 channels[3]; + s64 ts __aligned(8); + } buffer; }; /** @@ -700,14 +706,13 @@ static irqreturn_t mma8452_trigger_handl struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct mma8452_data *data = iio_priv(indio_dev); - u8 buffer[16]; /* 3 16-bit channels + padding + ts */ int ret; - ret = mma8452_read(data, (__be16 *)buffer); + ret = mma8452_read(data, data->buffer.channels); if (ret < 0) goto done; - iio_push_to_buffers_with_timestamp(indio_dev, buffer, + iio_push_to_buffers_with_timestamp(indio_dev, &data->buffer, iio_get_time_ns()); done: From patchwork Mon Sep 21 16:27:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E01FC43469 for ; Mon, 21 Sep 2020 16:32:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 367BA2399C for ; Mon, 21 Sep 2020 16:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705942; bh=EAxwTI9OR1poFBhApJn0bZQ00ICg0ML6ODkvzdevUTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZgqKn8knkjIdXI2M9QPkiEdjdylwzJCIjtmQmPwjQrCHkAyuwwM7lqj5z2vYAL7gF OvsbbBfK91F56VJUJeuaAHUowYdua3Py1va4N4m7HcqNN/pRUahQQ5ER7JRk2mYazL zPPJ9Q0QxUJqHIWzFQG8YtXXSCNxmsj13DFqOrX0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728349AbgIUQcB (ORCPT ); Mon, 21 Sep 2020 12:32:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:57132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728316AbgIUQb6 (ORCPT ); Mon, 21 Sep 2020 12:31:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3436A23976; Mon, 21 Sep 2020 16:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705917; bh=EAxwTI9OR1poFBhApJn0bZQ00ICg0ML6ODkvzdevUTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OC75ec8QY5L3nYSssxSTaAhKGM9lDf13n75SDHGtukvJ4PE2PZGto/5v+0rfjSACt urCneLYjg4M4O6q3tnEkfcSt3uqQHCXqR8yU2yuUmZmz9hgiKDlP3LzZBqktPXWRFB AV+NohT2EQzBybBXdjifQ+Coca5hTQZLQThTfv5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.4 15/46] USB: core: add helpers to retrieve endpoints Date: Mon, 21 Sep 2020 18:27:31 +0200 Message-Id: <20200921162034.044166692@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johan Hovold commit 66a359390e7e34f9a4c489467234b107b3d76169 upstream. Many USB drivers iterate over the available endpoints to find required endpoints of a specific type and direction. Typically the endpoints are required for proper function and a missing endpoint should abort probe. To facilitate code reuse, add a helper to retrieve common endpoints (bulk or interrupt, in or out) and four wrappers to find a single endpoint. Note that the helpers are marked as __must_check to serve as a reminder to always verify that all expected endpoints are indeed present. This also means that any optional endpoints, typically need to be looked up through separate calls. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/usb.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/usb.h | 35 ++++++++++++++++++++ 2 files changed, 118 insertions(+) --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -77,6 +77,89 @@ MODULE_PARM_DESC(autosuspend, "default a /** + * usb_find_common_endpoints() -- look up common endpoint descriptors + * @alt: alternate setting to search + * @bulk_in: pointer to descriptor pointer, or NULL + * @bulk_out: pointer to descriptor pointer, or NULL + * @int_in: pointer to descriptor pointer, or NULL + * @int_out: pointer to descriptor pointer, or NULL + * + * Search the alternate setting's endpoint descriptors for the first bulk-in, + * bulk-out, interrupt-in and interrupt-out endpoints and return them in the + * provided pointers (unless they are NULL). + * + * If a requested endpoint is not found, the corresponding pointer is set to + * NULL. + * + * Return: Zero if all requested descriptors were found, or -ENXIO otherwise. + */ +int usb_find_common_endpoints(struct usb_host_interface *alt, + struct usb_endpoint_descriptor **bulk_in, + struct usb_endpoint_descriptor **bulk_out, + struct usb_endpoint_descriptor **int_in, + struct usb_endpoint_descriptor **int_out) +{ + struct usb_endpoint_descriptor *epd; + int i; + + if (bulk_in) + *bulk_in = NULL; + if (bulk_out) + *bulk_out = NULL; + if (int_in) + *int_in = NULL; + if (int_out) + *int_out = NULL; + + for (i = 0; i < alt->desc.bNumEndpoints; ++i) { + epd = &alt->endpoint[i].desc; + + switch (usb_endpoint_type(epd)) { + case USB_ENDPOINT_XFER_BULK: + if (usb_endpoint_dir_in(epd)) { + if (bulk_in && !*bulk_in) { + *bulk_in = epd; + break; + } + } else { + if (bulk_out && !*bulk_out) { + *bulk_out = epd; + break; + } + } + + continue; + case USB_ENDPOINT_XFER_INT: + if (usb_endpoint_dir_in(epd)) { + if (int_in && !*int_in) { + *int_in = epd; + break; + } + } else { + if (int_out && !*int_out) { + *int_out = epd; + break; + } + } + + continue; + default: + continue; + } + + if ((!bulk_in || *bulk_in) && + (!bulk_out || *bulk_out) && + (!int_in || *int_in) && + (!int_out || *int_out)) { + return 0; + } + } + + return -ENXIO; +} +EXPORT_SYMBOL_GPL(usb_find_common_endpoints); + +/** * usb_find_alt_setting() - Given a configuration, find the alternate setting * for the given interface. * @config: the configuration to search (not necessarily the current config). --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -97,6 +97,41 @@ enum usb_interface_condition { USB_INTERFACE_UNBINDING, }; +int __must_check +usb_find_common_endpoints(struct usb_host_interface *alt, + struct usb_endpoint_descriptor **bulk_in, + struct usb_endpoint_descriptor **bulk_out, + struct usb_endpoint_descriptor **int_in, + struct usb_endpoint_descriptor **int_out); + +static inline int __must_check +usb_find_bulk_in_endpoint(struct usb_host_interface *alt, + struct usb_endpoint_descriptor **bulk_in) +{ + return usb_find_common_endpoints(alt, bulk_in, NULL, NULL, NULL); +} + +static inline int __must_check +usb_find_bulk_out_endpoint(struct usb_host_interface *alt, + struct usb_endpoint_descriptor **bulk_out) +{ + return usb_find_common_endpoints(alt, NULL, bulk_out, NULL, NULL); +} + +static inline int __must_check +usb_find_int_in_endpoint(struct usb_host_interface *alt, + struct usb_endpoint_descriptor **int_in) +{ + return usb_find_common_endpoints(alt, NULL, NULL, int_in, NULL); +} + +static inline int __must_check +usb_find_int_out_endpoint(struct usb_host_interface *alt, + struct usb_endpoint_descriptor **int_out) +{ + return usb_find_common_endpoints(alt, NULL, NULL, NULL, int_out); +} + /** * struct usb_interface - what usb device drivers talk to * @altsetting: array of interface structures, one for each alternate From patchwork Mon Sep 21 16:27:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263766 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EA80C43465 for ; Mon, 21 Sep 2020 16:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C22882399A for ; Mon, 21 Sep 2020 16:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705924; bh=/pFa11MjTsZavogEdZhrecQ9NrgyqMt7d68uHjKxW38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Dt9ci/kI7oPW+FTkUcr2w98gr+vMiBo7ksZV25CQhp849qG5TBCkAHx8Gde/8pTZE sSmzpFvmC7kwg1hxGK0MG/UxGGs8mWVfi6IzNqPeShZRUIDTZHpsZaBKVAvKUe7ncr 8zCjs8Z1W1SEUtXLWiO7Mjv11rbRmCoTMBlOGgfE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728366AbgIUQcD (ORCPT ); Mon, 21 Sep 2020 12:32:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:57210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgIUQcB (ORCPT ); Mon, 21 Sep 2020 12:32:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF6AA23976; Mon, 21 Sep 2020 16:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705920; bh=/pFa11MjTsZavogEdZhrecQ9NrgyqMt7d68uHjKxW38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DoDZrUaJSsu221vVu4LdfgydA0MAA/vNcTetTc53A6kVzpBTYFp2J4Ki0/KQqTNtJ uzTHGIaDW9gHaxF4DTPqPP9oclfCK/05XEC3gc4m52o24IRlUB7rRLuS3ZMHaIAFq4 /mi67AD2M6RtsNCdz4XPyg5YO0Ji5RYjpow5vmLk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rustam Kovhaev , syzbot+22794221ab96b0bab53a@syzkaller.appspotmail.com Subject: [PATCH 4.4 16/46] staging: wlan-ng: fix out of bounds read in prism2sta_probe_usb() Date: Mon, 21 Sep 2020 18:27:32 +0200 Message-Id: <20200921162034.092477773@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rustam Kovhaev commit fea22e159d51c766ba70473f473a0ec914cc7e92 upstream. let's use usb_find_common_endpoints() to discover endpoints, it does all necessary checks for type and xfer direction remove memset() in hfa384x_create(), because we now assign endpoints in prism2sta_probe_usb() and because create_wlan() uses kzalloc() to allocate hfa384x struct before calling hfa384x_create() Fixes: faaff9765664 ("staging: wlan-ng: properly check endpoint types") Reported-and-tested-by: syzbot+22794221ab96b0bab53a@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=22794221ab96b0bab53a Signed-off-by: Rustam Kovhaev Cc: stable Link: https://lore.kernel.org/r/20200804145614.104320-1-rkovhaev@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x_usb.c | 5 ----- drivers/staging/wlan-ng/prism2usb.c | 19 ++++++------------- 2 files changed, 6 insertions(+), 18 deletions(-) --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -530,13 +530,8 @@ static void hfa384x_usb_defer(struct wor ----------------------------------------------------------------*/ void hfa384x_create(hfa384x_t *hw, struct usb_device *usb) { - memset(hw, 0, sizeof(hfa384x_t)); hw->usb = usb; - /* set up the endpoints */ - hw->endp_in = usb_rcvbulkpipe(usb, 1); - hw->endp_out = usb_sndbulkpipe(usb, 2); - /* Set up the waitq */ init_waitqueue_head(&hw->cmdq); --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -60,23 +60,14 @@ static int prism2sta_probe_usb(struct us const struct usb_device_id *id) { struct usb_device *dev; - const struct usb_endpoint_descriptor *epd; - const struct usb_host_interface *iface_desc = interface->cur_altsetting; + struct usb_endpoint_descriptor *bulk_in, *bulk_out; + struct usb_host_interface *iface_desc = interface->cur_altsetting; wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; int result = 0; - if (iface_desc->desc.bNumEndpoints != 2) { - result = -ENODEV; - goto failed; - } - - result = -EINVAL; - epd = &iface_desc->endpoint[1].desc; - if (!usb_endpoint_is_bulk_in(epd)) - goto failed; - epd = &iface_desc->endpoint[2].desc; - if (!usb_endpoint_is_bulk_out(epd)) + result = usb_find_common_endpoints(iface_desc, &bulk_in, &bulk_out, NULL, NULL); + if (result) goto failed; dev = interface_to_usbdev(interface); @@ -95,6 +86,8 @@ static int prism2sta_probe_usb(struct us } /* Initialize the hw data */ + hw->endp_in = usb_rcvbulkpipe(dev, bulk_in->bEndpointAddress); + hw->endp_out = usb_sndbulkpipe(dev, bulk_out->bEndpointAddress); hfa384x_create(hw, dev); hw->wlandev = wlandev; From patchwork Mon Sep 21 16:27:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309508 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23C09C43465 for ; Mon, 21 Sep 2020 16:32:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E03492399C for ; Mon, 21 Sep 2020 16:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705941; bh=IzsgTk2a0yzPVRGmFj4voj4B2GLluXvUHK4Yna+JArA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zgqJSn68JoqQ1Sj6pgPCu3lwf8Ie6nXaX+GbqiDekGKu3nFfG7u04ehXRNeSLsGnv NgeR/NlROZ2BOvg/dXKgp5vuPU938illJRQ+4+cR+4+sN4qMPopoPm6AFu3DZrhxyN kVLJvL33MGcD0DgENKkbydfHAYc1p1pEzOXlaJcM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728379AbgIUQcH (ORCPT ); Mon, 21 Sep 2020 12:32:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:57234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728316AbgIUQcD (ORCPT ); Mon, 21 Sep 2020 12:32:03 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4697E20757; Mon, 21 Sep 2020 16:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705922; bh=IzsgTk2a0yzPVRGmFj4voj4B2GLluXvUHK4Yna+JArA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OUoNlqZFMbs4Vlausk5l54IVKQwW1Lvn4astHTb6HxS8g6dvl06+/mQrKClviYIE/ iJyAfQiaODDLxU3q1g6xL4IKgALwZUCFCKboBMVc0ZluB+FnVSNYbG6c8s2yMUe34B dWGOFLJjpsHmumomUzQu6PrFsvlmKlgUac6yyibM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, A L , Josef Bacik , Filipe Manana , David Sterba Subject: [PATCH 4.4 17/46] btrfs: fix wrong address when faulting in pages in the search ioctl Date: Mon, 21 Sep 2020 18:27:33 +0200 Message-Id: <20200921162034.130067558@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Filipe Manana commit 1c78544eaa4660096aeb6a57ec82b42cdb3bfe5a upstream. When faulting in the pages for the user supplied buffer for the search ioctl, we are passing only the base address of the buffer to the function fault_in_pages_writeable(). This means that after the first iteration of the while loop that searches for leaves, when we have a non-zero offset, stored in 'sk_offset', we try to fault in a wrong page range. So fix this by adding the offset in 'sk_offset' to the base address of the user supplied buffer when calling fault_in_pages_writeable(). Several users have reported that the applications compsize and bees have started to operate incorrectly since commit a48b73eca4ceb9 ("btrfs: fix potential deadlock in the search ioctl") was added to stable trees, and these applications make heavy use of the search ioctls. This fixes their issues. Link: https://lore.kernel.org/linux-btrfs/632b888d-a3c3-b085-cdf5-f9bb61017d92@lechevalier.se/ Link: https://github.com/kilobyte/compsize/issues/34 Fixes: a48b73eca4ceb9 ("btrfs: fix potential deadlock in the search ioctl") CC: stable@vger.kernel.org # 4.4+ Tested-by: A L Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2129,7 +2129,8 @@ static noinline int search_ioctl(struct key.offset = sk->min_offset; while (1) { - ret = fault_in_pages_writeable(ubuf, *buf_size - sk_offset); + ret = fault_in_pages_writeable(ubuf + sk_offset, + *buf_size - sk_offset); if (ret) break; From patchwork Mon Sep 21 16:27:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EA3CC43465 for ; Mon, 21 Sep 2020 16:32:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BBEA239A1 for ; Mon, 21 Sep 2020 16:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705946; bh=c5rXe6L+Uv7p3TCLj0B2Tm3NmbfuKM53pvoUknxnlVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=u6V0FeTLVKsXD5O5ErMtJKmk2F+GeF/2PUZmf4U0RR9M0aIetNAHrKjMfsx93h7cJ F3z1tkF3HtLoa7VP2+ez4xAilfL+Xv0MzoaSpuXRKLtsGvowbdlcguOyqJUZRFmhNo mqvCbAfpSYLHRvUW30s1WbEN2T1H/3WaG7QL6D34= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbgIUQcV (ORCPT ); Mon, 21 Sep 2020 12:32:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:57340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgIUQcG (ORCPT ); Mon, 21 Sep 2020 12:32:06 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C10EA23998; Mon, 21 Sep 2020 16:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705925; bh=c5rXe6L+Uv7p3TCLj0B2Tm3NmbfuKM53pvoUknxnlVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gOzj0+xuTXcwtA4O8cbSogxtfZPfXl6YlbnGG1ayl5pe3OddemNSbcnhkbe178iRc ywxj8OFLNZYHAHt0OkwVzeJUbDdU+UJNFkj29xs0pAdK+jMHpN4leEux9yiDMizhV+ 8G42xUbXIhlytObTzVTGDAgTe4kzBWlbwmIPca6M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Christie , Hou Pu , "Martin K. Petersen" Subject: [PATCH 4.4 18/46] scsi: target: iscsi: Fix hang in iscsit_access_np() when getting tpg->np_login_sem Date: Mon, 21 Sep 2020 18:27:34 +0200 Message-Id: <20200921162034.165342926@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hou Pu commit ed43ffea78dcc97db3f561da834f1a49c8961e33 upstream. The iSCSI target login thread might get stuck with the following stack: cat /proc/`pidof iscsi_np`/stack [<0>] down_interruptible+0x42/0x50 [<0>] iscsit_access_np+0xe3/0x167 [<0>] iscsi_target_locate_portal+0x695/0x8ac [<0>] __iscsi_target_login_thread+0x855/0xb82 [<0>] iscsi_target_login_thread+0x2f/0x5a [<0>] kthread+0xfa/0x130 [<0>] ret_from_fork+0x1f/0x30 This can be reproduced via the following steps: 1. Initiator A tries to log in to iqn1-tpg1 on port 3260. After finishing PDU exchange in the login thread and before the negotiation is finished the the network link goes down. At this point A has not finished login and tpg->np_login_sem is held. 2. Initiator B tries to log in to iqn2-tpg1 on port 3260. After finishing PDU exchange in the login thread the target expects to process remaining login PDUs in workqueue context. 3. Initiator A' tries to log in to iqn1-tpg1 on port 3260 from a new socket. A' will wait for tpg->np_login_sem with np->np_login_timer loaded to wait for at most 15 seconds. The lock is held by A so A' eventually times out. 4. Before A' got timeout initiator B gets negotiation failed and calls iscsi_target_login_drop()->iscsi_target_login_sess_out(). The np->np_login_timer is canceled and initiator A' will hang forever. Because A' is now in the login thread, no new login requests can be serviced. Fix this by moving iscsi_stop_login_thread_timer() out of iscsi_target_login_sess_out(). Also remove iscsi_np parameter from iscsi_target_login_sess_out(). Link: https://lore.kernel.org/r/20200729130343.24976-1-houpu@bytedance.com Cc: stable@vger.kernel.org Reviewed-by: Mike Christie Signed-off-by: Hou Pu Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target_login.c | 6 +++--- drivers/target/iscsi/iscsi_target_login.h | 3 +-- drivers/target/iscsi/iscsi_target_nego.c | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -1139,7 +1139,7 @@ iscsit_conn_set_transport(struct iscsi_c } void iscsi_target_login_sess_out(struct iscsi_conn *conn, - struct iscsi_np *np, bool zero_tsih, bool new_sess) + bool zero_tsih, bool new_sess) { if (!new_sess) goto old_sess_out; @@ -1161,7 +1161,6 @@ void iscsi_target_login_sess_out(struct conn->sess = NULL; old_sess_out: - iscsi_stop_login_thread_timer(np); /* * If login negotiation fails check if the Time2Retain timer * needs to be restarted. @@ -1407,8 +1406,9 @@ static int __iscsi_target_login_thread(s new_sess_out: new_sess = true; old_sess_out: + iscsi_stop_login_thread_timer(np); tpg_np = conn->tpg_np; - iscsi_target_login_sess_out(conn, np, zero_tsih, new_sess); + iscsi_target_login_sess_out(conn, zero_tsih, new_sess); new_sess = false; if (tpg) { --- a/drivers/target/iscsi/iscsi_target_login.h +++ b/drivers/target/iscsi/iscsi_target_login.h @@ -14,8 +14,7 @@ extern int iscsit_put_login_tx(struct is extern void iscsit_free_conn(struct iscsi_np *, struct iscsi_conn *); extern int iscsit_start_kthreads(struct iscsi_conn *); extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8); -extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *, - bool, bool); +extern void iscsi_target_login_sess_out(struct iscsi_conn *, bool, bool); extern int iscsi_target_login_thread(void *); #endif /*** ISCSI_TARGET_LOGIN_H ***/ --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c @@ -547,12 +547,11 @@ static bool iscsi_target_sk_check_and_cl static void iscsi_target_login_drop(struct iscsi_conn *conn, struct iscsi_login *login) { - struct iscsi_np *np = login->np; bool zero_tsih = login->zero_tsih; iscsi_remove_failed_auth_entry(conn); iscsi_target_nego_release(conn); - iscsi_target_login_sess_out(conn, np, zero_tsih, true); + iscsi_target_login_sess_out(conn, zero_tsih, true); } static void iscsi_target_login_timeout(unsigned long data) From patchwork Mon Sep 21 16:27:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E6EC43465 for ; Mon, 21 Sep 2020 16:32:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6ADBA235F9 for ; Mon, 21 Sep 2020 16:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705930; bh=9rMYUjpW55zrcKjjGbBkJeAwsJd6h/ROg5kM/ncDgYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=A20ctb41LMeK0QmoJrG7Wi4FClXLXMOUT4VAZZpChhFbUQP702IMDwoe+CzpnXDxT 2zv2TRHMq1XFwfkkK0YlxRsQsQxi/4NJ7jW9MRa8PUgSEv6uJgOSykaLOCV2sdagKV AV5lv7c0bMMoqXIr130jO6s32kuXizwsaya1mrx8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728395AbgIUQcJ (ORCPT ); Mon, 21 Sep 2020 12:32:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:57408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728385AbgIUQcI (ORCPT ); Mon, 21 Sep 2020 12:32:08 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 922F520757; Mon, 21 Sep 2020 16:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705928; bh=9rMYUjpW55zrcKjjGbBkJeAwsJd6h/ROg5kM/ncDgYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rwgFfTmX4a7mPk5SzlkzFzpGqO2sRwcmhx5NIblvIKdaa+1SPqSuG3m6dzxWbxKBj QjZzo4J4dD2MMX+qoYewGAS945YNFuQaHe8AstDGwBuTUNmd5PY4pGnmzazHAPyuDz ckH+XLO0aeCqUpQpiv5KKZKRkfiwbGTa/ASUxmq8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Dryomov , Jeff Layton Subject: [PATCH 4.4 19/46] rbd: require global CAP_SYS_ADMIN for mapping and unmapping Date: Mon, 21 Sep 2020 18:27:35 +0200 Message-Id: <20200921162034.209474126@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ilya Dryomov commit f44d04e696feaf13d192d942c4f14ad2e117065a upstream. It turns out that currently we rely only on sysfs attribute permissions: $ ll /sys/bus/rbd/{add*,remove*} --w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add --w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add_single_major --w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/remove --w------- 1 root root 4096 Sep 3 20:38 /sys/bus/rbd/remove_single_major This means that images can be mapped and unmapped (i.e. block devices can be created and deleted) by a UID 0 process even after it drops all privileges or by any process with CAP_DAC_OVERRIDE in its user namespace as long as UID 0 is mapped into that user namespace. Be consistent with other virtual block devices (loop, nbd, dm, md, etc) and require CAP_SYS_ADMIN in the initial user namespace for mapping and unmapping, and also for dumping the configuration string and refreshing the image header. Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton Signed-off-by: Greg Kroah-Hartman --- drivers/block/rbd.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3945,6 +3945,9 @@ static ssize_t rbd_image_refresh(struct struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); int ret; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + ret = rbd_dev_refresh(rbd_dev); if (ret) return ret; @@ -5404,6 +5407,9 @@ static ssize_t do_rbd_add(struct bus_typ bool read_only; int rc; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (!try_module_get(THIS_MODULE)) return -ENODEV; @@ -5548,6 +5554,9 @@ static ssize_t do_rbd_remove(struct bus_ bool already = false; int ret; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + ret = kstrtoul(buf, 10, &ul); if (ret) return ret; From patchwork Mon Sep 21 16:27:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3696EC43468 for ; Mon, 21 Sep 2020 16:32:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0D2F23998 for ; Mon, 21 Sep 2020 16:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705934; bh=L4cy+BqItQIYNJxvf2aTyqZgs82meBeKpk7eQAVCyPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pBHd0aAGHDQG1XUQGDIhDBwO2CuJrLednz92YIwZfDNR2DhxfAA1hV0jY+uNheuvl JZKzQqPvUYjdCXrIYUr74U9kTTHgqK8RSnTchVMP6pdb2uEK/oS8XLuxGuPpCkfFjY M+OCp79k/zaEJhzxQL08CuA8GfXNPhe+hMmdWzoI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728315AbgIUQcM (ORCPT ); Mon, 21 Sep 2020 12:32:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:57488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728409AbgIUQcL (ORCPT ); Mon, 21 Sep 2020 12:32:11 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C70B2396F; Mon, 21 Sep 2020 16:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705930; bh=L4cy+BqItQIYNJxvf2aTyqZgs82meBeKpk7eQAVCyPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SyLbkTOXJ2DooCUgpfIkKUixorx6Vu3nZM2tfmcFR8a4fgRKvbeelGReysag8VRMo 8uujlYYi6M+AI6d+i0PgrFgy0LKKlZif9PPGMSh6gKhDtTGMRzC1w9dn0nEWsjtfWN IKeWNPHUPSme1ooqAbl/VKvlS1zZ5kHP/tk0glmE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuan Ming , Willy Tarreau , Bartlomiej Zolnierkiewicz , Daniel Vetter , Linus Torvalds Subject: [PATCH 4.4 20/46] fbcon: remove soft scrollback code Date: Mon, 21 Sep 2020 18:27:36 +0200 Message-Id: <20200921162034.253730633@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Torvalds commit 50145474f6ef4a9c19205b173da6264a644c7489 upstream. This (and the VGA soft scrollback) turns out to have various nasty small special cases that nobody really is willing to fight. The soft scrollback code was really useful a few decades ago when you typically used the console interactively as the main way to interact with the machine, but that just isn't the case any more. So it's not worth dragging along. Tested-by: Yuan Ming Tested-by: Willy Tarreau Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Daniel Vetter Reviewed-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/video/console/fbcon.c | 336 ------------------------------------------ 1 file changed, 4 insertions(+), 332 deletions(-) --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -101,12 +101,6 @@ static int logo_lines; /* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO enums. */ static int logo_shown = FBCON_LOGO_CANSHOW; -/* Software scrollback */ -static int fbcon_softback_size = 32768; -static unsigned long softback_buf, softback_curr; -static unsigned long softback_in; -static unsigned long softback_top, softback_end; -static int softback_lines; /* console mappings */ static int first_fb_vc; static int last_fb_vc = MAX_NR_CONSOLES - 1; @@ -140,8 +134,6 @@ static int fbcon_has_sysfs; static const struct consw fb_con; -#define CM_SOFTBACK (8) - #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row) static int fbcon_set_origin(struct vc_data *); @@ -171,7 +163,6 @@ static void fbcon_bmove(struct vc_data * static int fbcon_switch(struct vc_data *vc); static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch); static int fbcon_set_palette(struct vc_data *vc, unsigned char *table); -static int fbcon_scrolldelta(struct vc_data *vc, int lines); /* * Internal routines @@ -350,18 +341,6 @@ static int get_color(struct vc_data *vc, return color; } -static void fbcon_update_softback(struct vc_data *vc) -{ - int l = fbcon_softback_size / vc->vc_size_row; - - if (l > 5) - softback_end = softback_buf + l * vc->vc_size_row; - else - /* Smaller scrollback makes no sense, and 0 would screw - the operation totally */ - softback_top = 0; -} - static void fb_flashcursor(struct work_struct *work) { struct fb_info *info = container_of(work, struct fb_info, queue); @@ -391,7 +370,7 @@ static void fb_flashcursor(struct work_s c = scr_readw((u16 *) vc->vc_pos); mode = (!ops->cursor_flash || ops->cursor_state.enable) ? CM_ERASE : CM_DRAW; - ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), + ops->cursor(vc, info, mode, 0, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); console_unlock(); } @@ -451,13 +430,7 @@ static int __init fb_console_setup(char } if (!strncmp(options, "scrollback:", 11)) { - options += 11; - if (*options) { - fbcon_softback_size = simple_strtoul(options, &options, 0); - if (*options == 'k' || *options == 'K') { - fbcon_softback_size *= 1024; - } - } + pr_warn("Ignoring scrollback size option\n"); continue; } @@ -962,31 +935,6 @@ static const char *fbcon_startup(void) p->con_rotate = initial_rotation; set_blitting_type(vc, info); - if (info->fix.type != FB_TYPE_TEXT) { - if (fbcon_softback_size) { - if (!softback_buf) { - softback_buf = - (unsigned long) - kmalloc(fbcon_softback_size, - GFP_KERNEL); - if (!softback_buf) { - fbcon_softback_size = 0; - softback_top = 0; - } - } - } else { - if (softback_buf) { - kfree((void *) softback_buf); - softback_buf = 0; - softback_top = 0; - } - } - if (softback_buf) - softback_in = softback_top = softback_curr = - softback_buf; - softback_lines = 0; - } - /* Setup default font */ if (!p->fontdata && !vc->vc_font.data) { if (!fontname[0] || !(font = find_font(fontname))) @@ -1149,9 +1097,6 @@ static void fbcon_init(struct vc_data *v if (logo) fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows); - if (vc == svc && softback_buf) - fbcon_update_softback(vc); - if (ops->rotate_font && ops->rotate_font(info, vc)) { ops->rotate = FB_ROTATE_UR; set_blitting_type(vc, info); @@ -1311,7 +1256,6 @@ static void fbcon_cursor(struct vc_data { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - int y; int c = scr_readw((u16 *) vc->vc_pos); ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); @@ -1325,16 +1269,8 @@ static void fbcon_cursor(struct vc_data fbcon_add_cursor_timer(info); ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; - if (mode & CM_SOFTBACK) { - mode &= ~CM_SOFTBACK; - y = softback_lines; - } else { - if (softback_lines) - fbcon_set_origin(vc); - y = 0; - } - ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1), + ops->cursor(vc, info, mode, 0, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); } @@ -1405,8 +1341,6 @@ static void fbcon_set_disp(struct fb_inf if (CON_IS_VISIBLE(vc)) { update_screen(vc); - if (softback_buf) - fbcon_update_softback(vc); } } @@ -1544,99 +1478,6 @@ static __inline__ void ypan_down_redraw( scrollback_current = 0; } -static void fbcon_redraw_softback(struct vc_data *vc, struct display *p, - long delta) -{ - int count = vc->vc_rows; - unsigned short *d, *s; - unsigned long n; - int line = 0; - - d = (u16 *) softback_curr; - if (d == (u16 *) softback_in) - d = (u16 *) vc->vc_origin; - n = softback_curr + delta * vc->vc_size_row; - softback_lines -= delta; - if (delta < 0) { - if (softback_curr < softback_top && n < softback_buf) { - n += softback_end - softback_buf; - if (n < softback_top) { - softback_lines -= - (softback_top - n) / vc->vc_size_row; - n = softback_top; - } - } else if (softback_curr >= softback_top - && n < softback_top) { - softback_lines -= - (softback_top - n) / vc->vc_size_row; - n = softback_top; - } - } else { - if (softback_curr > softback_in && n >= softback_end) { - n += softback_buf - softback_end; - if (n > softback_in) { - n = softback_in; - softback_lines = 0; - } - } else if (softback_curr <= softback_in && n > softback_in) { - n = softback_in; - softback_lines = 0; - } - } - if (n == softback_curr) - return; - softback_curr = n; - s = (u16 *) softback_curr; - if (s == (u16 *) softback_in) - s = (u16 *) vc->vc_origin; - while (count--) { - unsigned short *start; - unsigned short *le; - unsigned short c; - int x = 0; - unsigned short attr = 1; - - start = s; - le = advance_row(s, 1); - do { - c = scr_readw(s); - if (attr != (c & 0xff00)) { - attr = c & 0xff00; - if (s > start) { - fbcon_putcs(vc, start, s - start, - line, x); - x += s - start; - start = s; - } - } - if (c == scr_readw(d)) { - if (s > start) { - fbcon_putcs(vc, start, s - start, - line, x); - x += s - start + 1; - start = s + 1; - } else { - x++; - start++; - } - } - s++; - d++; - } while (s < le); - if (s > start) - fbcon_putcs(vc, start, s - start, line, x); - line++; - if (d == (u16 *) softback_end) - d = (u16 *) softback_buf; - if (d == (u16 *) softback_in) - d = (u16 *) vc->vc_origin; - if (s == (u16 *) softback_end) - s = (u16 *) softback_buf; - if (s == (u16 *) softback_in) - s = (u16 *) vc->vc_origin; - } -} - static void fbcon_redraw_move(struct vc_data *vc, struct display *p, int line, int count, int dy) { @@ -1776,31 +1617,6 @@ static void fbcon_redraw(struct vc_data } } -static inline void fbcon_softback_note(struct vc_data *vc, int t, - int count) -{ - unsigned short *p; - - if (vc->vc_num != fg_console) - return; - p = (unsigned short *) (vc->vc_origin + t * vc->vc_size_row); - - while (count) { - scr_memcpyw((u16 *) softback_in, p, vc->vc_size_row); - count--; - p = advance_row(p, 1); - softback_in += vc->vc_size_row; - if (softback_in == softback_end) - softback_in = softback_buf; - if (softback_in == softback_top) { - softback_top += vc->vc_size_row; - if (softback_top == softback_end) - softback_top = softback_buf; - } - } - softback_curr = softback_in; -} - static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, int count) { @@ -1823,8 +1639,6 @@ static int fbcon_scroll(struct vc_data * case SM_UP: if (count > vc->vc_rows) /* Maximum realistic size */ count = vc->vc_rows; - if (softback_top) - fbcon_softback_note(vc, t, count); if (logo_shown >= 0) goto redraw_up; switch (p->scrollmode) { @@ -2195,14 +2009,6 @@ static int fbcon_switch(struct vc_data * info = registered_fb[con2fb_map[vc->vc_num]]; ops = info->fbcon_par; - if (softback_top) { - if (softback_lines) - fbcon_set_origin(vc); - softback_top = softback_curr = softback_in = softback_buf; - softback_lines = 0; - fbcon_update_softback(vc); - } - if (logo_shown >= 0) { struct vc_data *conp2 = vc_cons[logo_shown].d; @@ -2536,9 +2342,6 @@ static int fbcon_do_set_font(struct vc_d int cnt; char *old_data = NULL; - if (CON_IS_VISIBLE(vc) && softback_lines) - fbcon_set_origin(vc); - resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); if (p->userfont) old_data = vc->vc_font.data; @@ -2564,8 +2367,6 @@ static int fbcon_do_set_font(struct vc_d cols /= w; rows /= h; vc_resize(vc, cols, rows); - if (CON_IS_VISIBLE(vc) && softback_buf) - fbcon_update_softback(vc); } else if (CON_IS_VISIBLE(vc) && vc->vc_mode == KD_TEXT) { fbcon_clear_margins(vc, 0); @@ -2723,19 +2524,7 @@ static int fbcon_set_palette(struct vc_d static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) { - unsigned long p; - int line; - - if (vc->vc_num != fg_console || !softback_lines) - return (u16 *) (vc->vc_origin + offset); - line = offset / vc->vc_size_row; - if (line >= softback_lines) - return (u16 *) (vc->vc_origin + offset - - softback_lines * vc->vc_size_row); - p = softback_curr + offset; - if (p >= softback_end) - p += softback_buf - softback_end; - return (u16 *) p; + return (u16 *) (vc->vc_origin + offset); } static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos, @@ -2749,22 +2538,7 @@ static unsigned long fbcon_getxy(struct x = offset % vc->vc_cols; y = offset / vc->vc_cols; - if (vc->vc_num == fg_console) - y += softback_lines; ret = pos + (vc->vc_cols - x) * 2; - } else if (vc->vc_num == fg_console && softback_lines) { - unsigned long offset = pos - softback_curr; - - if (pos < softback_curr) - offset += softback_end - softback_buf; - offset /= 2; - x = offset % vc->vc_cols; - y = offset / vc->vc_cols; - ret = pos + (vc->vc_cols - x) * 2; - if (ret == softback_end) - ret = softback_buf; - if (ret == softback_in) - ret = vc->vc_origin; } else { /* Should not happen */ x = y = 0; @@ -2792,107 +2566,11 @@ static void fbcon_invert_region(struct v a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4); scr_writew(a, p++); - if (p == (u16 *) softback_end) - p = (u16 *) softback_buf; - if (p == (u16 *) softback_in) - p = (u16 *) vc->vc_origin; } } -static int fbcon_scrolldelta(struct vc_data *vc, int lines) -{ - struct fb_info *info = registered_fb[con2fb_map[fg_console]]; - struct fbcon_ops *ops = info->fbcon_par; - struct display *disp = &fb_display[fg_console]; - int offset, limit, scrollback_old; - - if (softback_top) { - if (vc->vc_num != fg_console) - return 0; - if (vc->vc_mode != KD_TEXT || !lines) - return 0; - if (logo_shown >= 0) { - struct vc_data *conp2 = vc_cons[logo_shown].d; - - if (conp2->vc_top == logo_lines - && conp2->vc_bottom == conp2->vc_rows) - conp2->vc_top = 0; - if (logo_shown == vc->vc_num) { - unsigned long p, q; - int i; - - p = softback_in; - q = vc->vc_origin + - logo_lines * vc->vc_size_row; - for (i = 0; i < logo_lines; i++) { - if (p == softback_top) - break; - if (p == softback_buf) - p = softback_end; - p -= vc->vc_size_row; - q -= vc->vc_size_row; - scr_memcpyw((u16 *) q, (u16 *) p, - vc->vc_size_row); - } - softback_in = softback_curr = p; - update_region(vc, vc->vc_origin, - logo_lines * vc->vc_cols); - } - logo_shown = FBCON_LOGO_CANSHOW; - } - fbcon_cursor(vc, CM_ERASE | CM_SOFTBACK); - fbcon_redraw_softback(vc, disp, lines); - fbcon_cursor(vc, CM_DRAW | CM_SOFTBACK); - return 0; - } - - if (!scrollback_phys_max) - return -ENOSYS; - - scrollback_old = scrollback_current; - scrollback_current -= lines; - if (scrollback_current < 0) - scrollback_current = 0; - else if (scrollback_current > scrollback_max) - scrollback_current = scrollback_max; - if (scrollback_current == scrollback_old) - return 0; - - if (fbcon_is_inactive(vc, info)) - return 0; - - fbcon_cursor(vc, CM_ERASE); - - offset = disp->yscroll - scrollback_current; - limit = disp->vrows; - switch (disp->scrollmode) { - case SCROLL_WRAP_MOVE: - info->var.vmode |= FB_VMODE_YWRAP; - break; - case SCROLL_PAN_MOVE: - case SCROLL_PAN_REDRAW: - limit -= vc->vc_rows; - info->var.vmode &= ~FB_VMODE_YWRAP; - break; - } - if (offset < 0) - offset += limit; - else if (offset >= limit) - offset -= limit; - - ops->var.xoffset = 0; - ops->var.yoffset = offset * vc->vc_font.height; - ops->update_start(info); - - if (!scrollback_current) - fbcon_cursor(vc, CM_DRAW); - return 0; -} - static int fbcon_set_origin(struct vc_data *vc) { - if (softback_lines) - fbcon_scrolldelta(vc, softback_lines); return 0; } @@ -2956,8 +2634,6 @@ static void fbcon_modechanged(struct fb_ fbcon_set_palette(vc, color_table); update_screen(vc); - if (softback_buf) - fbcon_update_softback(vc); } } @@ -3378,7 +3054,6 @@ static const struct consw fb_con = { .con_font_default = fbcon_set_def_font, .con_font_copy = fbcon_copy_font, .con_set_palette = fbcon_set_palette, - .con_scrolldelta = fbcon_scrolldelta, .con_set_origin = fbcon_set_origin, .con_invert_region = fbcon_invert_region, .con_screen_pos = fbcon_screen_pos, @@ -3587,9 +3262,6 @@ static void fbcon_exit(void) if (fbcon_has_exited) return; - kfree((void *)softback_buf); - softback_buf = 0UL; - for (i = 0; i < FB_MAX; i++) { int pending = 0; From patchwork Mon Sep 21 16:27:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D9F6C43466 for ; Mon, 21 Sep 2020 16:32:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66D942399C for ; Mon, 21 Sep 2020 16:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705938; bh=HfncYKPwYgNi3iCxwvWGSC58k36zuKOdf/HdWoFv6rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hd2ETirquaNJwknhXvHQ9B+zhZRO90KaMOySozeLhpA5zVtn3RF9NKS8OIbZ7FDzu +W3ShqJoahnZ+HmIrLGoNn8ZVPusFYRXZRegAwQlC4jhEvT75ABqVxhSQPsEx7RsyJ 6vpnj2c5lKMJz1LiRudbzzCpO44H9U/JHdzfgvwc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728424AbgIUQcQ (ORCPT ); Mon, 21 Sep 2020 12:32:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:57558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728417AbgIUQcN (ORCPT ); Mon, 21 Sep 2020 12:32:13 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6AAE620757; Mon, 21 Sep 2020 16:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705933; bh=HfncYKPwYgNi3iCxwvWGSC58k36zuKOdf/HdWoFv6rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SjKnz1E3xVUoNYXqoFbfFc6dHXYEPmuIGvRJfuHcmbnVuX2LNz7rsjeFYXsh5/vh9 sXQrJ5x/La7gTjAN01ydAm3FObqp8F+TPnT30sev8g8KEPt2DzMn34ImwWQDQA2qlm DOOpM882hSuYrpbTbWdVHQxF1kqnosR50K7j9Dzs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuan Ming , Willy Tarreau , Linus Torvalds Subject: [PATCH 4.4 21/46] fbcon: remove now unusued softback_lines cursor() argument Date: Mon, 21 Sep 2020 18:27:37 +0200 Message-Id: <20200921162034.298075856@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Torvalds commit 06a0df4d1b8b13b551668e47b11fd7629033b7df upstream. Since the softscroll code got removed, this argument is always zero and makes no sense any more. Tested-by: Yuan Ming Tested-by: Willy Tarreau Reviewed-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/video/console/bitblit.c | 11 +---------- drivers/video/console/fbcon.c | 4 ++-- drivers/video/console/fbcon.h | 2 +- drivers/video/console/fbcon_ccw.c | 11 +---------- drivers/video/console/fbcon_cw.c | 11 +---------- drivers/video/console/fbcon_ud.c | 11 +---------- drivers/video/console/tileblit.c | 2 +- 7 files changed, 8 insertions(+), 44 deletions(-) --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c @@ -234,7 +234,7 @@ static void bit_clear_margins(struct vc_ } static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, - int softback_lines, int fg, int bg) + int fg, int bg) { struct fb_cursor cursor; struct fbcon_ops *ops = info->fbcon_par; @@ -247,15 +247,6 @@ static void bit_cursor(struct vc_data *v cursor.set = 0; - if (softback_lines) { - if (y + softback_lines >= vc->vc_rows) { - mode = CM_ERASE; - ops->cursor_flash = 0; - return; - } else - y += softback_lines; - } - c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); src = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height)); --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -370,7 +370,7 @@ static void fb_flashcursor(struct work_s c = scr_readw((u16 *) vc->vc_pos); mode = (!ops->cursor_flash || ops->cursor_state.enable) ? CM_ERASE : CM_DRAW; - ops->cursor(vc, info, mode, 0, get_color(vc, info, c, 1), + ops->cursor(vc, info, mode, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); console_unlock(); } @@ -1270,7 +1270,7 @@ static void fbcon_cursor(struct vc_data ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; - ops->cursor(vc, info, mode, 0, get_color(vc, info, c, 1), + ops->cursor(vc, info, mode, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); } --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h @@ -62,7 +62,7 @@ struct fbcon_ops { void (*clear_margins)(struct vc_data *vc, struct fb_info *info, int bottom_only); void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode, - int softback_lines, int fg, int bg); + int fg, int bg); int (*update_start)(struct fb_info *info); int (*rotate_font)(struct fb_info *info, struct vc_data *vc); struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ --- a/drivers/video/console/fbcon_ccw.c +++ b/drivers/video/console/fbcon_ccw.c @@ -219,7 +219,7 @@ static void ccw_clear_margins(struct vc_ } static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode, - int softback_lines, int fg, int bg) + int fg, int bg) { struct fb_cursor cursor; struct fbcon_ops *ops = info->fbcon_par; @@ -236,15 +236,6 @@ static void ccw_cursor(struct vc_data *v cursor.set = 0; - if (softback_lines) { - if (y + softback_lines >= vc->vc_rows) { - mode = CM_ERASE; - ops->cursor_flash = 0; - return; - } else - y += softback_lines; - } - c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); --- a/drivers/video/console/fbcon_cw.c +++ b/drivers/video/console/fbcon_cw.c @@ -202,7 +202,7 @@ static void cw_clear_margins(struct vc_d } static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, - int softback_lines, int fg, int bg) + int fg, int bg) { struct fb_cursor cursor; struct fbcon_ops *ops = info->fbcon_par; @@ -219,15 +219,6 @@ static void cw_cursor(struct vc_data *vc cursor.set = 0; - if (softback_lines) { - if (y + softback_lines >= vc->vc_rows) { - mode = CM_ERASE; - ops->cursor_flash = 0; - return; - } else - y += softback_lines; - } - c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); --- a/drivers/video/console/fbcon_ud.c +++ b/drivers/video/console/fbcon_ud.c @@ -249,7 +249,7 @@ static void ud_clear_margins(struct vc_d } static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, - int softback_lines, int fg, int bg) + int fg, int bg) { struct fb_cursor cursor; struct fbcon_ops *ops = info->fbcon_par; @@ -267,15 +267,6 @@ static void ud_cursor(struct vc_data *vc cursor.set = 0; - if (softback_lines) { - if (y + softback_lines >= vc->vc_rows) { - mode = CM_ERASE; - ops->cursor_flash = 0; - return; - } else - y += softback_lines; - } - c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); --- a/drivers/video/console/tileblit.c +++ b/drivers/video/console/tileblit.c @@ -80,7 +80,7 @@ static void tile_clear_margins(struct vc } static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode, - int softback_lines, int fg, int bg) + int fg, int bg) { struct fb_tilecursor cursor; int use_sw = (vc->vc_cursor_type & 0x10); From patchwork Mon Sep 21 16:27:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B637FC43469 for ; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EFA8239EB for ; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705952; bh=mUB9LSDkQjmKRBhMpYIZ5OSZkr77dosOFdY2iOxg0ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NDkLFz13cSdmogYYU2KuHzwa0SG7EY6szyyB1bsp7vRhGNAcgW3UUhA2flPV9+W66 x9BCTLiXncP+7jOYRoGD5F83WLhp+NWSkEdMUOAHacVy+tvnh8zyqZGEY6vdVoJTSD 9lmBWFJEQ9Z3joPmllU5Pp/t8WSoh0tZA0qpWz0E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728478AbgIUQcb (ORCPT ); Mon, 21 Sep 2020 12:32:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:57634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728427AbgIUQcR (ORCPT ); Mon, 21 Sep 2020 12:32:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E3DCA235F9; Mon, 21 Sep 2020 16:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705935; bh=mUB9LSDkQjmKRBhMpYIZ5OSZkr77dosOFdY2iOxg0ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vKQWfDrFn+RrJNJlxCvLcqAoF9cAgMPWIcsBHtPTAB+pCPtSsy6mAuEA5o7SvdHYE NjZG+VbItl6KcjB66H19ufdqG8KmgdrIerZX4Kanrm4p1D2ejUaOOk6O0JBD2b8ASx F806H00jiHPxgERCsUsT4Rz2BjkpMMVse+kvXLYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NopNop Nop , Willy Tarreau , =?utf-8?b?5byg5LqR5rW3?= , Andy Lutomirski , Linus Torvalds Subject: [PATCH 4.4 22/46] vgacon: remove software scrollback support Date: Mon, 21 Sep 2020 18:27:38 +0200 Message-Id: <20200921162034.333966952@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Torvalds commit 973c096f6a85e5b5f2a295126ba6928d9a6afd45 upstream. Yunhai Zhang recently fixed a VGA software scrollback bug in commit ebfdfeeae8c0 ("vgacon: Fix for missing check in scrollback handling"), but that then made people look more closely at some of this code, and there were more problems on the vgacon side, but also the fbcon software scrollback. We don't really have anybody who maintains this code - probably because nobody actually _uses_ it any more. Sure, people still use both VGA and the framebuffer consoles, but they are no longer the main user interfaces to the kernel, and haven't been for decades, so these kinds of extra features end up bitrotting and not really being used. So rather than try to maintain a likely unused set of code, I'll just aggressively remove it, and see if anybody even notices. Maybe there are people who haven't jumped on the whole GUI badnwagon yet, and think it's just a fad. And maybe those people use the scrollback code. If that turns out to be the case, we can resurrect this again, once we've found the sucker^Wmaintainer for it who actually uses it. Reported-by: NopNop Nop Tested-by: Willy Tarreau Cc: 张云海 Acked-by: Andy Lutomirski Acked-by: Willy Tarreau Reviewed-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/configs/pasemi_defconfig | 1 arch/powerpc/configs/ppc6xx_defconfig | 1 arch/x86/configs/i386_defconfig | 1 arch/x86/configs/x86_64_defconfig | 1 drivers/video/console/Kconfig | 25 ----- drivers/video/console/vgacon.c | 161 ---------------------------------- 6 files changed, 1 insertion(+), 189 deletions(-) --- a/arch/powerpc/configs/pasemi_defconfig +++ b/arch/powerpc/configs/pasemi_defconfig @@ -115,7 +115,6 @@ CONFIG_FB_NVIDIA=y CONFIG_FB_NVIDIA_I2C=y CONFIG_FB_RADEON=y # CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_LOGO=y CONFIG_SOUND=y CONFIG_SND=y --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig @@ -797,7 +797,6 @@ CONFIG_FB_TRIDENT=m CONFIG_FB_SM501=m CONFIG_FB_IBM_GXT4500=y CONFIG_LCD_PLATFORM=m -CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y CONFIG_LOGO=y --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig @@ -218,7 +218,6 @@ CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y CONFIG_FB_EFI=y # CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig @@ -212,7 +212,6 @@ CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y CONFIG_FB_EFI=y # CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -22,31 +22,6 @@ config VGA_CONSOLE Say Y. -config VGACON_SOFT_SCROLLBACK - bool "Enable Scrollback Buffer in System RAM" - depends on VGA_CONSOLE - default n - help - The scrollback buffer of the standard VGA console is located in - the VGA RAM. The size of this RAM is fixed and is quite small. - If you require a larger scrollback buffer, this can be placed in - System RAM which is dynamically allocated during initialization. - Placing the scrollback buffer in System RAM will slightly slow - down the console. - - If you want this feature, say 'Y' here and enter the amount of - RAM to allocate for this buffer. If unsure, say 'N'. - -config VGACON_SOFT_SCROLLBACK_SIZE - int "Scrollback Buffer Size (in KB)" - depends on VGACON_SOFT_SCROLLBACK - range 1 1024 - default "64" - help - Enter the amount of System RAM to allocate for the scrollback - buffer. Each 64KB will give you approximately 16 80x25 - screenfuls of scrollback buffer - config MDA_CONSOLE depends on !M68K && !PARISC && ISA tristate "MDA text console (dual-headed)" --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -180,159 +180,6 @@ static inline void vga_set_mem_top(struc write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2); } -#ifdef CONFIG_VGACON_SOFT_SCROLLBACK -/* software scrollback */ -static void *vgacon_scrollback; -static int vgacon_scrollback_tail; -static int vgacon_scrollback_size; -static int vgacon_scrollback_rows; -static int vgacon_scrollback_cnt; -static int vgacon_scrollback_cur; -static int vgacon_scrollback_save; -static int vgacon_scrollback_restore; - -static void vgacon_scrollback_init(int pitch) -{ - int rows = CONFIG_VGACON_SOFT_SCROLLBACK_SIZE * 1024/pitch; - - if (vgacon_scrollback) { - vgacon_scrollback_cnt = 0; - vgacon_scrollback_tail = 0; - vgacon_scrollback_cur = 0; - vgacon_scrollback_rows = rows - 1; - vgacon_scrollback_size = rows * pitch; - } -} - -static void vgacon_scrollback_startup(void) -{ - vgacon_scrollback = kcalloc(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, 1024, GFP_NOWAIT); - vgacon_scrollback_init(vga_video_num_columns * 2); -} - -static void vgacon_scrollback_update(struct vc_data *c, int t, int count) -{ - void *p; - - if (!vgacon_scrollback_size || c->vc_num != fg_console) - return; - - p = (void *) (c->vc_origin + t * c->vc_size_row); - - while (count--) { - if ((vgacon_scrollback_tail + c->vc_size_row) > - vgacon_scrollback_size) - vgacon_scrollback_tail = 0; - - scr_memcpyw(vgacon_scrollback + vgacon_scrollback_tail, - p, c->vc_size_row); - vgacon_scrollback_cnt++; - p += c->vc_size_row; - vgacon_scrollback_tail += c->vc_size_row; - - if (vgacon_scrollback_tail >= vgacon_scrollback_size) - vgacon_scrollback_tail = 0; - - if (vgacon_scrollback_cnt > vgacon_scrollback_rows) - vgacon_scrollback_cnt = vgacon_scrollback_rows; - - vgacon_scrollback_cur = vgacon_scrollback_cnt; - } -} - -static void vgacon_restore_screen(struct vc_data *c) -{ - vgacon_scrollback_save = 0; - - if (!vga_is_gfx && !vgacon_scrollback_restore) { - scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf, - c->vc_screenbuf_size > vga_vram_size ? - vga_vram_size : c->vc_screenbuf_size); - vgacon_scrollback_restore = 1; - vgacon_scrollback_cur = vgacon_scrollback_cnt; - } -} - -static int vgacon_scrolldelta(struct vc_data *c, int lines) -{ - int start, end, count, soff; - - if (!lines) { - c->vc_visible_origin = c->vc_origin; - vga_set_mem_top(c); - return 1; - } - - if (!vgacon_scrollback) - return 1; - - if (!vgacon_scrollback_save) { - vgacon_cursor(c, CM_ERASE); - vgacon_save_screen(c); - vgacon_scrollback_save = 1; - } - - vgacon_scrollback_restore = 0; - start = vgacon_scrollback_cur + lines; - end = start + abs(lines); - - if (start < 0) - start = 0; - - if (start > vgacon_scrollback_cnt) - start = vgacon_scrollback_cnt; - - if (end < 0) - end = 0; - - if (end > vgacon_scrollback_cnt) - end = vgacon_scrollback_cnt; - - vgacon_scrollback_cur = start; - count = end - start; - soff = vgacon_scrollback_tail - ((vgacon_scrollback_cnt - end) * - c->vc_size_row); - soff -= count * c->vc_size_row; - - if (soff < 0) - soff += vgacon_scrollback_size; - - count = vgacon_scrollback_cnt - start; - - if (count > c->vc_rows) - count = c->vc_rows; - - if (count) { - int copysize; - - int diff = c->vc_rows - count; - void *d = (void *) c->vc_origin; - void *s = (void *) c->vc_screenbuf; - - count *= c->vc_size_row; - /* how much memory to end of buffer left? */ - copysize = min(count, vgacon_scrollback_size - soff); - scr_memcpyw(d, vgacon_scrollback + soff, copysize); - d += copysize; - count -= copysize; - - if (count) { - scr_memcpyw(d, vgacon_scrollback, count); - d += count; - } - - if (diff) - scr_memcpyw(d, s, diff * c->vc_size_row); - } else - vgacon_cursor(c, CM_MOVE); - - return 1; -} -#else -#define vgacon_scrollback_startup(...) do { } while (0) -#define vgacon_scrollback_init(...) do { } while (0) -#define vgacon_scrollback_update(...) do { } while (0) - static void vgacon_restore_screen(struct vc_data *c) { if (c->vc_origin != c->vc_visible_origin) @@ -369,7 +216,6 @@ static int vgacon_scrolldelta(struct vc_ vga_set_mem_top(c); return 1; } -#endif /* CONFIG_VGACON_SOFT_SCROLLBACK */ static const char *vgacon_startup(void) { @@ -566,10 +412,7 @@ static const char *vgacon_startup(void) vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH; vgacon_yres = vga_scan_lines; - if (!vga_init_done) { - vgacon_scrollback_startup(); - vga_init_done = 1; - } + vga_init_done = 1; return display_desc; } @@ -865,7 +708,6 @@ static int vgacon_switch(struct vc_data vgacon_doresize(c, c->vc_cols, c->vc_rows); } - vgacon_scrollback_init(c->vc_size_row); return 0; /* Redrawing not needed */ } @@ -1398,7 +1240,6 @@ static int vgacon_scroll(struct vc_data oldo = c->vc_origin; delta = lines * c->vc_size_row; if (dir == SM_UP) { - vgacon_scrollback_update(c, t, lines); if (c->vc_scr_end + delta >= vga_vram_end) { scr_memcpyw((u16 *) vga_vram_base, (u16 *) (oldo + delta), From patchwork Mon Sep 21 16:27:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73A62C43466 for ; Mon, 21 Sep 2020 16:33:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 342AE239D1 for ; Mon, 21 Sep 2020 16:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705980; bh=WmtjWsOny2QlLubrxPi4PmJDlp50Qrs17uNvsCqhWOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ycnjj6QygghtxdKpvvj6UlUfoHJIGoTVP9dnobCz/NAGwYFDdodG0meiQjaWOLG2T WSRDTTDGbJrHLbRIl7WkM9WvKG2vUB+0Uv0vi6Z3/lDFuG4U7fZOIOJxoLo7pBTrQn Jo6jM/gU8ThCKAIrYpsp4zc8z+RIglw5iVoOOwvU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728437AbgIUQcc (ORCPT ); Mon, 21 Sep 2020 12:32:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:57794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728417AbgIUQcU (ORCPT ); Mon, 21 Sep 2020 12:32:20 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B201C2399A; Mon, 21 Sep 2020 16:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705940; bh=WmtjWsOny2QlLubrxPi4PmJDlp50Qrs17uNvsCqhWOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QrfDe11L27A5z+Qj0qBSdqC+f9t0MBvjhSUt+aD9xa64phvNAONkCP9uex64iJsAn ug3nKLWE5ZLZvV9juOUU6A/kd51BffNs727YcANVN7nhPz5m3FKyAOn5u2TPm7+qo7 +IgdFtmGeZiue/OwbyaUC2lfgWueUWuk9q7cp7pQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wanpeng Li , Paolo Bonzini Subject: [PATCH 4.4 23/46] KVM: VMX: Dont freeze guest when event delivery causes an APIC-access exit Date: Mon, 21 Sep 2020 18:27:39 +0200 Message-Id: <20200921162034.380847224@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wanpeng Li commit 99b82a1437cb31340dbb2c437a2923b9814a7b15 upstream. According to SDM 27.2.4, Event delivery causes an APIC-access VM exit. Don't report internal error and freeze guest when event delivery causes an APIC-access exit, it is handleable and the event will be re-injected during the next vmentry. Signed-off-by: Wanpeng Li Message-Id: <1597827327-25055-2-git-send-email-wanpengli@tencent.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8235,6 +8235,7 @@ static int vmx_handle_exit(struct kvm_vc (exit_reason != EXIT_REASON_EXCEPTION_NMI && exit_reason != EXIT_REASON_EPT_VIOLATION && exit_reason != EXIT_REASON_PML_FULL && + exit_reason != EXIT_REASON_APIC_ACCESS && exit_reason != EXIT_REASON_TASK_SWITCH)) { vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV; From patchwork Mon Sep 21 16:27:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 805FCC43465 for ; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4353F239D2 for ; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705952; bh=/6ABPznMbPJMPHwQ9dNfrnIj4B/bBpl7xDMTEHxTExI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=unogCx/Bord8wNqsX5LMQ9jCNSptrLwJbeVuGjr1oJU0NqHc+eOQljxP2yYNcw2zS Z7Vkn2OzxCCOjnah6sRdME7WxusdV9qWmyfilmtzTprgHIdNwlH3bhQ/BkBmdVg9aq JhldgqMfHyzBMSaWoSfIFGA81Qt6tAq6ydcUEXVE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728470AbgIUQcb (ORCPT ); Mon, 21 Sep 2020 12:32:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:57890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728453AbgIUQcX (ORCPT ); Mon, 21 Sep 2020 12:32:23 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6D75F23998; Mon, 21 Sep 2020 16:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705942; bh=/6ABPznMbPJMPHwQ9dNfrnIj4B/bBpl7xDMTEHxTExI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H1mLf8GJ38ytgbe7gLyz4V6ATPpI0T2iCCxaYS6SAy2YNcIo8d5BeAVr9VCttBb3/ ISggSbBQIpVAlUZI849e9E9eL3xI780j4iws6yhBQx/3Ba2fzzSwMP5ce0b+GkzvmQ aEhdbZynMjkEZ1rm0mEdpaMcgXZvbDu5v/yNojLc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Tetsuo Handa Subject: [PATCH 4.4 24/46] video: fbdev: fix OOB read in vga_8planes_imageblit() Date: Mon, 21 Sep 2020 18:27:40 +0200 Message-Id: <20200921162034.426295528@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tetsuo Handa commit bd018a6a75cebb511bb55a0e7690024be975fe93 upstream. syzbot is reporting OOB read at vga_8planes_imageblit() [1], for "cdat[y] >> 4" can become a negative value due to "const char *cdat". [1] https://syzkaller.appspot.com/bug?id=0d7a0da1557dcd1989e00cb3692b26d4173b4132 Reported-by: syzbot Signed-off-by: Tetsuo Handa Cc: stable Link: https://lore.kernel.org/r/90b55ec3-d5b0-3307-9f7c-7ff5c5fd6ad3@i-love.sakura.ne.jp Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/vga16fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -1122,7 +1122,7 @@ static void vga_8planes_imageblit(struct char oldop = setop(0); char oldsr = setsr(0); char oldmask = selectmask(); - const char *cdat = image->data; + const unsigned char *cdat = image->data; u32 dx = image->dx; char __iomem *where; int y; From patchwork Mon Sep 21 16:27:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309505 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50C67C43468 for ; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 116E123998 for ; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705952; bh=vGAAuVJ8G2tTaHOJzaFxvLOe6hHBRYasILCwvRjyMXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VjAHQomup7Lnm7EVY5IemRzGnkvB7GvJCTeO4I7CEAjlmFjnwsYL7w3ZhMft1d/qe httUAj6vR+uvwrtYNyelauYo7Ef8WBkyxJEzC37IEpnRfD3CXAbE70W/6Xxaz042al XEj8sPcLSLeGciugKJMlw6r42pl7H+uv+35jql5w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728476AbgIUQcb (ORCPT ); Mon, 21 Sep 2020 12:32:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:57964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgIUQcZ (ORCPT ); Mon, 21 Sep 2020 12:32:25 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D250D239D1; Mon, 21 Sep 2020 16:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705945; bh=vGAAuVJ8G2tTaHOJzaFxvLOe6hHBRYasILCwvRjyMXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yn0XiblQRHckijN30J4eM7EzUL8yfV4o/w4jMIjVgLySs5mqBnqkDfb9+A5GF5dZZ UzMgqJ0MN2Wwgfitb6uWOIhk+3tkdqBhFXM1A40wpQ2vwuv72gMiEWZNK67C7n7ZCi 9X7TbPXZAosxQLVyLk2TAgDiO2Tq/zAMsaeuKALQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Patrick Riphagen , Johan Hovold Subject: [PATCH 4.4 25/46] USB: serial: ftdi_sio: add IDs for Xsens Mti USB converter Date: Mon, 21 Sep 2020 18:27:41 +0200 Message-Id: <20200921162034.476418884@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Patrick Riphagen commit 6ccc48e0eb2f3a5f3bd39954a21317e5f8874726 upstream. The device added has an FTDI chip inside. The device is used to connect Xsens USB Motion Trackers. Cc: stable@vger.kernel.org Signed-off-by: Patrick Riphagen Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + 2 files changed, 2 insertions(+) --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -708,6 +708,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, + { USB_DEVICE(XSENS_VID, XSENS_MTIUSBCONVERTER_PID) }, { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h @@ -159,6 +159,7 @@ #define XSENS_AWINDA_DONGLE_PID 0x0102 #define XSENS_MTW_PID 0x0200 /* Xsens MTw */ #define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */ +#define XSENS_MTIUSBCONVERTER_PID 0x0301 /* MTi USB converter */ #define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */ /* Xsens devices using FTDI VID */ From patchwork Mon Sep 21 16:27:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263544 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D6E0C43466 for ; Mon, 21 Sep 2020 17:06:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 334942084C for ; Mon, 21 Sep 2020 17:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707996; bh=xXsQf780KKxrWSyvuZzMQJDEBPImRjRuT0OFaeDNp3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iggvod7BRW875A2INf2QP9Wyl5tuo1L74Rsvf1z3R+wAYAClIYGfUohsw6lwEE6Qr 4Kfx/zoj/iKzRjpKLZkEZq8+A/5tsWK3AnP6fsrCrqy5/w6RgT5O5H78/2HTWuuCZv WogcetmtA47hLqvsKcRZgQVPSsoCt90tKWXlrNpM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728466AbgIUQca (ORCPT ); Mon, 21 Sep 2020 12:32:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:58020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728457AbgIUQc2 (ORCPT ); Mon, 21 Sep 2020 12:32:28 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4DF952399C; Mon, 21 Sep 2020 16:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705947; bh=xXsQf780KKxrWSyvuZzMQJDEBPImRjRuT0OFaeDNp3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=US6Wx9fauJGiegCyYjrxNEwafqxHLqkw3uYnJQg/EnTw6lqn9oHxtZrgmyrxQFsGw yj4cQlTAtGFyOxGdOuYScP+WF7GNlrZo5fDOGCncNWR4fH7fCQpNpygc/E1V8Tp4C1 OjDn6clVBvWfNJGuheLTyVemrPUe1slrynrGCwUc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aleksander Morgado , Johan Hovold Subject: [PATCH 4.4 26/46] USB: serial: option: add support for SIM7070/SIM7080/SIM7090 modules Date: Mon, 21 Sep 2020 18:27:42 +0200 Message-Id: <20200921162034.517313011@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aleksander Morgado commit 1ac698790819b83f39fd7ea4f6cdabee9bdd7b38 upstream. These modules have 2 different USB layouts: The default layout with PID 0x9205 (AT+CUSBSELNV=1) exposes 4 TTYs and an ECM interface: T: Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1e0e ProdID=9205 Rev=00.00 S: Manufacturer=SimTech, Incorporated S: Product=SimTech SIM7080 S: SerialNumber=1234567890ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#=0x5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether The purpose of each TTY is as follows: * ttyUSB0: DIAG/QCDM port. * ttyUSB1: GNSS data. * ttyUSB2: AT-capable port (control). * ttyUSB3: AT-capable port (data). In the secondary layout with PID=0x9206 (AT+CUSBSELNV=86) the module exposes 6 TTY ports: T: Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1e0e ProdID=9206 Rev=00.00 S: Manufacturer=SimTech, Incorporated S: Product=SimTech SIM7080 S: SerialNumber=1234567890ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option The purpose of each TTY is as follows: * ttyUSB0: DIAG/QCDM port. * ttyUSB1: GNSS data. * ttyUSB2: AT-capable port (control). * ttyUSB3: QFLOG interface. * ttyUSB4: DAM interface. * ttyUSB5: AT-capable port (data). Signed-off-by: Aleksander Morgado Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1808,6 +1808,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */ .driver_info = RSVD(7) }, + { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9205, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT+ECM mode */ + { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9206, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT-only mode */ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D), From patchwork Mon Sep 21 16:27:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263758 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30039C43465 for ; Mon, 21 Sep 2020 16:33:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E626F239D1 for ; Mon, 21 Sep 2020 16:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705980; bh=76YyPfoaC6OBcrTNT5tcInQn9i1N8n2p4wPxKyo6cGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XB5hCrYUmGCh5fX/OH3FKuN2mrcpecYgTIaOPQildVCPJQx+EI4KaovxjyH2Mb+JC SigoFtHNy6ztQqjvIGG5uQlr0rEu3R40VZmbxzi4jHUHt2UFjH+HIXVz/U2w9MFk5U yt218Xxy+MUfZDMaOMdrHeEvd+3eI6j9wZe3/MlI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728552AbgIUQdA (ORCPT ); Mon, 21 Sep 2020 12:33:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:58062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728467AbgIUQcb (ORCPT ); Mon, 21 Sep 2020 12:32:31 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14384239A1; Mon, 21 Sep 2020 16:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705950; bh=76YyPfoaC6OBcrTNT5tcInQn9i1N8n2p4wPxKyo6cGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qte5tN4+/QNedCkv6jovZ5Z0HWa7SXPoFJRfe0wJPJLS5GCU5sOytz8Ij1IRihQpM qBB5S2xmcwfEKK7AFV73jaVPN4xTYN3QGgxb9ZKTIshYNlcBHf6IAq3quoNl2tKLl9 pDiA4kOET5BkWwrEHE0epouZOm1P65qd8bO4JNb0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Thierer , Mathias Nyman Subject: [PATCH 4.4 27/46] usb: Fix out of sync data toggle if a configured device is reconfigured Date: Mon, 21 Sep 2020 18:27:43 +0200 Message-Id: <20200921162034.555820513@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mathias Nyman commit cfd54fa83a5068b61b7eb28d3c117d8354c74c7a upstream. Userspace drivers that use a SetConfiguration() request to "lightweight" reset an already configured usb device might cause data toggles to get out of sync between the device and host, and the device becomes unusable. The xHCI host requires endpoints to be dropped and added back to reset the toggle. If USB core notices the new configuration is the same as the current active configuration it will avoid these extra steps by calling usb_reset_configuration() instead of usb_set_configuration(). A SetConfiguration() request will reset the device side data toggles. Make sure usb_reset_configuration() function also drops and adds back the endpoints to ensure data toggles are in sync. To avoid code duplication split the current usb_disable_device() function and reuse the endpoint specific part. Cc: stable Tested-by: Martin Thierer Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200901082528.12557-1-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/message.c | 93 ++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 50 deletions(-) --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1141,6 +1141,34 @@ void usb_disable_interface(struct usb_de } } +/* + * usb_disable_device_endpoints -- Disable all endpoints for a device + * @dev: the device whose endpoints are being disabled + * @skip_ep0: 0 to disable endpoint 0, 1 to skip it. + */ +static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0) +{ + struct usb_hcd *hcd = bus_to_hcd(dev->bus); + int i; + + if (hcd->driver->check_bandwidth) { + /* First pass: Cancel URBs, leave endpoint pointers intact. */ + for (i = skip_ep0; i < 16; ++i) { + usb_disable_endpoint(dev, i, false); + usb_disable_endpoint(dev, i + USB_DIR_IN, false); + } + /* Remove endpoints from the host controller internal state */ + mutex_lock(hcd->bandwidth_mutex); + usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); + mutex_unlock(hcd->bandwidth_mutex); + } + /* Second pass: remove endpoint pointers */ + for (i = skip_ep0; i < 16; ++i) { + usb_disable_endpoint(dev, i, true); + usb_disable_endpoint(dev, i + USB_DIR_IN, true); + } +} + /** * usb_disable_device - Disable all the endpoints for a USB device * @dev: the device whose endpoints are being disabled @@ -1154,7 +1182,6 @@ void usb_disable_interface(struct usb_de void usb_disable_device(struct usb_device *dev, int skip_ep0) { int i; - struct usb_hcd *hcd = bus_to_hcd(dev->bus); /* getting rid of interfaces will disconnect * any drivers bound to them (a key side effect) @@ -1200,22 +1227,8 @@ void usb_disable_device(struct usb_devic dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__, skip_ep0 ? "non-ep0" : "all"); - if (hcd->driver->check_bandwidth) { - /* First pass: Cancel URBs, leave endpoint pointers intact. */ - for (i = skip_ep0; i < 16; ++i) { - usb_disable_endpoint(dev, i, false); - usb_disable_endpoint(dev, i + USB_DIR_IN, false); - } - /* Remove endpoints from the host controller internal state */ - mutex_lock(hcd->bandwidth_mutex); - usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); - mutex_unlock(hcd->bandwidth_mutex); - /* Second pass: remove endpoint pointers */ - } - for (i = skip_ep0; i < 16; ++i) { - usb_disable_endpoint(dev, i, true); - usb_disable_endpoint(dev, i + USB_DIR_IN, true); - } + + usb_disable_device_endpoints(dev, skip_ep0); } /** @@ -1458,6 +1471,9 @@ EXPORT_SYMBOL_GPL(usb_set_interface); * The caller must own the device lock. * * Return: Zero on success, else a negative error code. + * + * If this routine fails the device will probably be in an unusable state + * with endpoints disabled, and interfaces only partially enabled. */ int usb_reset_configuration(struct usb_device *dev) { @@ -1473,10 +1489,7 @@ int usb_reset_configuration(struct usb_d * calls during probe() are fine */ - for (i = 1; i < 16; ++i) { - usb_disable_endpoint(dev, i, true); - usb_disable_endpoint(dev, i + USB_DIR_IN, true); - } + usb_disable_device_endpoints(dev, 1); /* skip ep0*/ config = dev->actconfig; retval = 0; @@ -1489,34 +1502,10 @@ int usb_reset_configuration(struct usb_d mutex_unlock(hcd->bandwidth_mutex); return -ENOMEM; } - /* Make sure we have enough bandwidth for each alternate setting 0 */ - for (i = 0; i < config->desc.bNumInterfaces; i++) { - struct usb_interface *intf = config->interface[i]; - struct usb_host_interface *alt; - - alt = usb_altnum_to_altsetting(intf, 0); - if (!alt) - alt = &intf->altsetting[0]; - if (alt != intf->cur_altsetting) - retval = usb_hcd_alloc_bandwidth(dev, NULL, - intf->cur_altsetting, alt); - if (retval < 0) - break; - } - /* If not, reinstate the old alternate settings */ + + /* xHCI adds all endpoints in usb_hcd_alloc_bandwidth */ + retval = usb_hcd_alloc_bandwidth(dev, config, NULL, NULL); if (retval < 0) { -reset_old_alts: - for (i--; i >= 0; i--) { - struct usb_interface *intf = config->interface[i]; - struct usb_host_interface *alt; - - alt = usb_altnum_to_altsetting(intf, 0); - if (!alt) - alt = &intf->altsetting[0]; - if (alt != intf->cur_altsetting) - usb_hcd_alloc_bandwidth(dev, NULL, - alt, intf->cur_altsetting); - } usb_enable_lpm(dev); mutex_unlock(hcd->bandwidth_mutex); return retval; @@ -1525,8 +1514,12 @@ reset_old_alts: USB_REQ_SET_CONFIGURATION, 0, config->desc.bConfigurationValue, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); - if (retval < 0) - goto reset_old_alts; + if (retval < 0) { + usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); + usb_enable_lpm(dev); + mutex_unlock(hcd->bandwidth_mutex); + return retval; + } mutex_unlock(hcd->bandwidth_mutex); /* re-init hc/hcd interface/endpoint state */ From patchwork Mon Sep 21 16:27:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 557CEC43466 for ; Mon, 21 Sep 2020 16:32:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FF20239D1 for ; Mon, 21 Sep 2020 16:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705978; bh=0T9A2vS3EgCx7mMbINIZB7rlmmiUXGqbIW/pd8eX46s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xaXFUr7K9wxRA/fswLcl+dSXVwmCy4ASkt4lgcInKjEKE9G9PWDZxQtwBI7dIKBEE dzaqupndXs6WSFWGOf8j5BlwhoCaqLrGwSouDPV5pUs+e6qpsUbohaxlBVTLiJAX4J RTfOIdrNWP7MYZMzT3JDtE67K7rhWeCwNM0T51hk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728541AbgIUQcv (ORCPT ); Mon, 21 Sep 2020 12:32:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728488AbgIUQcd (ORCPT ); Mon, 21 Sep 2020 12:32:33 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B2C22399C; Mon, 21 Sep 2020 16:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705953; bh=0T9A2vS3EgCx7mMbINIZB7rlmmiUXGqbIW/pd8eX46s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=15uniIATJUxoNH5CCdxmf/j93rtqMRwYlw0iwpPmWofduoZWKo91VmNJ3SG9Ei/UK 7SWLa21QBNpwjRisJHmWYUWwgyTKC0165Y1Hng6JrwuJVXjn76gs6obh2dljTnlg3e jPIE/lpTFtdYIGEAmeQwxV1uGODvF1DtVwjIzMAY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Leon Romanovsky , Peter Oberparleiter , Linus Torvalds , Sasha Levin Subject: [PATCH 4.4 28/46] gcov: add support for GCC 10.1 Date: Mon, 21 Sep 2020 18:27:44 +0200 Message-Id: <20200921162034.599261898@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Peter Oberparleiter [ Upstream commit 40249c6962075c040fd071339acae524f18bfac9 ] Using gcov to collect coverage data for kernels compiled with GCC 10.1 causes random malfunctions and kernel crashes. This is the result of a changed GCOV_COUNTERS value in GCC 10.1 that causes a mismatch between the layout of the gcov_info structure created by GCC profiling code and the related structure used by the kernel. Fix this by updating the in-kernel GCOV_COUNTERS value. Also re-enable config GCOV_KERNEL for use with GCC 10. Reported-by: Colin Ian King Reported-by: Leon Romanovsky Signed-off-by: Peter Oberparleiter Tested-by: Leon Romanovsky Tested-and-Acked-by: Colin Ian King Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- kernel/gcov/Kconfig | 1 - kernel/gcov/gcc_4_7.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig index 1d78ed19a3512..1276aabaab550 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig @@ -3,7 +3,6 @@ menu "GCOV-based kernel profiling" config GCOV_KERNEL bool "Enable gcov-based kernel profiling" depends on DEBUG_FS - depends on !CC_IS_GCC || GCC_VERSION < 100000 select CONSTRUCTORS if !UML default n ---help--- diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index 46a18e72bce61..6d5ef6220afe7 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c @@ -18,7 +18,9 @@ #include #include "gcov.h" -#if (__GNUC__ >= 7) +#if (__GNUC__ >= 10) +#define GCOV_COUNTERS 8 +#elif (__GNUC__ >= 7) #define GCOV_COUNTERS 9 #elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) #define GCOV_COUNTERS 10 From patchwork Mon Sep 21 16:27:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_NONE, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6336C43466 for ; Mon, 21 Sep 2020 16:32:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0D36239D0 for ; Mon, 21 Sep 2020 16:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705971; bh=PcFS4xgIDtvvf/g6pRLbif+U5fD1idhTuM9rUr1LFgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Srpa+q466c8afY3qQ64tKloubDVq/oyP5WBcHmWwUGX6O4g3LnVOl5AOVdEIK3oFH Iv9V5cW9fLzMlzQhWB2NnGRE+pD6N2AmdKkTY+TwXjupGq7o9CGL81dpHdGDNtsKm3 48Us22de8aLRLm6AZkPbCQ/l1c+MQQfXTNJK/d4c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbgIUQcv (ORCPT ); Mon, 21 Sep 2020 12:32:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728505AbgIUQcg (ORCPT ); Mon, 21 Sep 2020 12:32:36 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 264FB20757; Mon, 21 Sep 2020 16:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705955; bh=PcFS4xgIDtvvf/g6pRLbif+U5fD1idhTuM9rUr1LFgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AyJUXe20g20Bq8qvYaznhIM36603PIX44cziiFGhgfza/0/WbhYsEz3dezW9jJuYN OLbPOmkwDGoapkJu5au4eBFHLvxVp2nsB3093/5sYYfyj9rQYPUNjpNf9YnW7TkjVI qg2v5MIbvv/iOjGndoTKe63hV1fM7A0kL1yfSy0U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Trond Myklebust , Sasha Levin Subject: [PATCH 4.4 29/46] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall Date: Mon, 21 Sep 2020 18:27:45 +0200 Message-Id: <20200921162034.649644136@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Olga Kornievskaia [ Upstream commit 3d7a9520f0c3e6a68b6de8c5812fc8b6d7a52626 ] A client should be able to handle getting an ERR_DELAY error while doing a LOCK call to reclaim state due to delegation being recalled. This is a transient error that can happen due to server moving its volumes and invalidating its file location cache and upon reference to it during the LOCK call needing to do an expensive lookup (leading to an ERR_DELAY error on a PUTFH). Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/nfs4proc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ca1702cefb852..64d15c2662db6 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6171,7 +6171,12 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, err = nfs4_set_lock_state(state, fl); if (err != 0) return err; - err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); + do { + err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); + if (err != -NFS4ERR_DELAY) + break; + ssleep(1); + } while (err == -NFS4ERR_DELAY); return nfs4_handle_delegation_recall_error(server, state, stateid, fl, err); } From patchwork Mon Sep 21 16:27:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DECEEC43468 for ; Mon, 21 Sep 2020 16:32:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BF6A2399C for ; Mon, 21 Sep 2020 16:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705970; bh=drZYiRmwOVUnvr3J1YCJlIMxqcOH5GZK3mbze+Ex65E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BHOMUCTgncRurj4Iwhme3R9siWIH0Xdxu33AABJxYIHbjo0FyZXEspdZJVZwMrEWd Z3mXd7qr/GkYmFSMVJmw+ua97NEV8hpTM01K1rYpgQ9ZzLETzNGNa7cTgVp8Ha1pSz 0SwhlYpKT8xLTVqheVjA3pkDSAPq8MCnfJHsRFh8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728530AbgIUQcq (ORCPT ); Mon, 21 Sep 2020 12:32:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:58324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728453AbgIUQci (ORCPT ); Mon, 21 Sep 2020 12:32:38 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9404823976; Mon, 21 Sep 2020 16:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705958; bh=drZYiRmwOVUnvr3J1YCJlIMxqcOH5GZK3mbze+Ex65E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=smvN8+HZG6dhO9+FZaoWed+rzjWBjzdOBNM9rM6hscEkmruyEyb1c1ykHbEeZrwt4 RR0mxRxrqj5ZGlrk0Vg+W0xRRzjJmwjFwgpBURE+27D/W4nRLJzhUPQfEbOA7GJnZk eX6MzJpG9z9w5ZTlGtYjhua0XgExWZk9dOPOxgIc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jack Wang , Dinghao Liu , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.4 30/46] scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort Date: Mon, 21 Sep 2020 18:27:46 +0200 Message-Id: <20200921162034.699647556@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu [ Upstream commit ea403fde7552bd61bad6ea45e3feb99db77cb31e ] When pm8001_tag_alloc() fails, task should be freed just like it is done in the subsequent error paths. Link: https://lore.kernel.org/r/20200823091453.4782-1-dinghao.liu@zju.edu.cn Acked-by: Jack Wang Signed-off-by: Dinghao Liu Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm8001_sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index 3862d8b1defe3..ee6c941123e10 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -792,7 +792,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha, res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); if (res) - return res; + goto ex_err; ccb = &pm8001_ha->ccb_info[ccb_tag]; ccb->device = pm8001_dev; ccb->ccb_tag = ccb_tag; From patchwork Mon Sep 21 16:27:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BFA4C43466 for ; Mon, 21 Sep 2020 17:06:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E337C2084C for ; Mon, 21 Sep 2020 17:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707988; bh=kAMW49P1gnd6Q7vgEB8RTzXo+02ZKiNLkrobbCM3QN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PSKteAWhlfMxl1V+t91dalBKkex7muKHEQFpWTF4fqQxyyAlchq686hbr2vfWVCed LkeCLgLvh04HiNGHdaL0qPUXNr+tPMAZ00GuSMgBB/S2+TeWn+JCIW82q/eA1RvCSt 2cAYlLyHw4cZIxykdkk/nsFsFNRJebPDwZDsnVQg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730257AbgIURG1 (ORCPT ); Mon, 21 Sep 2020 13:06:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728518AbgIUQcl (ORCPT ); Mon, 21 Sep 2020 12:32:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D19D239EB; Mon, 21 Sep 2020 16:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705960; bh=kAMW49P1gnd6Q7vgEB8RTzXo+02ZKiNLkrobbCM3QN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5tlKJDeR/4bVF5cT7IkBnegW7OGrMkbtW1cVKVrMl2YHaJvBtP24mkEA7qJvWUnC JQ01C7ygVWwAIi64q6k/fzYr8Ffwm1eZEp/HC8hEOgDU2DeGkwPngVrE36B5tKYZL3 hG0/PwTMJOFlcCXle0aVNatxGrclNL8Ce2DXl1e0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.4 31/46] scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery Date: Mon, 21 Sep 2020 18:27:47 +0200 Message-Id: <20200921162034.739599477@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: James Smart [ Upstream commit 7b08e89f98cee9907895fabb64cf437bc505ce9a ] The driver is unable to successfully login with remote device. During pt2pt login, the driver completes its FLOGI request with the remote device having WWN precedence. The remote device issues its own (delayed) FLOGI after accepting the driver's and, upon transmitting the FLOGI, immediately recognizes it has already processed the driver's FLOGI thus it transitions to sending a PLOGI before waiting for an ACC to its FLOGI. In the driver, the FLOGI is received and an ACC sent, followed by the PLOGI being received and an ACC sent. The issue is that the PLOGI reception occurs before the response from the adapter from the FLOGI ACC is received. Processing of the PLOGI sets state flags to perform the REG_RPI mailbox command and proceed with the rest of discovery on the port. The same completion routine used by both FLOGI and PLOGI is generic in nature. One of the things it does is clear flags, and those flags happen to drive the rest of discovery. So what happened was the PLOGI processing set the flags, the FLOGI ACC completion cleared them, thus when the PLOGI ACC completes it doesn't see the flags and stops. Fix by modifying the generic completion routine to not clear the rest of discovery flag (NLP_ACC_REGLOGIN) unless the completion is also associated with performing a mailbox command as part of its handling. For things such as FLOGI ACC, there isn't a subsequent action to perform with the adapter, thus there is no mailbox cmd ptr. PLOGI ACC though will perform REG_RPI upon completion, thus there is a mailbox cmd ptr. Link: https://lore.kernel.org/r/20200828175332.130300-3-james.smart@broadcom.com Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_els.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 315dd25a0c44e..5be938b47f48b 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -3841,7 +3841,9 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, out: if (ndlp && NLP_CHK_NODE_ACT(ndlp) && shost) { spin_lock_irq(shost->host_lock); - ndlp->nlp_flag &= ~(NLP_ACC_REGLOGIN | NLP_RM_DFLT_RPI); + if (mbox) + ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN; + ndlp->nlp_flag &= ~NLP_RM_DFLT_RPI; spin_unlock_irq(shost->host_lock); /* If the node is not being used by another discovery thread, From patchwork Mon Sep 21 16:27:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 228CCC43469 for ; Mon, 21 Sep 2020 17:06:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC8072223E for ; Mon, 21 Sep 2020 17:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707986; bh=4kLfHlDQJODGpW1NKeZhmlYOo8d6L46sqirgCi/N0Cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SBrJPSCSaLdVrJbwVjX2iKcMWmmHfVNcMaNI1LpTn9TYfo1fM6aU1po7vQR23PYLo hban7gn+Fa3Fuc2sDyWa7nLjYBrwe9UdYkDGNbevV53lxgUbJWMtYhNLVq0xEMWTX3 lP+eSkAwGN6KWOgLAAexLRFigUSDeOHaEAOsg63Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730542AbgIURGM (ORCPT ); Mon, 21 Sep 2020 13:06:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:58472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728526AbgIUQcn (ORCPT ); Mon, 21 Sep 2020 12:32:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4BC120757; Mon, 21 Sep 2020 16:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705963; bh=4kLfHlDQJODGpW1NKeZhmlYOo8d6L46sqirgCi/N0Cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ANK9IJiKj4uZG2TM/vtReFB0WYSoyCndtGB//Bog2f8NUHlYdOp0dfe2Nhm28nfP4 g+AC2m5pbHFBT094Kz2g4rcToWLi7+SNssDuzMmj8nnkpmiQ4CPN4qkm18ATL9bjrr w/IFSoQqquQLjh7WC7wpXcYt00YfaPqg8oP7JO7o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhi Li , "J. Bruce Fields" , Trond Myklebust , Sasha Levin Subject: [PATCH 4.4 32/46] SUNRPC: stop printk reading past end of string Date: Mon, 21 Sep 2020 18:27:48 +0200 Message-Id: <20200921162034.780549642@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: J. Bruce Fields [ Upstream commit 8c6b6c793ed32b8f9770ebcdf1ba99af423c303b ] Since p points at raw xdr data, there's no guarantee that it's NULL terminated, so we should give a length. And probably escape any special characters too. Reported-by: Zhi Li Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- net/sunrpc/rpcb_clnt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index c89626b2afffb..696381a516341 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -977,8 +977,8 @@ static int rpcb_dec_getaddr(struct rpc_rqst *req, struct xdr_stream *xdr, p = xdr_inline_decode(xdr, len); if (unlikely(p == NULL)) goto out_fail; - dprintk("RPC: %5u RPCB_%s reply: %s\n", req->rq_task->tk_pid, - req->rq_task->tk_msg.rpc_proc->p_name, (char *)p); + dprintk("RPC: %5u RPCB_%s reply: %*pE\n", req->rq_task->tk_pid, + req->rq_task->tk_msg.rpc_proc->p_name, len, (char *)p); if (rpc_uaddr2sockaddr(req->rq_xprt->xprt_net, (char *)p, len, sap, sizeof(address)) == 0) From patchwork Mon Sep 21 16:27:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309292 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7476CC4346B for ; Mon, 21 Sep 2020 17:06:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38EC02085B for ; Mon, 21 Sep 2020 17:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707987; bh=7nBeLG4x7GlEf44WYDfSngB9wg7YMgJ3n2peDL60sGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sHtLT9n+/xk5n2LV3wupu9huwY+insxGm3W3BFQXaeHvYYiW6CkhmM+xMa/6Vu5cZ YqwatdOeydeQbogAAGXDnYLSayKDQK3uLQhIc4J9RS/s8iAqxJOfYyzEXrOBtfb+tl DhduyAR7AFw8H0x2TKbmMcXEdQUlLZXDPMH3Ur1U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730537AbgIURGL (ORCPT ); Mon, 21 Sep 2020 13:06:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:58586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728453AbgIUQct (ORCPT ); Mon, 21 Sep 2020 12:32:49 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 006732396F; Mon, 21 Sep 2020 16:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705968; bh=7nBeLG4x7GlEf44WYDfSngB9wg7YMgJ3n2peDL60sGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YyBJlDcpZ7jXK8FSnZmRTtONG2MzF6961+Y+ztoKs9hvI2tyxekzJuFg7EAx6GMus kQq/LbgtAlsHqMG+zC73Gw+6m1tpGtTARlHyGOZ/0noDfYZ9nW501chXT1jTlpcpUO iYC0+qQ6SmqC8TtqJdK90600sf35cP2DLARou2S4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laurent Pinchart , Randy Dunlap , Sasha Levin Subject: [PATCH 4.4 33/46] rapidio: Replace select DMAENGINES with depends on Date: Mon, 21 Sep 2020 18:27:49 +0200 Message-Id: <20200921162034.812516818@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Laurent Pinchart [ Upstream commit d2b86100245080cfdf1e95e9e07477474c1be2bd ] Enabling a whole subsystem from a single driver 'select' is frowned upon and won't be accepted in new drivers, that need to use 'depends on' instead. Existing selection of DMAENGINES will then cause circular dependencies. Replace them with a dependency. Signed-off-by: Laurent Pinchart Acked-by: Randy Dunlap Signed-off-by: Sasha Levin --- drivers/rapidio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rapidio/Kconfig b/drivers/rapidio/Kconfig index 3e3be57e9a1a1..4d0c1a40a6e65 100644 --- a/drivers/rapidio/Kconfig +++ b/drivers/rapidio/Kconfig @@ -25,7 +25,7 @@ config RAPIDIO_ENABLE_RX_TX_PORTS config RAPIDIO_DMA_ENGINE bool "DMA Engine support for RapidIO" depends on RAPIDIO - select DMADEVICES + depends on DMADEVICES select DMA_ENGINE help Say Y here if you want to use DMA Engine frameork for RapidIO data From patchwork Mon Sep 21 16:27:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5371C43465 for ; Mon, 21 Sep 2020 17:06:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE1602085B for ; Mon, 21 Sep 2020 17:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707971; bh=FdcLDIpj7/cpMfR2qbqwN7TxTM3UDHbRkP2BwTRqlMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=eiWgMkuUsl+LFAU0rBMGNdZg3Vor/WwtBRX1Kpsfix2Ak2e1BjrvwUsmw79fDFDPC zwZOOkYhp/hucrIkHOsJq0JdZk/Faxr6LQ5e3bWejyfpyXfETt0T1fwkshVmEXGoBv FuyyscoMvs7rZep5BGx1vUudY30JGY2EXZQWJLfk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730496AbgIURGK (ORCPT ); Mon, 21 Sep 2020 13:06:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:58670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgIUQcw (ORCPT ); Mon, 21 Sep 2020 12:32:52 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 895612399A; Mon, 21 Sep 2020 16:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705971; bh=FdcLDIpj7/cpMfR2qbqwN7TxTM3UDHbRkP2BwTRqlMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=edaCWj01BUkWyZcmQExvap1GLMp7HTQ1yQ6aGCpXpGuW3vF9KNizCdxaqBy0ormXf mVuKA8Ny/Y/tlVw+hembOvKCGZgfvjaCbQBePgTwxTzGstBxUy3oVMfqdwjfWiSMQG OrvlP3wwuXhglQZbPNJGcfQ6mjTf7KaqQX71yjb0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Nimmo , Chris Packham , Andy Shevchenko , Wolfram Sang , Sasha Levin Subject: [PATCH 4.4 34/46] i2c: algo: pca: Reapply i2c bus settings after reset Date: Mon, 21 Sep 2020 18:27:50 +0200 Message-Id: <20200921162034.854883822@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Evan Nimmo [ Upstream commit 0a355aeb24081e4538d4d424cd189f16c0bbd983 ] If something goes wrong (such as the SCL being stuck low) then we need to reset the PCA chip. The issue with this is that on reset we lose all config settings and the chip ends up in a disabled state which results in a lock up/high CPU usage. We need to re-apply any configuration that had previously been set and re-enable the chip. Signed-off-by: Evan Nimmo Reviewed-by: Chris Packham Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/algos/i2c-algo-pca.c | 35 +++++++++++++++++++++----------- include/linux/i2c-algo-pca.h | 15 ++++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index 3a9db4626cb60..1886588b9ea3e 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c @@ -50,8 +50,22 @@ static void pca_reset(struct i2c_algo_pca_data *adap) pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_IPRESET); pca_outw(adap, I2C_PCA_IND, 0xA5); pca_outw(adap, I2C_PCA_IND, 0x5A); + + /* + * After a reset we need to re-apply any configuration + * (calculated in pca_init) to get the bus in a working state. + */ + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_IMODE); + pca_outw(adap, I2C_PCA_IND, adap->bus_settings.mode); + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_ISCLL); + pca_outw(adap, I2C_PCA_IND, adap->bus_settings.tlow); + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_ISCLH); + pca_outw(adap, I2C_PCA_IND, adap->bus_settings.thi); + + pca_set_con(adap, I2C_PCA_CON_ENSIO); } else { adap->reset_chip(adap->data); + pca_set_con(adap, I2C_PCA_CON_ENSIO | adap->bus_settings.clock_freq); } } @@ -435,13 +449,14 @@ static int pca_init(struct i2c_adapter *adap) " Use the nominal frequency.\n", adap->name); } - pca_reset(pca_data); - clock = pca_clock(pca_data); printk(KERN_INFO "%s: Clock frequency is %dkHz\n", adap->name, freqs[clock]); - pca_set_con(pca_data, I2C_PCA_CON_ENSIO | clock); + /* Store settings as these will be needed when the PCA chip is reset */ + pca_data->bus_settings.clock_freq = clock; + + pca_reset(pca_data); } else { int clock; int mode; @@ -508,19 +523,15 @@ static int pca_init(struct i2c_adapter *adap) thi = tlow * min_thi / min_tlow; } + /* Store settings as these will be needed when the PCA chip is reset */ + pca_data->bus_settings.mode = mode; + pca_data->bus_settings.tlow = tlow; + pca_data->bus_settings.thi = thi; + pca_reset(pca_data); printk(KERN_INFO "%s: Clock frequency is %dHz\n", adap->name, clock * 100); - - pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_IMODE); - pca_outw(pca_data, I2C_PCA_IND, mode); - pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ISCLL); - pca_outw(pca_data, I2C_PCA_IND, tlow); - pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ISCLH); - pca_outw(pca_data, I2C_PCA_IND, thi); - - pca_set_con(pca_data, I2C_PCA_CON_ENSIO); } udelay(500); /* 500 us for oscillator to stabilise */ diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h index a3c3ecd59f08c..7a43afd273655 100644 --- a/include/linux/i2c-algo-pca.h +++ b/include/linux/i2c-algo-pca.h @@ -52,6 +52,20 @@ #define I2C_PCA_CON_SI 0x08 /* Serial Interrupt */ #define I2C_PCA_CON_CR 0x07 /* Clock Rate (MASK) */ +/** + * struct pca_i2c_bus_settings - The configured PCA i2c bus settings + * @mode: Configured i2c bus mode + * @tlow: Configured SCL LOW period + * @thi: Configured SCL HIGH period + * @clock_freq: The configured clock frequency + */ +struct pca_i2c_bus_settings { + int mode; + int tlow; + int thi; + int clock_freq; +}; + struct i2c_algo_pca_data { void *data; /* private low level data */ void (*write_byte) (void *data, int reg, int val); @@ -63,6 +77,7 @@ struct i2c_algo_pca_data { * For PCA9665, use the frequency you want here. */ unsigned int i2c_clock; unsigned int chip; + struct pca_i2c_bus_settings bus_settings; }; int i2c_pca_add_bus(struct i2c_adapter *); From patchwork Mon Sep 21 16:27:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC4FC43469 for ; Mon, 21 Sep 2020 16:33:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E44D3239D3 for ; Mon, 21 Sep 2020 16:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706024; bh=viQ5MaISis8I6/xy5sUsHEfiaQ4pyLWi8QwrFpDJ/R4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yV6TOmdH/yR8Ev6Ss70r76Pyj9bfVQxJHk3jAOtYq0jmzXZ9atwNVbJ4DvRurSBN8 DUaxo+XCGx6TU9MZV+rtGGwoRpIsagad/Sh2F5GF6bJogwMJvIEAL4km3tpcKMPZsq 5y1ripHJTuuNuvMj48/oWg9pdXMim+P5stJ7NutM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728652AbgIUQdn (ORCPT ); Mon, 21 Sep 2020 12:33:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:59998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbgIUQdj (ORCPT ); Mon, 21 Sep 2020 12:33:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E6CDB239A1; Mon, 21 Sep 2020 16:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706019; bh=viQ5MaISis8I6/xy5sUsHEfiaQ4pyLWi8QwrFpDJ/R4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XvdC1r5keWHmDL5hC5T6e2MUp1VxIL2q0fCTQqoeGhB+PwZ2d5/MYSbpCrTt/Wi7p Prm6klLkNoYhmC1TEy1nEr/7KvUbzqYSMusAQLMdf9KVbRgDVGGPSgBqdUkV95Oshx uv+PcjukSETO1agBWaTqXkIlvzWVnGltCW0xu3no= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.4 35/46] MIPS: SNI: Fix MIPS_L1_CACHE_SHIFT Date: Mon, 21 Sep 2020 18:27:51 +0200 Message-Id: <20200921162034.903672025@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Thomas Bogendoerfer [ Upstream commit 564c836fd945a94b5dd46597d6b7adb464092650 ] Commit 930beb5ac09a ("MIPS: introduce MIPS_L1_CACHE_SHIFT_") forgot to select the correct MIPS_L1_CACHE_SHIFT for SNI RM. This breaks non coherent DMA because of a wrong allocation alignment. Fixes: 930beb5ac09a ("MIPS: introduce MIPS_L1_CACHE_SHIFT_") Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 596cbda9cb3d3..9d8bc19edc48e 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -817,6 +817,7 @@ config SNI_RM select I8253 select I8259 select ISA + select MIPS_L1_CACHE_SHIFT_6 select SWAP_IO_SPACE if CPU_BIG_ENDIAN select SYS_HAS_CPU_R4X00 select SYS_HAS_CPU_R5000 From patchwork Mon Sep 21 16:27:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0D0AC43466 for ; Mon, 21 Sep 2020 17:05:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3DF62073A for ; Mon, 21 Sep 2020 17:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707953; bh=8aEWztFlDPl8H4sUn50FItF7gUpoIkj/vErTpfXsnpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qpfRf35c1jYHSP156tRIH+sb0O969AaqK/c/vfqTSQHX6ZZpNGVYO24/JLWtxZLGT bUJSbZEGlxddfbqzCokl39GnpEkIY/13u54h0UF0X9L1eReIs3ur0hPl25Zo9gMaFT mvyt10LTLhD1BQnBEb7rurvxPBqmz/npSza8r7Dk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbgIUQdX (ORCPT ); Mon, 21 Sep 2020 12:33:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728583AbgIUQdL (ORCPT ); Mon, 21 Sep 2020 12:33:11 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6701A2399A; Mon, 21 Sep 2020 16:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705990; bh=8aEWztFlDPl8H4sUn50FItF7gUpoIkj/vErTpfXsnpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mnlhlvkB1sIGfejS8KGkDSExup3fB5UsT8nfTXfzXM0TVaojHFEJxFJzJWg2B3VfK VOzyUyiWbLWOU9YgN/CUxiQgczm8sJTJO5j6nOkMQ4e29PGqRHSMWUvB7qG4+gdzdc lSbuqIdfGNBw9woQACBAUODES9OapGl2PMHh85jU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namhyung Kim , Jiri Olsa , Alexander Shishkin , Andi Kleen , Ian Rogers , Mark Rutland , Peter Zijlstra , Stephane Eranian , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.4 36/46] perf test: Free formats for perf pmu parse test Date: Mon, 21 Sep 2020 18:27:52 +0200 Message-Id: <20200921162034.943332447@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Namhyung Kim [ Upstream commit d26383dcb2b4b8629fde05270b4e3633be9e3d4b ] The following leaks were detected by ASAN: Indirect leak of 360 byte(s) in 9 object(s) allocated from: #0 0x7fecc305180e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10780e) #1 0x560578f6dce5 in perf_pmu__new_format util/pmu.c:1333 #2 0x560578f752fc in perf_pmu_parse util/pmu.y:59 #3 0x560578f6a8b7 in perf_pmu__format_parse util/pmu.c:73 #4 0x560578e07045 in test__pmu tests/pmu.c:155 #5 0x560578de109b in run_test tests/builtin-test.c:410 #6 0x560578de109b in test_and_print tests/builtin-test.c:440 #7 0x560578de401a in __cmd_test tests/builtin-test.c:661 #8 0x560578de401a in cmd_test tests/builtin-test.c:807 #9 0x560578e49354 in run_builtin /home/namhyung/project/linux/tools/perf/perf.c:312 #10 0x560578ce71a8 in handle_internal_command /home/namhyung/project/linux/tools/perf/perf.c:364 #11 0x560578ce71a8 in run_argv /home/namhyung/project/linux/tools/perf/perf.c:408 #12 0x560578ce71a8 in main /home/namhyung/project/linux/tools/perf/perf.c:538 #13 0x7fecc2b7acc9 in __libc_start_main ../csu/libc-start.c:308 Fixes: cff7f956ec4a1 ("perf tests: Move pmu tests into separate object") Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200915031819.386559-12-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/pmu.c | 1 + tools/perf/util/pmu.c | 11 +++++++++++ tools/perf/util/pmu.h | 1 + 3 files changed, 13 insertions(+) diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c index b776831ceeeac..4ca6d4dc86612 100644 --- a/tools/perf/tests/pmu.c +++ b/tools/perf/tests/pmu.c @@ -169,6 +169,7 @@ int test__pmu(void) ret = 0; } while (0); + perf_pmu__del_formats(&formats); test_format_dir_put(format); return ret; } diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 5245fbd091067..8d99b6d9c36ae 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -921,6 +921,17 @@ void perf_pmu__set_format(unsigned long *bits, long from, long to) set_bit(b, bits); } +void perf_pmu__del_formats(struct list_head *formats) +{ + struct perf_pmu_format *fmt, *tmp; + + list_for_each_entry_safe(fmt, tmp, formats, list) { + list_del(&fmt->list); + free(fmt->name); + free(fmt); + } +} + static int sub_non_neg(int a, int b) { if (b > a) diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 5d7e84466bee5..6789b1efc7d6e 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -66,6 +66,7 @@ int perf_pmu__new_format(struct list_head *list, char *name, int config, unsigned long *bits); void perf_pmu__set_format(unsigned long *bits, long from, long to); int perf_pmu__format_parse(char *dir, struct list_head *head); +void perf_pmu__del_formats(struct list_head *formats); struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu); From patchwork Mon Sep 21 16:27:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0CBCC43469 for ; Mon, 21 Sep 2020 17:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C0E52073A for ; Mon, 21 Sep 2020 17:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707955; bh=/5yopNgNTzTJ/Y/a1Sg7nEBbV/9aQf7h0GGC4tzQgkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Oi0Ht6uJscHDCuMD3MHFCafZjhgrsTtpxJZT06BSK8XRq9orgSR0pOtQZuqhpEhgJ X5CgeAAwAXGZF3wCvzXTO2Gtd/cKJkXua/uLpGQ1sL7iPe2V/cdBCWHqLJIOcZ27Sm 0+GrZkVoVBvdRnKY2zdR97p6Fv8UIyvqYJgrfFLc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbgIURFy (ORCPT ); Mon, 21 Sep 2020 13:05:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:59390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728607AbgIUQdT (ORCPT ); Mon, 21 Sep 2020 12:33:19 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1AFFE23998; Mon, 21 Sep 2020 16:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705998; bh=/5yopNgNTzTJ/Y/a1Sg7nEBbV/9aQf7h0GGC4tzQgkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nQVGBDA5gmDtrRpFFEBZMkamhGCcK1YWg2SpFJX+tHCsjYpxgIkgXYGPDOAsj7EdE NY6kQCF4jbP038M8yvEA3t5tGgpktflYsbyyJ3b0+MCRxxW0ANbDd8ZaiSvpEjtSl6 RmvOZxJ3Hrt7Ie4OQohA4d0NvRcRyx23lY0+J7hw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Tetsuo Handa , George Kennedy , Sasha Levin Subject: [PATCH 4.4 37/46] fbcon: Fix user font detection test at fbcon_resize(). Date: Mon, 21 Sep 2020 18:27:53 +0200 Message-Id: <20200921162034.993799030@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tetsuo Handa [ Upstream commit ec0972adecb391a8d8650832263a4790f3bfb4df ] syzbot is reporting OOB read at fbcon_resize() [1], for commit 39b3cffb8cf31117 ("fbcon: prevent user font height or width change from causing potential out-of-bounds access") is by error using registered_fb[con2fb_map[vc->vc_num]]->fbcon_par->p->userfont (which was set to non-zero) instead of fb_display[vc->vc_num].userfont (which remains zero for that display). We could remove tricky userfont flag [2], for we can determine it by comparing address of the font data and addresses of built-in font data. But since that commit is failing to fix the original OOB read [3], this patch keeps the change minimal in case we decide to revert altogether. [1] https://syzkaller.appspot.com/bug?id=ebcbbb6576958a496500fee9cf7aa83ea00b5920 [2] https://syzkaller.appspot.com/text?tag=Patch&x=14030853900000 [3] https://syzkaller.appspot.com/bug?id=6fba8c186d97cf1011ab17660e633b1cc4e080c9 Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 39b3cffb8cf31117 ("fbcon: prevent user font height or width change from causing potential out-of-bounds access") Cc: George Kennedy Link: https://lore.kernel.org/r/f6e3e611-8704-1263-d163-f52c906a4f06@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/video/console/fbcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index c62db94cf945e..e57fa26bcff19 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -1943,7 +1943,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, struct fb_var_screeninfo var = info->var; int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh; - if (ops->p && ops->p->userfont && FNTSIZE(vc->vc_font.data)) { + if (p->userfont && FNTSIZE(vc->vc_font.data)) { int size; int pitch = PITCH(vc->vc_font.width); From patchwork Mon Sep 21 16:27:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39EBDC43468 for ; Mon, 21 Sep 2020 17:06:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 012FB2084C for ; Mon, 21 Sep 2020 17:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707962; bh=d3XFlJeZ5FcVRMjyET295KfplhHWKUPA6e5DSv4GAcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NcmHF/Te2SVe0uuRrIyLyn2H5OEVbXBogVU1wX3Eh/OjEy/Nk8jUJocmxvmPrQi0n ExlHUfCHvIz91/9hMsKPBn0N9QDwvj4E6azulKDVfZ4WXIx45DgcBQgDI3xxTg1Q7C 1bmZWZjo1eU3X5XU+9xH5OA29GBc6oYn6x+aqXEE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728662AbgIURFy (ORCPT ); Mon, 21 Sep 2020 13:05:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:59458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728599AbgIUQdV (ORCPT ); Mon, 21 Sep 2020 12:33:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9108C2399C; Mon, 21 Sep 2020 16:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706001; bh=d3XFlJeZ5FcVRMjyET295KfplhHWKUPA6e5DSv4GAcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k8Ex2r1tXdmvxlywiOYVkp+7d+0ZjBMgNWrEFMwrhQe6TWd3CRE8c1DIIPZlOOQmI VgNSa1/nPyrtoOfeU/cOysIgztJBKHvlsSpTc/8bzJKfQAM1cXAuWNGTU/Z+95lc8T BuL7c8JJXsfb8uPcGl1a27V45QaAYlqBKxd9NFmw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.4 38/46] MIPS: SNI: Fix spurious interrupts Date: Mon, 21 Sep 2020 18:27:54 +0200 Message-Id: <20200921162035.034931409@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Thomas Bogendoerfer [ Upstream commit b959b97860d0fee8c8f6a3e641d3c2ad76eab6be ] On A20R machines the interrupt pending bits in cause register need to be updated by requesting the chipset to do it. This needs to be done to find the interrupt cause and after interrupt service. In commit 0b888c7f3a03 ("MIPS: SNI: Convert to new irq_chip functions") the function to do after service update got lost, which caused spurious interrupts. Fixes: 0b888c7f3a03 ("MIPS: SNI: Convert to new irq_chip functions") Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/sni/a20r.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c index f9407e1704762..c6af7047eb0d2 100644 --- a/arch/mips/sni/a20r.c +++ b/arch/mips/sni/a20r.c @@ -143,7 +143,10 @@ static struct platform_device sc26xx_pdev = { }, }; -static u32 a20r_ack_hwint(void) +/* + * Trigger chipset to update CPU's CAUSE IP field + */ +static u32 a20r_update_cause_ip(void) { u32 status = read_c0_status(); @@ -205,12 +208,14 @@ static void a20r_hwint(void) int irq; clear_c0_status(IE_IRQ0); - status = a20r_ack_hwint(); + status = a20r_update_cause_ip(); cause = read_c0_cause(); irq = ffs(((cause & status) >> 8) & 0xf8); if (likely(irq > 0)) do_IRQ(SNI_A20R_IRQ_BASE + irq - 1); + + a20r_update_cause_ip(); set_c0_status(IE_IRQ0); } From patchwork Mon Sep 21 16:27:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92C9BC43468 for ; Mon, 21 Sep 2020 16:33:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58FF823976 for ; Mon, 21 Sep 2020 16:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706022; bh=Ss0pB55/au/kXy08DEQd/XTsblmOidKQs1FngtrmUpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2LNECvVTP028m7vUJSM0rhGLndTGwbMPv/BevuZQlv2K8y0j+wtGpnDwYo+isR2B5 BCfpgMjrb83c2IFC+IDKfFdXPLNGAgvkllTI34Z0slq/uGIZjCtiUHq38n4T3x0WFP NgiPuEgybkc8OukP/+67H76D9G7j+gOhzaKwrvzg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728287AbgIUQdh (ORCPT ); Mon, 21 Sep 2020 12:33:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:59566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728615AbgIUQdY (ORCPT ); Mon, 21 Sep 2020 12:33:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38AD12396F; Mon, 21 Sep 2020 16:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706003; bh=Ss0pB55/au/kXy08DEQd/XTsblmOidKQs1FngtrmUpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+CVaQLUS1yBU62t4Y4WSSSpjpKDnWNN0W55KIKVH+hnwUksAhD5seOmmGqPH5dEI 4rAum9A23sXH8rOo+Z0tYq2Rx2DJhuJZChpefiia8GiLiaqq0IJs3NARdogQY7eyAD GcM6jtBu90bB/IT0Ry8vJmJ97fiP3MS7swfzs8CY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Penghao Subject: [PATCH 4.4 39/46] USB: quirks: Add USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for BYD zhaoxin notebook Date: Mon, 21 Sep 2020 18:27:55 +0200 Message-Id: <20200921162035.073583276@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Penghao commit bcea6dafeeef7d1a6a8320a249aabf981d63b881 upstream. Add a USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for the BYD zhaoxin notebook. This notebook come with usb touchpad. And we would like to disable touchpad wakeup on this notebook by default. Signed-off-by: Penghao Cc: stable Link: https://lore.kernel.org/r/20200907023026.28189-1-penghao@uniontech.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -236,6 +236,10 @@ static const struct usb_device_id usb_qu /* Generic RTL8153 based ethernet adapters */ { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM }, + /* SONiX USB DEVICE Touchpad */ + { USB_DEVICE(0x0c45, 0x7056), .driver_info = + USB_QUIRK_IGNORE_REMOTE_WAKEUP }, + /* Action Semiconductor flash disk */ { USB_DEVICE(0x10d6, 0x2200), .driver_info = USB_QUIRK_STRING_FETCH_255 }, From patchwork Mon Sep 21 16:27:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0041FC43469 for ; Mon, 21 Sep 2020 16:33:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8385239D1 for ; Mon, 21 Sep 2020 16:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706016; bh=gaKloBMiaI+64bFYvsMOIWjVJrHJTuVAg0Lb0PKDyQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rpaH7Z+FqFqaVaKCVA/tHZ6iO6w9Hlc/sUhiUMolWwWZILA3IlkKpVymVCtnsk5Mb buNk3X8H0zfmGZfAr8y/hbDB5cZI/OSPpK4KW6+o19AC3JrY3t/KlTrUloJ8sermXp 0VzpVAbMNZCV1/K8sX4wA2wXXjty1md2/L3MBtbw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728571AbgIUQdb (ORCPT ); Mon, 21 Sep 2020 12:33:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:59614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbgIUQd1 (ORCPT ); Mon, 21 Sep 2020 12:33:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D9923239A1; Mon, 21 Sep 2020 16:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706006; bh=gaKloBMiaI+64bFYvsMOIWjVJrHJTuVAg0Lb0PKDyQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FxayrAAOGRUCQbW3/sEeVkkUyXY0uJqcRbJQYpi78I38H6xTc4XHRIvEFUaVYaPpq 0E8a7oQ1snjWNJEp/Abl1wF2h58ZvQHjC4bYy15s5I0gBd7FTLbO493vSB24BoUjwn qplrPgCGr09ydZoiHa10MtVTdq5y0/8bhFxZUoNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum Subject: [PATCH 4.4 40/46] USB: UAS: fix disconnect by unplugging a hub Date: Mon, 21 Sep 2020 18:27:56 +0200 Message-Id: <20200921162035.114654117@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Oliver Neukum commit 325b008723b2dd31de020e85ab9d2e9aa4637d35 upstream. The SCSI layer can go into an ugly loop if you ignore that a device is gone. You need to report an error in the command rather than in the return value of the queue method. We need to specifically check for ENODEV. The issue goes back to the introduction of the driver. Fixes: 115bb1ffa54c3 ("USB: Add UAS driver") Signed-off-by: Oliver Neukum Cc: stable Link: https://lore.kernel.org/r/20200916094026.30085-2-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/uas.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -646,8 +646,7 @@ static int uas_queuecommand_lck(struct s if (devinfo->resetting) { cmnd->result = DID_ERROR << 16; cmnd->scsi_done(cmnd); - spin_unlock_irqrestore(&devinfo->lock, flags); - return 0; + goto zombie; } /* Find a free uas-tag */ @@ -682,6 +681,16 @@ static int uas_queuecommand_lck(struct s cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB); err = uas_submit_urbs(cmnd, devinfo, GFP_ATOMIC); + /* + * in case of fatal errors the SCSI layer is peculiar + * a command that has finished is a success for the purpose + * of queueing, no matter how fatal the error + */ + if (err == -ENODEV) { + cmnd->result = DID_ERROR << 16; + cmnd->scsi_done(cmnd); + goto zombie; + } if (err) { /* If we did nothing, give up now */ if (cmdinfo->state & SUBMIT_STATUS_URB) { @@ -692,6 +701,7 @@ static int uas_queuecommand_lck(struct s } devinfo->cmnd[idx] = cmnd; +zombie: spin_unlock_irqrestore(&devinfo->lock, flags); return 0; } From patchwork Mon Sep 21 16:27:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C528DC43465 for ; Mon, 21 Sep 2020 16:33:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81A7723976 for ; Mon, 21 Sep 2020 16:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706023; bh=CD6PsofLoeKEjoaySeMOD1zS5O/GIWyJ3Er++gagnKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RQuwvO+/9CQCFmPo1QEP4uho4OQ2LUM1XyFIox5k0AEIaoXsIZoIhkBsihmT+Vkdd zMoWkCW/G3nqtDBYlR9eC2s/MgCVXHaA82WDsorgPJw9L/syy+HYKv66lUshhDb+od XDrFM/n0E3EfMRm/xHeF5gntxyK3KFB+aUs2YQBo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728647AbgIUQdm (ORCPT ); Mon, 21 Sep 2020 12:33:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:59700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728637AbgIUQd3 (ORCPT ); Mon, 21 Sep 2020 12:33:29 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79A6B239D0; Mon, 21 Sep 2020 16:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706009; bh=CD6PsofLoeKEjoaySeMOD1zS5O/GIWyJ3Er++gagnKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+QcPtlRhXBpW5AyLi+Rtj0/Z9e14zsJgJ86LXZsW5TMNYAq5VtDacaL801M4FSom Xxy+ZY4nK2RC8XEGTewU/ao4HsiA8ZiP6YjfYq4UPYRGEoeA5FtCvZ3HiY/n19+Baz 9/Joh5WkPkTgNnjDQcIskQGeMqnyhyS/Z0u/+yro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com Subject: [PATCH 4.4 41/46] usblp: fix race between disconnect() and read() Date: Mon, 21 Sep 2020 18:27:57 +0200 Message-Id: <20200921162035.162662168@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Oliver Neukum commit 9cdabcb3ef8c24ca3a456e4db7b012befb688e73 upstream. read() needs to check whether the device has been disconnected before it tries to talk to the device. Signed-off-by: Oliver Neukum Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20200917103427.15740-1-oneukum@suse.com Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/usblp.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -840,6 +840,11 @@ static ssize_t usblp_read(struct file *f if (rv < 0) return rv; + if (!usblp->present) { + count = -ENODEV; + goto done; + } + if ((avail = usblp->rstatus) < 0) { printk(KERN_ERR "usblp%d: error %d reading from printer\n", usblp->minor, (int)avail); From patchwork Mon Sep 21 16:27:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 020F5C43466 for ; Mon, 21 Sep 2020 17:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B73102073A for ; Mon, 21 Sep 2020 17:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707946; bh=rB+EPXfisiVIL6BaUv2t5N1wer3+ThBrZURnkwHPK9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Sx6r+fcOUjFYCVPKb5vn6W5jQe03TcUh8HqUNviig8PHht7jisF07A5+Spu2OjOB8 KX/9ja1zjkVwL9c+n9YgMfsaTCbbp3mBq3kiZRZ1qp86OBX1jeK1Vt8tMio4/SWd6c Piz6UXVMmb1NJpv8vbZPIN1DN4ivXowyX0zIlEQg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729369AbgIURFq (ORCPT ); Mon, 21 Sep 2020 13:05:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:59782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbgIUQdc (ORCPT ); Mon, 21 Sep 2020 12:33:32 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02C302399C; Mon, 21 Sep 2020 16:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706011; bh=rB+EPXfisiVIL6BaUv2t5N1wer3+ThBrZURnkwHPK9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UCL4FDNuLAEgnSlLnrJiJOrYIoGz5bJEIY7/doFXBMoCOV42ERmVhzp1ifHYEJJii QjtAf4js+wk1BvsxcD/MAPx6IOYCBwfHoXIIwLTVLNS7JmRb5qZ9FQ3ZU1XFG+koFk tK6NkEtrQvSrnvyWUz1PkkdWWfjowddkGzJm2F+c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Dmitry Torokhov Subject: [PATCH 4.4 42/46] Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists Date: Mon, 21 Sep 2020 18:27:58 +0200 Message-Id: <20200921162035.216739113@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hans de Goede commit c4440b8a457779adeec42c5e181cb4016f19ce0f upstream. The keyboard drops keypresses early during boot unless both the nomux and reset quirks are set. Add DMI table entries for this. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1806085 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20200907095656.13155-1-hdegoede@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/serio/i8042-x86ia64io.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -552,6 +552,14 @@ static const struct dmi_system_id __init DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"), }, }, + { + /* Entroware Proteus */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Entroware"), + DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"), + DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"), + }, + }, { } }; @@ -752,6 +760,14 @@ static const struct dmi_system_id __init DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"), }, }, + { + /* Entroware Proteus */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Entroware"), + DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"), + DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"), + }, + }, { } }; From patchwork Mon Sep 21 16:27:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CC86C43468 for ; Mon, 21 Sep 2020 17:05:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A164206A2 for ; Mon, 21 Sep 2020 17:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707946; bh=WDhNPPEYNtmQ25KI64ic4H434rTkrIJzlLjK2327UWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ItblIdoJUuI4AmwRfLOOrc4SxOZ5uPJ2zBgKzZGuPIv3iD8jC7l0tBKuK+UNN1C3i 8r3LlYCvDZuuwPZZLaU+ipMJuMl0IMuOQgjnZTT1iiyZZTNrOOyejFzud8oJ/e/ehP lOlBPSz8O5loIdlRLE5rQ9bz+FIVQPHHOB2iuwWo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728657AbgIURFp (ORCPT ); Mon, 21 Sep 2020 13:05:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbgIUQdf (ORCPT ); Mon, 21 Sep 2020 12:33:35 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE0C12396F; Mon, 21 Sep 2020 16:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706014; bh=WDhNPPEYNtmQ25KI64ic4H434rTkrIJzlLjK2327UWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cr/sn+6WZrYD5T63nXxVvAmGLlgAz9ggHPynb0Fcb9lySnwt+aYFcCT2fTecOoYoP jfGz7cZR2oc1GMfe0SG2D65chx3ph8ogBaNyqvZdIM/QAnYolHPWYL0IwND8Wp1dRw zQy2UU+TGSjd6Tu50WA0zM3sv+/uI2LTsNEce21c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tobias Diedrich Subject: [PATCH 4.4 43/46] serial: 8250_pci: Add Realtek 816a and 816b Date: Mon, 21 Sep 2020 18:27:59 +0200 Message-Id: <20200921162035.255862443@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tobias Diedrich commit 3c5a87be170aba8ac40982182f812dcff6ed1ad1 upstream. These serial ports are exposed by the OOB-management-engine on RealManage-enabled network cards (e.g. AMD DASH enabled systems using Realtek cards). Because these have 3 BARs, they fail the "num_iomem <= 1" check in serial_pci_guess_board. I've manually checked the two IOMEM regions and BAR 2 doesn't seem to respond to reads, but BAR 4 seems to be an MMIO version of the IO ports (untested). With this change, the ports are detected: 0000:02:00.1: ttyS0 at I/O 0x2200 (irq = 82, base_baud = 115200) is a 16550A 0000:02:00.2: ttyS1 at I/O 0x2100 (irq = 55, base_baud = 115200) is a 16550A lspci output: 02:00.1 0700: 10ec:816a (rev 0e) (prog-if 02 [16550]) Subsystem: 17aa:5082 Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort+ SERR- Cc: stable Link: https://lore.kernel.org/r/20200914173628.GA22508@yamamaya.is-a-geek.org Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_pci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -5904,6 +5904,17 @@ static struct pci_device_id serial_pci_t 0, 0, pbn_exar_XR17V358 }, + /* + * Realtek RealManage + */ + { PCI_VENDOR_ID_REALTEK, 0x816a, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, pbn_b0_1_115200 }, + + { PCI_VENDOR_ID_REALTEK, 0x816b, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, pbn_b0_1_115200 }, + /* Fintek PCI serial cards */ { PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 }, { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 }, From patchwork Mon Sep 21 16:28:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA3D6C43465 for ; Mon, 21 Sep 2020 17:05:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A99EA2073A for ; Mon, 21 Sep 2020 17:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707941; bh=t5qeN+stjGPNG6sn8aIddhIRBpgtz8iDOmvyk88XO1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kG9ubBtxWVdtNNZBQ7llalpzyhVvQ8weCK1VuMqzdzWINOHquaSRc0fA0a89dG4Ps K7jOBJtcDsgekd1LPK0dTis28rWES89JAcA4Tp4LNv6ebe6QSiPjwO247IoYwlaNhG ZB1Z9WVw6UbwsVKUBOuSV31wCGS+nNZtPbLCXRig= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgIUQdm (ORCPT ); Mon, 21 Sep 2020 12:33:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:59920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728113AbgIUQdh (ORCPT ); Mon, 21 Sep 2020 12:33:37 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 635E823976; Mon, 21 Sep 2020 16:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706016; bh=t5qeN+stjGPNG6sn8aIddhIRBpgtz8iDOmvyk88XO1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kXz//4wJLcrE68vEhFkCzJxF9P6MBJhDpk0GJlNJ545z1q0Sp6pKEGAh0A4ps1inM 276gbhPYBTTYoKlVOjtBE1UoS5Ik3TdKuNNjjCT4R+doOKVM6u9LXuqec5Xtw4ouL4 9umQRTfPaUj29051HWvk05y5von/ldtst7L3IjKw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Quentin Perret Subject: [PATCH 4.4 44/46] ehci-hcd: Move include to keep CRC stable Date: Mon, 21 Sep 2020 18:28:00 +0200 Message-Id: <20200921162035.296458681@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Quentin Perret commit 29231826f3bd65500118c473fccf31c0cf14dbc0 upstream. The CRC calculation done by genksyms is triggered when the parser hits EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the types of the function parameters, and uses that as the input for the CRC calculation. In the case of forward-declared structs, the type expands to 'UNKNOWN'. Following this, it appears that the result of the expansion of each type is cached somewhere, and seems to be re-used when/if the same type is seen again for another exported symbol in the same C file. Unfortunately, this can cause CRC 'stability' issues when a struct definition becomes visible in the middle of a C file. For example, let's assume code with the following pattern: struct foo; int bar(struct foo *arg) { /* Do work ... */ } EXPORT_SYMBOL_GPL(bar); /* This contains struct foo's definition */ #include "foo.h" int baz(struct foo *arg) { /* Do more work ... */ } EXPORT_SYMBOL_GPL(baz); Here, baz's CRC will be computed using the expansion of struct foo that was cached after bar's CRC calculation ('UNKOWN' here). But if EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded late, during baz's CRC calculation, which now has visibility over the full struct definition, hence resulting in a different CRC for baz. The proper fix for this certainly is in genksyms, but that will take me some time to get right. In the meantime, we have seen one occurrence of this in the ehci-hcd code which hits this problem because of the way it includes C files halfway through the code together with an unlucky mix of symbol trimming. In order to workaround this, move the include done in ehci-hub.c early in ehci-hcd.c, hence making sure the struct definitions are visible to the entire file. This improves CRC stability of the ehci-hcd exports even when symbol trimming is enabled. Acked-by: Alan Stern Cc: stable Signed-off-by: Quentin Perret Link: https://lore.kernel.org/r/20200916171825.3228122-1-qperret@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-hcd.c | 1 + drivers/usb/host/ehci-hub.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -27,7 +27,6 @@ */ /*-------------------------------------------------------------------------*/ -#include #define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E) From patchwork Mon Sep 21 16:28:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22B74C43469 for ; Mon, 21 Sep 2020 16:33:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E252A239A1 for ; Mon, 21 Sep 2020 16:33:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705995; bh=jFxCiZ44NXmk11inWlUxj2I0OFZ6rhbVv5VMfpK1ONo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QyADuykUlAdPbuRstaSDUk81I/Dqp6kPlTqLHDmuTA+q4833vpd0ipXz2+Iej1uUJ Kf4PvK1By3lmsHif1t4bFYqJ5H0xgvniP0yGSwIw2Dw9L3/paGvl/KqsBrXxrhDpOT oav5jVraVtA8HNETT95jv0bKbJvOK/U0FK0+1wnA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728592AbgIUQdO (ORCPT ); Mon, 21 Sep 2020 12:33:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:59242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbgIUQdO (ORCPT ); Mon, 21 Sep 2020 12:33:14 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BFBEE239D1; Mon, 21 Sep 2020 16:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705993; bh=jFxCiZ44NXmk11inWlUxj2I0OFZ6rhbVv5VMfpK1ONo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d7ELhOYrEAwAV44xgLwivB1yYWbm5kh8lADd6kpQjwgYG5L+a7KpDASIvKFvKX+7l ysAHTI2uinRRbSscaf59lE5YExMrBhQ2IMVECQj3nXjfbF387COgJKLekEnboKRr2c A7wvIXqIL19JtYFG5i/2q6xypAgp8SkrYLJsN+Zw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kardashevskiy , Michael Ellerman Subject: [PATCH 4.4 45/46] powerpc/dma: Fix dma_map_ops::get_required_mask Date: Mon, 21 Sep 2020 18:28:01 +0200 Message-Id: <20200921162035.345306742@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexey Kardashevskiy commit 437ef802e0adc9f162a95213a3488e8646e5fc03 upstream. There are 2 problems with it: 1. "<" vs expected "<<" 2. the shift number is an IOMMU page number mask, not an address mask as the IOMMU page shift is missing. This did not hit us before f1565c24b596 ("powerpc: use the generic dma_ops_bypass mode") because we had additional code to handle bypass mask so this chunk (almost?) never executed.However there were reports that aacraid does not work with "iommu=nobypass". After f1565c24b596, aacraid (and probably others which call dma_get_required_mask() before setting the mask) was unable to enable 64bit DMA and fall back to using IOMMU which was known not to work, one of the problems is double free of an IOMMU page. This fixes DMA for aacraid, both with and without "iommu=nobypass" in the kernel command line. Verified with "stress-ng -d 4". Fixes: 6a5c7be5e484 ("powerpc: Override dma_get_required_mask by platform hook and ops") Cc: stable@vger.kernel.org # v3.2+ Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200908015106.79661-1-aik@ozlabs.ru Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/dma-iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c @@ -99,7 +99,8 @@ static u64 dma_iommu_get_required_mask(s if (!tbl) return 0; - mask = 1ULL < (fls_long(tbl->it_offset + tbl->it_size) - 1); + mask = 1ULL << (fls_long(tbl->it_offset + tbl->it_size) + + tbl->it_page_shift - 1); mask += mask - 1; return mask; From patchwork Mon Sep 21 16:28:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23E84C43468 for ; Mon, 21 Sep 2020 16:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE7E6239D0 for ; Mon, 21 Sep 2020 16:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706001; bh=kcpOePPk9Oa0xA+RHgt1wPgGHNQUOeL2zZ/g8BSu8Fo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CpWwzyCbAXV7ATJyMD7CfqW02eIJ1ERFGAB/bfSlc+lVgpCx3/KU+DMLnzo36PGQw LV7CAlYQC9l7giWyLO8vVHgSZuNs/8N6Jiz2mIF6UT0i+HwN48Fl3Rk0LkSE1En5h4 SdygM0KLx4wZR1EOTcD+8E4Rc+OthlUK1kcepN6E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728601AbgIUQdR (ORCPT ); Mon, 21 Sep 2020 12:33:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728599AbgIUQdQ (ORCPT ); Mon, 21 Sep 2020 12:33:16 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7802B2396F; Mon, 21 Sep 2020 16:33:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705996; bh=kcpOePPk9Oa0xA+RHgt1wPgGHNQUOeL2zZ/g8BSu8Fo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=igcBcA6KAeOtWunDaMFF0CiXCWYbBW7gXe9rY/ooMiGynOy7/gWgCBUDjWYxeR8zr bOCjuVbDQsf92x790HagIcEgZDtleCHjouAEPEtBD4c2SS0Sy4R9bKGlxJtkf15aNk tXIOvRXvIIHaoBWGq9BL8BSs/0awrHXBif/7O7ng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adam Borowski , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , linux-usb@vger.kernel.org, Ingo Molnar , Andy Shevchenko Subject: [PATCH 4.4 46/46] x86/defconfig: Enable CONFIG_USB_XHCI_HCD=y Date: Mon, 21 Sep 2020 18:28:02 +0200 Message-Id: <20200921162035.393246797@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Adam Borowski commit 72a9c673636b779e370983fea08e40f97039b981 upstream. A spanking new machine I just got has all but one USB ports wired as 3.0. Booting defconfig resulted in no keyboard or mouse, which was pretty uncool. Let's enable that -- USB3 is ubiquitous rather than an oddity. As 'y' not 'm' -- recovering from initrd problems needs a keyboard. Also add it to the 32-bit defconfig. Signed-off-by: Adam Borowski Cc: Greg Kroah-Hartman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-usb@vger.kernel.org Link: http://lkml.kernel.org/r/20181009062803.4332-1-kilobyte@angband.pl Signed-off-by: Ingo Molnar Cc: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- arch/x86/configs/i386_defconfig | 1 + arch/x86/configs/x86_64_defconfig | 1 + 2 files changed, 2 insertions(+) --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig @@ -247,6 +247,7 @@ CONFIG_USB_HIDDEV=y CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_MON=y +CONFIG_USB_XHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig @@ -241,6 +241,7 @@ CONFIG_USB_HIDDEV=y CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_MON=y +CONFIG_USB_XHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y