From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5E9CC433F5 for ; Mon, 14 Feb 2022 09:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243381AbiBNJbF (ORCPT ); Mon, 14 Feb 2022 04:31:05 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243441AbiBNJat (ORCPT ); Mon, 14 Feb 2022 04:30:49 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A47F260AA6; Mon, 14 Feb 2022 01:29:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 49BD4B80DC6; Mon, 14 Feb 2022 09:29:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49C6BC340E9; Mon, 14 Feb 2022 09:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644830990; bh=0lxXy/jVMS9pYNsQkVICaXhZEM0lAPgI5MzlHy/N10E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qweULu1IB9E+XlUtY8SOmAwrb6NhN7Je1AUhx1VcR+6yWHDqQS+D+B7h191PXiRvi 2EFu5CMXVNQJkh7e0A/0wMLAF2siGNuqY6DakDNKZZ+vQJMrtHChurLVov7Vv8kS0i dm7Wl37J1kNW1L6sGNcHdmhRWJNRwiqThyg8Vrr4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaoke Wang , Paul Moore , Mimi Zohar Subject: [PATCH 4.14 01/44] integrity: check the return value of audit_log_start() Date: Mon, 14 Feb 2022 10:25:24 +0100 Message-Id: <20220214092447.948444203@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xiaoke Wang commit 83230351c523b04ff8a029a4bdf97d881ecb96fc upstream. audit_log_start() returns audit_buffer pointer on success or NULL on error, so it is better to check the return value of it. Fixes: 3323eec921ef ("integrity: IMA as an integrity service provider") Signed-off-by: Xiaoke Wang Cc: Reviewed-by: Paul Moore Signed-off-by: Mimi Zohar Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- security/integrity/integrity_audit.c | 2 ++ 1 file changed, 2 insertions(+) --- a/security/integrity/integrity_audit.c +++ b/security/integrity/integrity_audit.c @@ -39,6 +39,8 @@ void integrity_audit_msg(int audit_msgno return; =20 ab =3D audit_log_start(current->audit_context, GFP_KERNEL, audit_msgno); + if (!ab) + return; audit_log_format(ab, "pid=3D%d uid=3D%u auid=3D%u ses=3D%u", task_pid_nr(current), from_kuid(&init_user_ns, current_cred()->uid), From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A140C433EF for ; Mon, 14 Feb 2022 09:32:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243465AbiBNJcH (ORCPT ); Mon, 14 Feb 2022 04:32:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243344AbiBNJbj (ORCPT ); Mon, 14 Feb 2022 04:31:39 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC0FAE59; Mon, 14 Feb 2022 01:30:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 26F9360F87; Mon, 14 Feb 2022 09:30:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05122C340E9; Mon, 14 Feb 2022 09:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831024; bh=uCy9zei6+glFa+/0WU4PdY4k4NNYd49dDfkkI9f0W6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eqtur7icnjvCYi/KQ/WzJnZF//Z1F1Afd6xdk9KG3GtyDt2e7yZn2P5SGvWMZ9Ln0 2tqVRI8UXHv9Wbs6d1hz0wGbBb++12hth3P4k68ywS+EzM1VtBuKB82E4ZYTosIgtU O/c602xkP4K+b2Vn+ZZZ2mN+wXo4vytBZj7203Po= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Berger , Christian Brauner , Mimi Zohar Subject: [PATCH 4.14 02/44] ima: Remove ima_policy file before directory Date: Mon, 14 Feb 2022 10:25:25 +0100 Message-Id: <20220214092447.980494510@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stefan Berger commit f7333b9572d0559e00352a926c92f29f061b4569 upstream. The removal of ima_dir currently fails since ima_policy still exists, so remove the ima_policy file before removing the directory. Fixes: 4af4662fa4a9 ("integrity: IMA policy") Signed-off-by: Stefan Berger Cc: Acked-by: Christian Brauner Signed-off-by: Mimi Zohar Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- security/integrity/ima/ima_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -486,11 +486,11 @@ int __init ima_fs_init(void) =20 return 0; out: + securityfs_remove(ima_policy); securityfs_remove(violations); securityfs_remove(runtime_measurements_count); securityfs_remove(ascii_runtime_measurements); securityfs_remove(binary_runtime_measurements); securityfs_remove(ima_dir); - securityfs_remove(ima_policy); return -1; } From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 745E1C433F5 for ; Mon, 14 Feb 2022 09:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243572AbiBNJcs (ORCPT ); Mon, 14 Feb 2022 04:32:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243683AbiBNJcK (ORCPT ); Mon, 14 Feb 2022 04:32:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38A081ADB2; Mon, 14 Feb 2022 01:31:03 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4AAEB80DC6; Mon, 14 Feb 2022 09:31:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 027FFC340E9; Mon, 14 Feb 2022 09:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831060; bh=VUVBaAGZBaqswhE6D4PLK24XkRlHN39JFF+flQEuJME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zz2CSd74aromH5TGQJ8iHsQS+ajt4SZWkljSXB1x5aU8kcgPzLDOMz3oFhp9N1oek WgJ9Q7BHq4TGSLlU5f0iMA/6KG+CNP92Bwr3+j15PatVO6p/bkuHcQVOkRJGC6HjOx If9aixIklEYbPasXXj6utabuaun5Jfnq1acH3an0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guo Zihua , Roberto Sassu , Mimi Zohar Subject: [PATCH 4.14 03/44] ima: Allow template selection with ima_template[_fmt]= after ima_hash= Date: Mon, 14 Feb 2022 10:25:26 +0100 Message-Id: <20220214092448.021896858@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Roberto Sassu commit bb8e52e4906f148c2faf6656b5106cf7233e9301 upstream. Commit c2426d2ad5027 ("ima: added support for new kernel cmdline parameter ima_template_fmt") introduced an additional check on the ima_template variable to avoid multiple template selection. Unfortunately, ima_template could be also set by the setup function of the ima_hash=3D parameter, when it calls ima_template_desc_current(). This caus= es attempts to choose a new template with ima_template=3D or with ima_template_fmt=3D, after ima_hash=3D, to be ignored. Achieve the goal of the commit mentioned with the new static variable template_setup_done, so that template selection requests after ima_hash=3D are not ignored. Finally, call ima_init_template_list(), if not already done, to initialize the list of templates before lookup_template_desc() is called. Reported-by: Guo Zihua Signed-off-by: Roberto Sassu Cc: stable@vger.kernel.org Fixes: c2426d2ad5027 ("ima: added support for new kernel cmdline parameter = ima_template_fmt") Signed-off-by: Mimi Zohar Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- security/integrity/ima/ima_template.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/security/integrity/ima/ima_template.c +++ b/security/integrity/ima/ima_template.c @@ -31,6 +31,7 @@ static struct ima_template_desc builtin_ =20 static LIST_HEAD(defined_templates); static DEFINE_SPINLOCK(template_list); +static int template_setup_done; =20 static struct ima_template_field supported_fields[] =3D { {.field_id =3D "d", .field_init =3D ima_eventdigest_init, @@ -57,10 +58,11 @@ static int __init ima_template_setup(cha struct ima_template_desc *template_desc; int template_len =3D strlen(str); =20 - if (ima_template) + if (template_setup_done) return 1; =20 - ima_init_template_list(); + if (!ima_template) + ima_init_template_list(); =20 /* * Verify that a template with the supplied name exists. @@ -84,6 +86,7 @@ static int __init ima_template_setup(cha } =20 ima_template =3D template_desc; + template_setup_done =3D 1; return 1; } __setup("ima_template=3D", ima_template_setup); @@ -92,7 +95,7 @@ static int __init ima_template_fmt_setup { int num_templates =3D ARRAY_SIZE(builtin_templates); =20 - if (ima_template) + if (template_setup_done) return 1; =20 if (template_desc_init_fields(str, NULL, NULL) < 0) { @@ -103,6 +106,7 @@ static int __init ima_template_fmt_setup =20 builtin_templates[num_templates - 1].fmt =3D str; ima_template =3D builtin_templates + num_templates - 1; + template_setup_done =3D 1; =20 return 1; } From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 528EEC433F5 for ; Mon, 14 Feb 2022 09:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243712AbiBNJct (ORCPT ); Mon, 14 Feb 2022 04:32:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243595AbiBNJcQ (ORCPT ); Mon, 14 Feb 2022 04:32:16 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DCB060AA5; Mon, 14 Feb 2022 01:31:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE94F60F83; Mon, 14 Feb 2022 09:31:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95B93C340E9; Mon, 14 Feb 2022 09:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831067; bh=RuHWb3w5sWFdomNRagX+hTJL7q/b3BKZNtbnuV1Auew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yb/8WwrENztGT1qCGnZ+foFPRevIWJm/U4dPgQwyEyV8HL/EeUmfXIN4YFYp8/dZh vG7ZYYWlA3TXVfl9l4VFt2wqqezVZw9VUWmMX757ed0iUixaSbkIZcuN0boN8ZNfyi aLZNrFYSCTDNgUQquc1Iq10jFfm9fgcQzRXL8TWQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Adrian Hunter , Ulf Hansson Subject: [PATCH 4.14 04/44] mmc: sdhci-of-esdhc: Check for error num after setting mask Date: Mon, 14 Feb 2022 10:25:27 +0100 Message-Id: <20220214092448.054893540@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jiasheng Jiang commit 40c67c291a93f8846c4a972c9ef1b7ba4544c8d0 upstream. Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. And since the sdhci_setup_host() has already checked the return value of the enable_dma, we need not check it in sdhci_resume_host() again. Fixes: 5552d7ad596c ("mmc: sdhci-of-esdhc: set proper dma mask for ls104x c= hips") Signed-off-by: Jiasheng Jiang Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220112083156.1124782-1-jiasheng@iscas.ac.= cn Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/mmc/host/sdhci-of-esdhc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -427,12 +427,16 @@ static void esdhc_of_adma_workaround(str =20 static int esdhc_of_enable_dma(struct sdhci_host *host) { + int ret; u32 value; struct device *dev =3D mmc_dev(host->mmc); =20 if (of_device_is_compatible(dev->of_node, "fsl,ls1043a-esdhc") || - of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc")) - dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); + of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc")) { + ret =3D dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); + if (ret) + return ret; + } =20 value =3D sdhci_readl(host, ESDHC_DMA_SYSCTL); =20 From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A0FCC433FE for ; Mon, 14 Feb 2022 09:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243411AbiBNJc6 (ORCPT ); Mon, 14 Feb 2022 04:32:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243617AbiBNJcR (ORCPT ); Mon, 14 Feb 2022 04:32:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F232A60ABF; Mon, 14 Feb 2022 01:31:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7753B80DC6; Mon, 14 Feb 2022 09:31:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADF5CC340E9; Mon, 14 Feb 2022 09:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831070; bh=RUarBodYx6xjGZZiGN3ycUMWPVTa9cxVTDS0nTgmu1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vGiubPKUZbQ4q68SzGwrchl557gS10RoNnQ8w97f744yj+4dgew9d43/C46K3AAqy 2JA4OWSHjtlPG1bdHkud80Jej1HGj+t7qWp+ojYT17U2cLpqrM5zcW341stkHQZvqR Y8Qvuc8RH+zKvMoBg5hCWHt/DkrtBWJG4K610qfs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Parkhomenko , Serge Semin , Andrew Lunn , "David S. Miller" Subject: [PATCH 4.14 05/44] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs Date: Mon, 14 Feb 2022 10:25:28 +0100 Message-Id: <20220214092448.087642413@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Pavel Parkhomenko commit aec12836e7196e4d360b2cbf20cf7aa5139ad2ec upstream. When setting up autonegotiation for 88E1118R and compatible PHYs, a software reset of PHY is issued before setting up polarity. This is incorrect as changes of MDI Crossover Mode bits are disruptive to the normal operation and must be followed by a software reset to take effect. Let's patch m88e1118_config_aneg() to fix the issue mentioned before by invoking software reset of the PHY just after setting up MDI-x polarity. Fixes: 605f196efbf8 ("phy: Add support for Marvell 88E1118 PHY") Signed-off-by: Pavel Parkhomenko Reviewed-by: Serge Semin Suggested-by: Andrew Lunn Cc: stable@vger.kernel.org Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/net/phy/marvell.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -907,16 +907,15 @@ static int m88e1118_config_aneg(struct p { int err; =20 - err =3D genphy_soft_reset(phydev); + err =3D marvell_set_polarity(phydev, phydev->mdix_ctrl); if (err < 0) return err; =20 - err =3D marvell_set_polarity(phydev, phydev->mdix_ctrl); + err =3D genphy_config_aneg(phydev); if (err < 0) return err; =20 - err =3D genphy_config_aneg(phydev); - return 0; + return genphy_soft_reset(phydev); } =20 static int m88e1118_config_init(struct phy_device *phydev) From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63899C433F5 for ; Mon, 14 Feb 2022 09:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243463AbiBNJdD (ORCPT ); Mon, 14 Feb 2022 04:33:03 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243637AbiBNJcU (ORCPT ); Mon, 14 Feb 2022 04:32:20 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA5160D9B; Mon, 14 Feb 2022 01:31:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 668A860DFD; Mon, 14 Feb 2022 09:31:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29367C340EF; Mon, 14 Feb 2022 09:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831073; bh=b8KCtnDkTIHt4ZUthycQjq3pX/c37BqgOs3AFNYZNN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0vVSsPTtks8+BTPNNVaZCnYrw4XU1KkKUQpP5e9taaIba86LVnQ6rCDsz+Ze/KLA5 SOyvO8nnk9wnEEIiaK0RvVHpR3Gdx4NSXMbAO5p3LTunOFYCo4HCvAlU2hfuqp5YoV ZSdpYgXu42l4kUncEVqEGAOSvzvsU4zdmerBkKIY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker Subject: [PATCH 4.14 06/44] NFS: Fix initialisation of nfs_client cl_flags field Date: Mon, 14 Feb 2022 10:25:29 +0100 Message-Id: <20220214092448.119603289@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Trond Myklebust commit 468d126dab45718feeb728319be20bd869a5eaa7 upstream. For some long forgotten reason, the nfs_client cl_flags field is initialised in nfs_get_client() instead of being initialised at allocation time. This quirk was harmless until we moved the call to nfs_create_rpc_client(). Fixes: dd99e9f98fbf ("NFSv4: Initialise connection to the server in nfs4_al= loc_client()") Cc: stable@vger.kernel.org # 4.8.x Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfs/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -179,6 +179,7 @@ struct nfs_client *nfs_alloc_client(cons INIT_LIST_HEAD(&clp->cl_superblocks); clp->cl_rpcclient =3D ERR_PTR(-EINVAL); =20 + clp->cl_flags =3D cl_init->init_flags; clp->cl_proto =3D cl_init->proto; clp->cl_net =3D get_net(cl_init->net); =20 @@ -426,7 +427,6 @@ struct nfs_client *nfs_get_client(const list_add_tail(&new->cl_share_link, &nn->nfs_client_list); spin_unlock(&nn->nfs_client_lock); - new->cl_flags =3D cl_init->init_flags; return rpc_ops->init_client(new, cl_init); } =20 From nobody Sun Jun 28 04:36:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB237C433EF for ; Mon, 14 Feb 2022 09:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243745AbiBNJdG (ORCPT ); Mon, 14 Feb 2022 04:33:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243671AbiBNJcc (ORCPT ); Mon, 14 Feb 2022 04:32:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9127525C52; Mon, 14 Feb 2022 01:31:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 40751B80DC6; Mon, 14 Feb 2022 09:31:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FA97C340EF; Mon, 14 Feb 2022 09:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831076; bh=DPPSvhmpsnZISTuZ0BJ7zP11uQjkVcGarR8vbezkn2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dfO2/5zAI/0colKAmKpD5HRjbMBKic37XUos0IiDbAod/QGnCkGxdE3lNAMnRSjpW GVQtvSMPkvumEpCtIbaQY0Ir6ZUlNZHzMTvEjBan2Sa+U8/rCIePsw8IvwGNMBCVre NFLqE4Fs6nNxJnv2a3fZuSw+FXy118BMt5kj/ZwI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever Subject: [PATCH 4.14 07/44] NFSD: Clamp WRITE offsets Date: Mon, 14 Feb 2022 10:25:30 +0100 Message-Id: <20220214092448.153846874@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Chuck Lever commit 6260d9a56ab352b54891ec66ab0eced57d55abc6 upstream. Ensure that a client cannot specify a WRITE range that falls in a byte range outside what the kernel's internal types (such as loff_t, which is signed) can represent. The kiocb iterators, invoked in nfsd_vfs_write(), should properly limit write operations to within the underlying file system's s_maxbytes. Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfsd/nfs3proc.c | 5 +++++ fs/nfsd/nfs4proc.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c @@ -199,6 +199,11 @@ nfsd3_proc_write(struct svc_rqst *rqstp) (unsigned long long) argp->offset, argp->stable? " stable" : ""); =20 + resp->status =3D nfserr_fbig; + if (argp->offset > (u64)OFFSET_MAX || + argp->offset + argp->len > (u64)OFFSET_MAX) + return rpc_success; + fh_copy(&resp->fh, &argp->fh); resp->committed =3D argp->stable; nfserr =3D nfsd_write(rqstp, &resp->fh, argp->offset, --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1015,8 +1015,9 @@ nfsd4_write(struct svc_rqst *rqstp, stru unsigned long cnt; int nvecs; =20 - if (write->wr_offset >=3D OFFSET_MAX) - return nfserr_inval; + if (write->wr_offset > (u64)OFFSET_MAX || + write->wr_offset + write->wr_buflen > (u64)OFFSET_MAX) + return nfserr_fbig; =20 status =3D nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, stateid, WR_STATE, &filp, NULL); From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7DB3C433FE for ; Mon, 14 Feb 2022 09:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243845AbiBNJdL (ORCPT ); Mon, 14 Feb 2022 04:33:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243674AbiBNJcd (ORCPT ); Mon, 14 Feb 2022 04:32:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 124B460DBC; Mon, 14 Feb 2022 01:31:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A181460F83; Mon, 14 Feb 2022 09:31:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 735C5C340E9; Mon, 14 Feb 2022 09:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831080; bh=27snDcMHmdboqii2MmwxWugX1Q1BDnFqJRQ8YQ86qqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LpIkGo1J3xto1g9K2+BpMltdeS+3lPFtyJ29jjmtMQXFgZjtJ7KLJv1e4AdnRvDVm iI+Rpw4Yrrvxkf7y04qECVN/duj8deOZfFMMTemT1II5haBzfTtWDUBmOzB2dlf+r8 dMGxni3jqE4mP0saM7QamsgVaGH2tk46SRg9ia7Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker , Sasha Levin Subject: [PATCH 4.14 08/44] NFSv4 only print the label when its queried Date: Mon, 14 Feb 2022 10:25:31 +0100 Message-Id: <20220214092448.186241179@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Olga Kornievskaia [ Upstream commit 2c52c8376db7160a1dd8a681c61c9258405ef143 ] When the bitmask of the attributes doesn't include the security label, don't bother printing it. Since the label might not be null terminated, adjust the printing format accordingly. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfs/nfs4xdr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 3cd04c98da6bc..99facb5f186fd 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -4272,10 +4272,11 @@ static int decode_attr_security_label(struct xdr_st= ream *xdr, uint32_t *bitmap, } else printk(KERN_WARNING "%s: label too long (%u)!\n", __func__, len); + if (label && label->label) + dprintk("%s: label=3D%.*s, len=3D%d, PI=3D%d, LFS=3D%d\n", + __func__, label->len, (char *)label->label, + label->len, label->pi, label->lfs); } - if (label && label->label) - dprintk("%s: label=3D%s, len=3D%d, PI=3D%d, LFS=3D%d\n", __func__, - (char *)label->label, label->len, label->pi, label->lfs); return status; =20 out_overflow: --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EE32C433F5 for ; Mon, 14 Feb 2022 09:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243777AbiBNJdO (ORCPT ); Mon, 14 Feb 2022 04:33:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243780AbiBNJcn (ORCPT ); Mon, 14 Feb 2022 04:32:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ACB960D88; Mon, 14 Feb 2022 01:31:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD60660DFD; Mon, 14 Feb 2022 09:31:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 919BCC340E9; Mon, 14 Feb 2022 09:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831083; bh=3ac+FuFvTfl2BMZ4CXOkDSBDx8Add5UW+u1yknlOleg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KYq+y3nX2NXuvqEbOfADOeV2QiLUgqBp/Ai7cvUY/KRBdkD1waAzXFnM9Wnrfoi0w 6ukYBy3vaTV0BuRtnDPsOTfqUjf/ddCl6N39s7ChahUW2DhaFxLACNGENesokKvfOE GHortqWf+5GtEh433o9UMMTRrj758lnwOI9m0/Hc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaoke Wang , Anna Schumaker , Sasha Levin Subject: [PATCH 4.14 09/44] nfs: nfs4clinet: check the return value of kstrdup() Date: Mon, 14 Feb 2022 10:25:32 +0100 Message-Id: <20220214092448.216651144@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xiaoke Wang [ Upstream commit fbd2057e5329d3502a27491190237b6be52a1cb6 ] kstrdup() returns NULL when some internal memory errors happen, it is better to check the return value of it so to catch the memory error in time. Signed-off-by: Xiaoke Wang Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfs/nfs4client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 02b01b4025f6e..c7672c89b9673 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -1241,8 +1241,11 @@ int nfs4_update_server(struct nfs_server *server, co= nst char *hostname, } nfs_put_client(clp); =20 - if (server->nfs_client->cl_hostname =3D=3D NULL) + if (server->nfs_client->cl_hostname =3D=3D NULL) { server->nfs_client->cl_hostname =3D kstrdup(hostname, GFP_KERNEL); + if (server->nfs_client->cl_hostname =3D=3D NULL) + return -ENOMEM; + } nfs_server_insert_lists(server); =20 return nfs_probe_destination(server); --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 959C7C433F5 for ; Mon, 14 Feb 2022 09:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243418AbiBNJbp (ORCPT ); Mon, 14 Feb 2022 04:31:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243481AbiBNJau (ORCPT ); Mon, 14 Feb 2022 04:30:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2724260ABC; Mon, 14 Feb 2022 01:29:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AD59F60FE9; Mon, 14 Feb 2022 09:29:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C9F1C340E9; Mon, 14 Feb 2022 09:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644830993; bh=GyoKvYHjJdZEdczGMaOTHA3l7hEsSGN7FAAdvH/xJRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r9/RqCEoXb2n5WtaN+ad7aRF5IrhD5zXCAaWdgwmNFA2PcuxfymUGtX3A2eA+Xq6E pRj4yBM/eYBB7Gn2RanBqKJ6cAjWQVSFw/lId1Sj1/eVHqGlpClFTZw1BXwZvJlusX UBgVCyeVeQ19qHGAD0gdknAZDDW0OCy9G1Fda1Ig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, rtm@csail.mit.edu, Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 4.14 10/44] NFSv4.1: Fix uninitialised variable in devicenotify Date: Mon, 14 Feb 2022 10:25:33 +0100 Message-Id: <20220214092448.248364402@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Trond Myklebust [ Upstream commit b05bf5c63b326ce1da84ef42498d8e0e292e694c ] When decode_devicenotify_args() exits with no entries, we need to ensure that the struct cb_devicenotifyargs is initialised to { 0, NULL } in order to avoid problems in nfs4_callback_devicenotify(). Reported-by: Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfs/callback.h | 2 +- fs/nfs/callback_proc.c | 2 +- fs/nfs/callback_xdr.c | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index a20a0bce40a48..80ad04abcf309 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h @@ -168,7 +168,7 @@ struct cb_devicenotifyitem { }; =20 struct cb_devicenotifyargs { - int ndevs; + uint32_t ndevs; struct cb_devicenotifyitem *devs; }; =20 diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 440ff8e7082b6..3998b432e1b98 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -355,7 +355,7 @@ __be32 nfs4_callback_devicenotify(void *argp, void *res= p, struct cb_process_state *cps) { struct cb_devicenotifyargs *args =3D argp; - int i; + uint32_t i; __be32 res =3D 0; struct nfs_client *clp =3D cps->clp; struct nfs_server *server =3D NULL; diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 57de914630bc9..36c34be839d09 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -265,11 +265,9 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, void *argp) { struct cb_devicenotifyargs *args =3D argp; + uint32_t tmp, n, i; __be32 *p; __be32 status =3D 0; - u32 tmp; - int n, i; - args->ndevs =3D 0; =20 /* Num of device notifications */ p =3D read_buf(xdr, sizeof(uint32_t)); @@ -278,7 +276,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, goto out; } n =3D ntohl(*p++); - if (n <=3D 0) + if (n =3D=3D 0) goto out; if (n > ULONG_MAX / sizeof(*args->devs)) { status =3D htonl(NFS4ERR_BADXDR); @@ -336,19 +334,21 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqst= p, dev->cbd_immediate =3D 0; } =20 - args->ndevs++; - dprintk("%s: type %d layout 0x%x immediate %d\n", __func__, dev->cbd_notify_type, dev->cbd_layout_type, dev->cbd_immediate); } + args->ndevs =3D n; + dprintk("%s: ndevs %d\n", __func__, args->ndevs); + return 0; +err: + kfree(args->devs); out: + args->devs =3D NULL; + args->ndevs =3D 0; dprintk("%s: status %d ndevs %d\n", __func__, ntohl(status), args->ndevs); return status; -err: - kfree(args->devs); - goto out; } =20 static __be32 decode_sessionid(struct xdr_stream *xdr, --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9E5EC433F5 for ; Mon, 14 Feb 2022 09:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243404AbiBNJbJ (ORCPT ); Mon, 14 Feb 2022 04:31:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243533AbiBNJay (ORCPT ); Mon, 14 Feb 2022 04:30:54 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E573B65499; Mon, 14 Feb 2022 01:29:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8A201B80DC7; Mon, 14 Feb 2022 09:29:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6805C340E9; Mon, 14 Feb 2022 09:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644830996; bh=HvOdQTY9G06pOPmVVUWFW37MhjqeFcqZr++os+rIBhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c26JpWuJjd8mdOmA5E8uGhOuZh8YcwE2wSC67RnVm/eiNiQk7Yk3R1IhL13Nx3cqq K3FexW12ICqhuYHDXk3WqwVHjl1IdnvteyOFr5ZWIThL1bQLUZa3gdxPoz2d4BUVHN l+Z/NeYMP5zajVAynGEaQi9UFgAaDGJRX4UqMfGY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker , Sasha Levin Subject: [PATCH 4.14 11/44] NFSv4 remove zero number of fs_locations entries error check Date: Mon, 14 Feb 2022 10:25:34 +0100 Message-Id: <20220214092448.278398479@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Olga Kornievskaia [ Upstream commit 90e12a3191040bd3854d3e236c35921e4e92a044 ] Remove the check for the zero length fs_locations reply in the xdr decoding, and instead check for that in the migration code. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfs/nfs4state.c | 3 +++ fs/nfs/nfs4xdr.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index f92bfc787c5fe..c0987557d4ab4 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -2003,6 +2003,9 @@ static int nfs4_try_migration(struct nfs_server *serv= er, struct rpc_cred *cred) } =20 result =3D -NFS4ERR_NXIO; + if (!locations->nlocations) + goto out; + if (!(locations->fattr.valid & NFS_ATTR_FATTR_V4_LOCATIONS)) { dprintk("<-- %s: No fs_locations data, migration skipped\n", __func__); diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 99facb5f186fd..ccdc0ca699c39 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -3731,8 +3731,6 @@ static int decode_attr_fs_locations(struct xdr_stream= *xdr, uint32_t *bitmap, st if (unlikely(!p)) goto out_overflow; n =3D be32_to_cpup(p); - if (n <=3D 0) - goto out_eio; for (res->nlocations =3D 0; res->nlocations < n; res->nlocations++) { u32 m; struct nfs4_fs_location *loc; --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA534C433F5 for ; Mon, 14 Feb 2022 09:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243434AbiBNJbM (ORCPT ); Mon, 14 Feb 2022 04:31:12 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243554AbiBNJa5 (ORCPT ); Mon, 14 Feb 2022 04:30:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D5A860D81; Mon, 14 Feb 2022 01:30:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B6B8360F83; Mon, 14 Feb 2022 09:29:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97F2DC340E9; Mon, 14 Feb 2022 09:29:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644830999; bh=NpZm3yFy3Z1UNqbMTXkFjMGIfCtrlF8R0qEN3T7AHQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wdikqBJvGedEyzsKmAsbfyqNMmKd9uUlTkA8J5wv61JiG77sGfI6KuxMTlUgtua6+ sj7HUMBcxgv+yLcjuV76OKYr5KqpJxVZonbNLmVCAL/AiQ3boowZ5Sqi+/UAr5r0pN OTjM7CXY1bqPtND/lbLASmDovMB9FZlEWyqUf0kA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker , Sasha Levin Subject: [PATCH 4.14 12/44] NFSv4 expose nfs_parse_server_name function Date: Mon, 14 Feb 2022 10:25:35 +0100 Message-Id: <20220214092448.308729383@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Olga Kornievskaia [ Upstream commit f5b27cc6761e27ee6387a24df1a99ca77b360fea ] Make nfs_parse_server_name available outside of nfs4namespace.c. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- fs/nfs/nfs4_fs.h | 3 ++- fs/nfs/nfs4namespace.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 22cff39cca29a..c9ca2237c3fec 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -242,7 +242,8 @@ struct vfsmount *nfs4_submount(struct nfs_server *, str= uct dentry *, struct nfs_fh *, struct nfs_fattr *); int nfs4_replace_transport(struct nfs_server *server, const struct nfs4_fs_locations *locations); - +size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa, + size_t salen, struct net *net); /* nfs4proc.c */ extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exc= eption *); extern int nfs4_call_sync(struct rpc_clnt *, struct nfs_server *, diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 8c3f327d858d5..b36361ca0d36b 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -121,8 +121,8 @@ static int nfs4_validate_fspath(struct dentry *dentry, return 0; } =20 -static size_t nfs_parse_server_name(char *string, size_t len, - struct sockaddr *sa, size_t salen, struct net *net) +size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa, + size_t salen, struct net *net) { ssize_t ret; =20 --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E99C433F5 for ; Mon, 14 Feb 2022 09:31:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243130AbiBNJb0 (ORCPT ); Mon, 14 Feb 2022 04:31:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243633AbiBNJbA (ORCPT ); Mon, 14 Feb 2022 04:31:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EACCF655C3; Mon, 14 Feb 2022 01:30:03 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E636B80DC9; Mon, 14 Feb 2022 09:30:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A709DC340E9; Mon, 14 Feb 2022 09:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831002; bh=sRCeHRUcEVzofXBICCRpX95loDW+YUQQzIAVjutA1HM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2BnO9T2jHrMgxj7ZdpnQTMm1f4gqySWlEsxdeLIBMqq5RM5BCNLt0TBFlBkJD1QS7 VzUz+T7p1ClEy6y3LuD2Ir70lMHmjAHwRNrrKI6K0fkQ4QzDSO6pD5TcoRje8W4+il 4ox2Mhhl41I8tgTXcRsfwgIYEUEB671PPrKnoHcQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, ZouMingzhe , Mike Christie , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 13/44] scsi: target: iscsi: Make sure the np under each tpg is unique Date: Mon, 14 Feb 2022 10:25:36 +0100 Message-Id: <20220214092448.341657325@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: ZouMingzhe [ Upstream commit a861790afaa8b6369eee8a88c5d5d73f5799c0c6 ] iscsit_tpg_check_network_portal() has nested for_each loops and is supposed to return true when a match is found. However, the tpg loop will still continue after existing the tpg_np loop. If this tpg_np is not the last the match value will be changed. Break the outer loop after finding a match and make sure the np under each tpg is unique. Link: https://lore.kernel.org/r/20220111054742.19582-1-mingzhe.zou@easystac= k.cn Signed-off-by: ZouMingzhe Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/target/iscsi/iscsi_target_tpg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi= /iscsi_target_tpg.c index 16e7516052a44..2b78843091a2e 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -448,6 +448,9 @@ static bool iscsit_tpg_check_network_portal( break; } spin_unlock(&tpg->tpg_np_lock); + + if (match) + break; } spin_unlock(&tiqn->tiqn_tpg_lock); =20 --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E91F1C433F5 for ; Mon, 14 Feb 2022 09:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243272AbiBNJbf (ORCPT ); Mon, 14 Feb 2022 04:31:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243294AbiBNJbC (ORCPT ); Mon, 14 Feb 2022 04:31:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D9560D87; Mon, 14 Feb 2022 01:30:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4744A60F87; Mon, 14 Feb 2022 09:30:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31135C340E9; Mon, 14 Feb 2022 09:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831006; bh=5iuORTELvsKpZaPEF5mrgRcATjPKHLLV9RGRvSPJiN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tb8wTV7aLY1MeA3aRe1m3XV2UMcU+e7Z/6z/NJ+FFKj4DDMfqNJBLFImO9dlro0yQ 95PuMVv5GAQWndDUtB1rWAismYlH1DhHlX34iAvNx/3P2BShlPqsasxbHuETAjjsXf 6xzSP7LeKkrKqTcFeupoc0qfoxfDlHlpbsdHpfXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Minas Harutyunyan , Amelie Delaunay , Sasha Levin Subject: [PATCH 4.14 14/44] usb: dwc2: gadget: dont try to disable ep0 in dwc2_hsotg_suspend Date: Mon, 14 Feb 2022 10:25:37 +0100 Message-Id: <20220214092448.373945460@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Amelie Delaunay [ Upstream commit ac55d163855924aa5af9f1560977da8f346963c8 ] Calling dwc2_hsotg_ep_disable on ep0 (in/out) will lead to the following logs before returning -EINVAL: dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0 dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0 To avoid these two logs while suspending, start disabling the endpoint from the index 1, as done in dwc2_hsotg_udc_stop: /* all endpoints should be shutdown */ for (ep =3D 1; ep < hsotg->num_of_eps; ep++) { if (hsotg->eps_in[ep]) dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep); if (hsotg->eps_out[ep]) dwc2_hsotg_ep_disable_lock(&hsotg->eps_out[ep]->ep); } Acked-by: Minas Harutyunyan Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20211207130101.270314-1-amelie.delaunay@fos= s.st.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/dwc2/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index f1edc5727000c..dddc5d02b5524 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -4783,7 +4783,7 @@ int dwc2_hsotg_suspend(struct dwc2_hsotg *hsotg) hsotg->gadget.speed =3D USB_SPEED_UNKNOWN; spin_unlock_irqrestore(&hsotg->lock, flags); =20 - for (ep =3D 0; ep < hsotg->num_of_eps; ep++) { + for (ep =3D 1; ep < hsotg->num_of_eps; ep++) { if (hsotg->eps_in[ep]) dwc2_hsotg_ep_disable(&hsotg->eps_in[ep]->ep); if (hsotg->eps_out[ep]) --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B559C433EF for ; Mon, 14 Feb 2022 09:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243325AbiBNJbj (ORCPT ); Mon, 14 Feb 2022 04:31:39 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243316AbiBNJbD (ORCPT ); Mon, 14 Feb 2022 04:31:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B1C5BF44; Mon, 14 Feb 2022 01:30:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 26489B80DC4; Mon, 14 Feb 2022 09:30:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32611C340E9; Mon, 14 Feb 2022 09:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831009; bh=NWXtWuPcTk1NqFEhAom7jp65/IRafTnTScGEgINFwbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MN5Uv+AU33f7sO+dIsLGVpF77G50aCQsgmJmb6zwSUEvslg7a2GYAaEmX+eK7WcZT 7I85EGaMnE76OJHS1ehZbXIiJ4tVpekEya2mhP5ed0cEIZ5P++cuDxkC2zCtu4HF9Z Yn/C7u/12su/s46LxP7kWWSwkCDXVjWhvFoPX+AU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jisheng Zhang , Jernej Skrabec , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 15/44] net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() Date: Mon, 14 Feb 2022 10:25:38 +0100 Message-Id: <20220214092448.403456250@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jisheng Zhang [ Upstream commit 9e0db41e7a0b6f1271cbcfb16dbf5b8641b4e440 ] When readl_poll_timeout() timeout, we'd better directly use its return value. Before this patch: [ 2.145528] dwmac-sun8i: probe of 4500000.ethernet failed with error -14 After this patch: [ 2.138520] dwmac-sun8i: probe of 4500000.ethernet failed with error -110 Signed-off-by: Jisheng Zhang Acked-by: Jernej Skrabec Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-sun8i.c index 8e60315a087c9..1027831e5d814 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -630,7 +630,7 @@ static int sun8i_dwmac_reset(struct stmmac_priv *priv) =20 if (err) { dev_err(priv->device, "EMAC reset timeout\n"); - return -EFAULT; + return err; } return 0; } --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B8E2C433EF for ; Mon, 14 Feb 2022 09:31:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243516AbiBNJbv (ORCPT ); Mon, 14 Feb 2022 04:31:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243441AbiBNJbR (ORCPT ); Mon, 14 Feb 2022 04:31:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB56BF53; Mon, 14 Feb 2022 01:30:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF069B80D83; Mon, 14 Feb 2022 09:30:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20F07C340EF; Mon, 14 Feb 2022 09:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831012; bh=nYslgeNak5ILpjm8/69W2TdwvNNOr5bMUskwb787vUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zPrmCe+6e9qBXrhwXJXjroaF8hksaNszvrcrUindG88A0bpLxcD7feIEM+6uz8IVL AYTzzLvr/p7XxYXLCla7QhxUypSZNYgQrxrtoYG1yyUR0cPjHIuGQGqeCcbMKk4QH7 1rrPNs/aTt0/zG6l0Yt1WW1lCNh6SuB6Zk9otaLY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Levin Subject: [PATCH 4.14 16/44] Revert "net: axienet: Wait for PhyRstCmplt after core reset" Date: Mon, 14 Feb 2022 10:25:39 +0100 Message-Id: <20220214092448.434681680@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This reverts commit ff594e1b6f39f07f050759de2d27c36b7739c0c9. Breaks the build on 4.14 and 4.9. Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index d2ba466613c0a..7876e56a5b5db 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -279,16 +279,6 @@ static int axienet_dma_bd_init(struct net_device *ndev) axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, cr | XAXIDMA_CR_RUNSTOP_MASK); =20 - /* Wait for PhyRstCmplt bit to be set, indicating the PHY reset has finis= hed */ - ret =3D read_poll_timeout(axienet_ior, value, - value & XAE_INT_PHYRSTCMPLT_MASK, - DELAY_OF_ONE_MILLISEC, 50000, false, lp, - XAE_IS_OFFSET); - if (ret) { - dev_err(lp->dev, "%s: timeout waiting for PhyRstCmplt\n", __func__); - return ret; - } - return 0; out: axienet_dma_bd_release(ndev); --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA483C433EF for ; Mon, 14 Feb 2022 09:31:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243458AbiBNJbt (ORCPT ); Mon, 14 Feb 2022 04:31:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243414AbiBNJbJ (ORCPT ); Mon, 14 Feb 2022 04:31:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99773BF55; Mon, 14 Feb 2022 01:30:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1800460C8A; Mon, 14 Feb 2022 09:30:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F355CC340E9; Mon, 14 Feb 2022 09:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831015; bh=MCjR5djHfF6Jm7ho/tzh2m3oMgwvsFoWOd7hkghuuQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i5Jy/Wk9vqIz6K45BaUmcDSquB0nxzsJDnDg/QYr0lcD+V0cHahAvmfQ6blSS0eLy WP9TGIlEuMft7DxISeTLWJPnUkahClVVYjHF23twRBGsJQLD7athaEboD3h1646+r0 asZuU0on/5cratcpxs69S21yqs5RNQVrbKq+aZHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Borkmann , Alexei Starovoitov , Frank van der Linden Subject: [PATCH 4.14 17/44] bpf: Add kconfig knob for disabling unpriv bpf by default Date: Mon, 14 Feb 2022 10:25:40 +0100 Message-Id: <20220214092448.467759740@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Daniel Borkmann commit 08389d888287c3823f80b0216766b71e17f0aba5 upstream. Add a kconfig knob which allows for unprivileged bpf to be disabled by defa= ult. If set, the knob sets /proc/sys/kernel/unprivileged_bpf_disabled to value o= f 2. This still allows a transition of 2 -> {0,1} through an admin. Similarly, this also still keeps 1 -> {1} behavior intact, so that once set to permane= ntly disabled, it cannot be undone aside from a reboot. We've also added extra2 with max of 2 for the procfs handler, so that an ad= min still has a chance to toggle between 0 <-> 2. Either way, as an additional alternative, applications can make use of CAP_= BPF that we added a while ago. Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.= 1620765074.git.daniel@iogearbox.net [fllinden@amazon.com: backported to 4.14] Signed-off-by: Frank van der Linden Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- Documentation/sysctl/kernel.txt | 21 +++++++++++++++++++++ init/Kconfig | 10 ++++++++++ kernel/bpf/syscall.c | 3 ++- kernel/sysctl.c | 29 +++++++++++++++++++++++++---- 4 files changed, 58 insertions(+), 5 deletions(-) --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt @@ -91,6 +91,7 @@ show up in /proc/sys/kernel: - sysctl_writes_strict - tainted - threads-max +- unprivileged_bpf_disabled - unknown_nmi_panic - watchdog - watchdog_thresh @@ -999,6 +1000,26 @@ available RAM pages threads-max is reduc =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +unprivileged_bpf_disabled: + +Writing 1 to this entry will disable unprivileged calls to bpf(); +once disabled, calling bpf() without CAP_SYS_ADMIN will return +-EPERM. Once set to 1, this can't be cleared from the running kernel +anymore. + +Writing 2 to this entry will also disable unprivileged calls to bpf(), +however, an admin can still change this setting later on, if needed, by +writing 0 or 1 to this entry. + +If BPF_UNPRIV_DEFAULT_OFF is enabled in the kernel config, then this +entry will default to 2 instead of 0. + + 0 - Unprivileged calls to bpf() are enabled + 1 - Unprivileged calls to bpf() are disabled without recovery + 2 - Unprivileged calls to bpf() are disabled + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + unknown_nmi_panic: =20 The value in this file affects behavior of handling NMI. When the --- a/init/Kconfig +++ b/init/Kconfig @@ -1378,6 +1378,16 @@ config ADVISE_SYSCALLS applications use these syscalls, you can disable this option to save space. =20 +config BPF_UNPRIV_DEFAULT_OFF + bool "Disable unprivileged BPF by default" + depends on BPF_SYSCALL + help + Disables unprivileged BPF by default by setting the corresponding + /proc/sys/kernel/unprivileged_bpf_disabled knob to 2. An admin can + still reenable it by setting it to 0 later on, or permanently + disable it by setting it to 1 (from which no other transition to + 0 is possible anymore). + config USERFAULTFD bool "Enable userfaultfd() system call" select ANON_INODES --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -37,7 +37,8 @@ static DEFINE_SPINLOCK(prog_idr_lock); static DEFINE_IDR(map_idr); static DEFINE_SPINLOCK(map_idr_lock); =20 -int sysctl_unprivileged_bpf_disabled __read_mostly; +int sysctl_unprivileged_bpf_disabled __read_mostly =3D + IS_BUILTIN(CONFIG_BPF_UNPRIV_DEFAULT_OFF) ? 2 : 0; =20 static const struct bpf_map_ops * const bpf_map_types[] =3D { #define BPF_PROG_TYPE(_id, _ops) --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -242,6 +242,28 @@ static int sysrq_sysctl_handler(struct c =20 #endif =20 +#ifdef CONFIG_BPF_SYSCALL +static int bpf_unpriv_handler(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) +{ + int ret, unpriv_enable =3D *(int *)table->data; + bool locked_state =3D unpriv_enable =3D=3D 1; + struct ctl_table tmp =3D *table; + + if (write && !capable(CAP_SYS_ADMIN)) + return -EPERM; + + tmp.data =3D &unpriv_enable; + ret =3D proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); + if (write && !ret) { + if (locked_state && unpriv_enable !=3D 1) + return -EPERM; + *(int *)table->data =3D unpriv_enable; + } + return ret; +} +#endif + static struct ctl_table kern_table[]; static struct ctl_table vm_table[]; static struct ctl_table fs_table[]; @@ -1201,10 +1223,9 @@ static struct ctl_table kern_table[] =3D { .data =3D &sysctl_unprivileged_bpf_disabled, .maxlen =3D sizeof(sysctl_unprivileged_bpf_disabled), .mode =3D 0644, - /* only handle a transition from default "0" to "1" */ - .proc_handler =3D proc_dointvec_minmax, - .extra1 =3D &one, - .extra2 =3D &one, + .proc_handler =3D bpf_unpriv_handler, + .extra1 =3D &zero, + .extra2 =3D &two, }, #endif #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F888C433EF for ; Mon, 14 Feb 2022 09:31:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232402AbiBNJbx (ORCPT ); Mon, 14 Feb 2022 04:31:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243504AbiBNJbS (ORCPT ); Mon, 14 Feb 2022 04:31:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71497BF64; Mon, 14 Feb 2022 01:30:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 05B5D60F8F; Mon, 14 Feb 2022 09:30:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9270C340EF; Mon, 14 Feb 2022 09:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831018; bh=nwAcgOvUUbyu0b9uqfYy5jUAsPqE5sOsSIj2K8lsWbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ny0O3+gUmhLJKOQYRXewrbFKp3kadr+oKHF59i9ihypUlnjJHGaRlbaYGIxzUphuP NskXIz24yXy/Cm8yVpxJYGNPJVZtzZRH0ygn00/rMcMZj+Ief71I9028hnn4oal4YN 62q9rUF9dXhfynFXSF436ISb/mutVobPLdKL6xj8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , Shawn Guo Subject: [PATCH 4.14 18/44] ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group Date: Mon, 14 Feb 2022 10:25:41 +0100 Message-Id: <20220214092448.505375269@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Fabio Estevam commit 42c9b28e6862d16db82a56f5667cf4d1f6658cf6 upstream. Currently, SD card fails to mount due to the following pinctrl error: [ 11.170000] imx23-pinctrl 80018000.pinctrl: pin SSP1_DETECT already requ= ested by 80018000.pinctrl; cannot claim for 80010000.spi [ 11.180000] imx23-pinctrl 80018000.pinctrl: pin-65 (80010000.spi) status= -22 [ 11.190000] imx23-pinctrl 80018000.pinctrl: could not request pin 65 (SS= P1_DETECT) from group mmc0-pins-fixup.0 on device 80018000.pinctrl [ 11.200000] mxs-mmc 80010000.spi: Error applying setting, reverse things= back Fix it by removing the MX23_PAD_SSP1_DETECT pin from the hog group as it is already been used by the mmc0-pins-fixup pinctrl group. With this change the rootfs can be mounted and the imx23-evk board can boot successfully. Cc: Fixes: bc3875f1a61e ("ARM: dts: mxs: modify mx23/mx28 dts files to use pinc= trl headers") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- arch/arm/boot/dts/imx23-evk.dts | 1 - 1 file changed, 1 deletion(-) --- a/arch/arm/boot/dts/imx23-evk.dts +++ b/arch/arm/boot/dts/imx23-evk.dts @@ -48,7 +48,6 @@ MX23_PAD_LCD_RESET__GPIO_1_18 MX23_PAD_PWM3__GPIO_1_29 MX23_PAD_PWM4__GPIO_1_30 - MX23_PAD_SSP1_DETECT__SSP1_DETECT >; fsl,drive-strength =3D ; fsl,voltage =3D ; From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6457C433F5 for ; Mon, 14 Feb 2022 09:32:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243292AbiBNJcC (ORCPT ); Mon, 14 Feb 2022 04:32:02 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243171AbiBNJb2 (ORCPT ); Mon, 14 Feb 2022 04:31:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B034AE41; Mon, 14 Feb 2022 01:30:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BEB14B80DC5; Mon, 14 Feb 2022 09:30:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E854CC340E9; Mon, 14 Feb 2022 09:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831021; bh=Ug9e0H5vXPr8eJ+XBkiyzsIfVnY04iyCxHeJHXPLEp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mkXG7IX/pNdLRoEuurW+TqZpygqJgAnRjWQVhQyBW8C8Sm4gVzF27dTLmdggqXyA6 0r/kYL+mRS+ZfOAWVV0ldf4f/mkeP5E74jjITKRFJanEACpUqCs8SA0xd5ZL9/1I4V oL7a1Wu0GAHWvzDsT3MfPNHrnAx5O8z2rall7Lz0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Neil Armstrong , Sasha Levin Subject: [PATCH 4.14 19/44] ARM: dts: meson: Fix the UART compatible strings Date: Mon, 14 Feb 2022 10:25:42 +0100 Message-Id: <20220214092448.537068998@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Martin Blumenstingl [ Upstream commit 5225e1b87432dcf0d0fc3440824b91d04c1d6cc1 ] The dt-bindings for the UART controller only allow the following values for Meson6 SoCs: - "amlogic,meson6-uart", "amlogic,meson-ao-uart" - "amlogic,meson6-uart" Use the correct fallback compatible string "amlogic,meson-ao-uart" for AO UART. Drop the "amlogic,meson-uart" compatible string from the EE domain UART controllers. Fixes: ec9b59162fd831 ("ARM: dts: meson6: use stable UART bindings") Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211227180026.4068352-2-martin.blumensting= l@googlemail.com Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- arch/arm/boot/dts/meson.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi index cd6ad072e72c1..05dfd74a40044 100644 --- a/arch/arm/boot/dts/meson.dtsi +++ b/arch/arm/boot/dts/meson.dtsi @@ -86,14 +86,14 @@ hwrng: rng@8100 { }; =20 uart_A: serial@84c0 { - compatible =3D "amlogic,meson6-uart", "amlogic,meson-uart"; + compatible =3D "amlogic,meson6-uart"; reg =3D <0x84c0 0x18>; interrupts =3D ; status =3D "disabled"; }; =20 uart_B: serial@84dc { - compatible =3D "amlogic,meson6-uart", "amlogic,meson-uart"; + compatible =3D "amlogic,meson6-uart"; reg =3D <0x84dc 0x18>; interrupts =3D ; status =3D "disabled"; @@ -131,7 +131,7 @@ saradc: adc@8680 { }; =20 uart_C: serial@8700 { - compatible =3D "amlogic,meson6-uart", "amlogic,meson-uart"; + compatible =3D "amlogic,meson6-uart"; reg =3D <0x8700 0x18>; interrupts =3D ; status =3D "disabled"; @@ -196,7 +196,7 @@ ir_receiver: ir-receiver@480 { }; =20 uart_AO: serial@4c0 { - compatible =3D "amlogic,meson6-uart", "amlogic,meson-ao-uart", "amlogi= c,meson-uart"; + compatible =3D "amlogic,meson6-uart", "amlogic,meson-ao-uart"; reg =3D <0x4c0 0x18>; interrupts =3D ; status =3D "disabled"; --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5697EC43217 for ; Mon, 14 Feb 2022 09:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243598AbiBNJcL (ORCPT ); Mon, 14 Feb 2022 04:32:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243436AbiBNJbr (ORCPT ); Mon, 14 Feb 2022 04:31:47 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66518AE77; Mon, 14 Feb 2022 01:30:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E905B60F8D; Mon, 14 Feb 2022 09:30:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64AD0C340E9; Mon, 14 Feb 2022 09:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831028; bh=xTXfdeZ0M0/7c+q//0P2caLawKRx8oTCw8iwRYfen8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DZB6ZyWWNKU3fUyM6bJnNDneV63Tantx2geKBfC+6f0j046mEKgrsHR2xJcjzlS2Y Zbd8UoRFMPHgrxMxspZfwI+F0uIOSGM5nqqrAzf1v7Kk5in3VoipwIAgBafm4z5uLX VJ9RdG2a2uzS0QP4aJ68plY7JVJhgBhMDImcECuA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Sasha Levin Subject: [PATCH 4.14 20/44] staging: fbtft: Fix error path in fbtft_driver_module_init() Date: Mon, 14 Feb 2022 10:25:43 +0100 Message-Id: <20220214092448.568447156@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-K=C3=B6nig [ Upstream commit 426aca16e903b387a0b0001d62207a745c67cfd3 ] If registering the platform driver fails, the function must not return without undoing the spi driver registration first. Fixes: c296d5f9957c ("staging: fbtft: core support") Signed-off-by: Uwe Kleine-K=C3=B6nig Link: https://lore.kernel.org/r/20220118181338.207943-1-u.kleine-koenig@pen= gutronix.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/staging/fbtft/fbtft.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index 488ab788138e1..b086e8e5b4dd3 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -342,7 +342,10 @@ static int __init fbtft_driver_module_init(void) = \ ret =3D spi_register_driver(&fbtft_driver_spi_driver); \ if (ret < 0) \ return ret; \ - return platform_driver_register(&fbtft_driver_platform_driver); \ + ret =3D platform_driver_register(&fbtft_driver_platform_driver); \ + if (ret < 0) \ + spi_unregister_driver(&fbtft_driver_spi_driver); \ + return ret; \ } = \ \ static void __exit fbtft_driver_module_exit(void) = \ --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDB76C4332F for ; Mon, 14 Feb 2022 09:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243551AbiBNJcP (ORCPT ); Mon, 14 Feb 2022 04:32:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243522AbiBNJbw (ORCPT ); Mon, 14 Feb 2022 04:31:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 325611AD93; Mon, 14 Feb 2022 01:30:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D8EABB80DCB; Mon, 14 Feb 2022 09:30:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2122C340E9; Mon, 14 Feb 2022 09:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831031; bh=PxAmF0SKGpeqELjz1UDvowOi6GjdGdS2hFerTKhDzi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbrqINtdhrLAd17ZLhZkX2920m9PvfoQTpkqDm1FbQlAMYmFI2FEpGeQDVVNOha1B i4AYQjOw6KLgxh599wDtgfKt74MprmtYWrFjCgD4FhdoSv1vVOwoj2MwXLpVohmYnF Akzk5FYNRC2Xay6Ydsh+yAlkRQUxeC3QHPDsOLV8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , Shawn Guo , Sasha Levin Subject: [PATCH 4.14 21/44] ARM: dts: imx6qdl-udoo: Properly describe the SD card detect Date: Mon, 14 Feb 2022 10:25:44 +0100 Message-Id: <20220214092448.601120879@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Fabio Estevam [ Upstream commit 993d66140f8d1c1853a3b58b77b43b681eb64dee ] GPIO7_IO00 is used as SD card detect. Properly describe this in the devicetree. Fixes: 40cdaa542cf0 ("ARM: dts: imx6q-udoo: Add initial board support") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- arch/arm/boot/dts/imx6qdl-udoo.dtsi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qd= l-udoo.dtsi index fc4ae2e423bd7..b0fdcae66ead3 100644 --- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi +++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi @@ -9,6 +9,8 @@ * */ =20 +#include + / { aliases { backlight =3D &backlight; @@ -201,6 +203,7 @@ MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059 + MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0 >; }; =20 @@ -267,7 +270,7 @@ &usbh1 { &usdhc3 { pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_usdhc3>; - non-removable; + cd-gpios =3D <&gpio7 0 GPIO_ACTIVE_LOW>; status =3D "okay"; }; =20 --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E4A2C433F5 for ; Mon, 14 Feb 2022 09:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243686AbiBNJck (ORCPT ); Mon, 14 Feb 2022 04:32:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243554AbiBNJbw (ORCPT ); Mon, 14 Feb 2022 04:31:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB621AD9B; Mon, 14 Feb 2022 01:30:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ADB7260F87; Mon, 14 Feb 2022 09:30:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 700DEC340E9; Mon, 14 Feb 2022 09:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831035; bh=NlbgCxnp9oO2nuW3HnVYoERP5QFdBjdb1Yiop2f+xpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JbXyRvlac92PfZWr9fL1bqyNpoXQxHHj05IuP0TVdmyZjTFd9VmcD4r32/uQ8UkH1 Rd3ilffxOp2f/aXFVTvMd7kY3kkCCIEYTtlzcU7CiwjUjEYv85NQ60FLwAUrumVuy0 KTMPoHOScqGPayZ+HgllWs2USId/R8cSVUirNE0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Keeping , Pratham Pratap , Udipto Goswami , Sasha Levin Subject: [PATCH 4.14 22/44] usb: f_fs: Fix use-after-free for epfile Date: Mon, 14 Feb 2022 10:25:45 +0100 Message-Id: <20220214092448.631616764@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Udipto Goswami [ Upstream commit ebe2b1add1055b903e2acd86b290a85297edc0b3 ] Consider a case where ffs_func_eps_disable is called from ffs_func_disable as part of composition switch and at the same time ffs_epfile_release get called from userspace. ffs_epfile_release will free up the read buffer and call ffs_data_closed which in turn destroys ffs->epfiles and mark it as NULL. While this was happening the driver has already initialized the local epfile in ffs_func_eps_disable which is now freed and waiting to acquire the spinlock. Once spinlock is acquired the driver proceeds with the stale value of epfile and tries to free the already freed read buffer causing use-after-free. Following is the illustration of the race: CPU1 CPU2 ffs_func_eps_disable epfiles (local copy) ffs_epfile_release ffs_data_closed if (last file closed) ffs_data_reset ffs_data_clear ffs_epfiles_destroy spin_lock dereference epfiles Fix this races by taking epfiles local copy & assigning it under spinlock and if epfiles(local) is null then update it in ffs->epfiles then finally destroy it. Extending the scope further from the race, protecting the ep related structures, and concurrent accesses. Fixes: a9e6f83c2df1 ("usb: gadget: f_fs: stop sleeping in ffs_func_eps_disa= ble") Co-developed-by: Udipto Goswami Reviewed-by: John Keeping Signed-off-by: Pratham Pratap Signed-off-by: Udipto Goswami Link: https://lore.kernel.org/r/1643256595-10797-1-git-send-email-quic_ugos= wami@quicinc.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/gadget/function/f_fs.c | 56 ++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/functi= on/f_fs.c index 61795025f11b6..13a38ed806df9 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1626,16 +1626,24 @@ static void ffs_data_put(struct ffs_data *ffs) =20 static void ffs_data_closed(struct ffs_data *ffs) { + struct ffs_epfile *epfiles; + unsigned long flags; + ENTER(); =20 if (atomic_dec_and_test(&ffs->opened)) { if (ffs->no_disconnect) { ffs->state =3D FFS_DEACTIVATED; - if (ffs->epfiles) { - ffs_epfiles_destroy(ffs->epfiles, - ffs->eps_count); - ffs->epfiles =3D NULL; - } + spin_lock_irqsave(&ffs->eps_lock, flags); + epfiles =3D ffs->epfiles; + ffs->epfiles =3D NULL; + spin_unlock_irqrestore(&ffs->eps_lock, + flags); + + if (epfiles) + ffs_epfiles_destroy(epfiles, + ffs->eps_count); + if (ffs->setup_state =3D=3D FFS_SETUP_PENDING) __ffs_ep0_stall(ffs); } else { @@ -1682,14 +1690,27 @@ static struct ffs_data *ffs_data_new(const char *de= v_name) =20 static void ffs_data_clear(struct ffs_data *ffs) { + struct ffs_epfile *epfiles; + unsigned long flags; + ENTER(); =20 ffs_closed(ffs); =20 BUG_ON(ffs->gadget); =20 - if (ffs->epfiles) { - ffs_epfiles_destroy(ffs->epfiles, ffs->eps_count); + spin_lock_irqsave(&ffs->eps_lock, flags); + epfiles =3D ffs->epfiles; + ffs->epfiles =3D NULL; + spin_unlock_irqrestore(&ffs->eps_lock, flags); + + /* + * potential race possible between ffs_func_eps_disable + * & ffs_epfile_release therefore maintaining a local + * copy of epfile will save us from use-after-free. + */ + if (epfiles) { + ffs_epfiles_destroy(epfiles, ffs->eps_count); ffs->epfiles =3D NULL; } =20 @@ -1837,12 +1858,15 @@ static void ffs_epfiles_destroy(struct ffs_epfile *= epfiles, unsigned count) =20 static void ffs_func_eps_disable(struct ffs_function *func) { - struct ffs_ep *ep =3D func->eps; - struct ffs_epfile *epfile =3D func->ffs->epfiles; - unsigned count =3D func->ffs->eps_count; + struct ffs_ep *ep; + struct ffs_epfile *epfile; + unsigned short count; unsigned long flags; =20 spin_lock_irqsave(&func->ffs->eps_lock, flags); + count =3D func->ffs->eps_count; + epfile =3D func->ffs->epfiles; + ep =3D func->eps; while (count--) { /* pending requests get nuked */ if (likely(ep->ep)) @@ -1860,14 +1884,18 @@ static void ffs_func_eps_disable(struct ffs_functio= n *func) =20 static int ffs_func_eps_enable(struct ffs_function *func) { - struct ffs_data *ffs =3D func->ffs; - struct ffs_ep *ep =3D func->eps; - struct ffs_epfile *epfile =3D ffs->epfiles; - unsigned count =3D ffs->eps_count; + struct ffs_data *ffs; + struct ffs_ep *ep; + struct ffs_epfile *epfile; + unsigned short count; unsigned long flags; int ret =3D 0; =20 spin_lock_irqsave(&func->ffs->eps_lock, flags); + ffs =3D func->ffs; + ep =3D func->eps; + epfile =3D ffs->epfiles; + count =3D ffs->eps_count; while(count--) { ep->ep->driver_data =3D ep; =20 --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CE35C433EF for ; Mon, 14 Feb 2022 09:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243320AbiBNJcR (ORCPT ); Mon, 14 Feb 2022 04:32:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243533AbiBNJcA (ORCPT ); Mon, 14 Feb 2022 04:32:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA941AD9F; Mon, 14 Feb 2022 01:30:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B7D2160F8D; Mon, 14 Feb 2022 09:30:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98830C340F2; Mon, 14 Feb 2022 09:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831038; bh=l0212FSHtUxE+34kUIAZLJhq/HpoQd/R+RJu5Jxqgx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CM786ksiRBjsaKxlLQvQ9A9ukZRnc6OJRTgK2DM9WZE+sy3caz813ozoXpGSYeRX0 x/XNqgbDVBw4wyEW3m2s3L42angpeo55sW1kTt5YfeAyY+GQncyizdEMz/I7m25uoH uFOTsrBnWb/Mmsi3YQyhpzeMrOelOiduKqZdQ8cM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mahesh Bandewar , Jay Vosburgh , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 23/44] bonding: pair enable_port with slave_arr_updates Date: Mon, 14 Feb 2022 10:25:46 +0100 Message-Id: <20220214092448.662740295@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mahesh Bandewar [ Upstream commit 23de0d7b6f0e3f9a6283a882594c479949da1120 ] When 803.2ad mode enables a participating port, it should update the slave-array. I have observed that the member links are participating and are part of the active aggregator while the traffic is egressing via only one member link (in a case where two links are participating). Via kprobes I discovered that slave-arr has only one link added while the other participating link wasn't part of the slave-arr. I couldn't see what caused that situation but the simple code-walk through provided me hints that the enable_port wasn't always associated with the slave-array update. Fixes: ee6377147409 ("bonding: Simplify the xmit function for modes that us= e xmit_hash") Signed-off-by: Mahesh Bandewar Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/20220207222901.1795287-1-maheshb@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/net/bonding/bond_3ad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 93dfcef8afc4b..035923876c617 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -1012,8 +1012,8 @@ static void ad_mux_machine(struct port *port, bool *u= pdate_slave_arr) if (port->aggregator && port->aggregator->is_active && !__port_is_enabled(port)) { - __enable_port(port); + *update_slave_arr =3D true; } } break; @@ -1760,6 +1760,7 @@ static void ad_agg_selection_logic(struct aggregator = *agg, port =3D port->next_port_in_aggregator) { __enable_port(port); } + *update_slave_arr =3D true; } } =20 --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93581C433FE for ; Mon, 14 Feb 2022 09:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243640AbiBNJcW (ORCPT ); Mon, 14 Feb 2022 04:32:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243592AbiBNJcA (ORCPT ); Mon, 14 Feb 2022 04:32:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28DB21AD89; Mon, 14 Feb 2022 01:30:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DD1BEB80DC6; Mon, 14 Feb 2022 09:30:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 058B7C340F0; Mon, 14 Feb 2022 09:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831041; bh=5c1KH+od5zW6GUt0v2I0263ztt7h/XKAC8j9FwaW+f4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GEmbcWneCzfPL6p39Y8K4LZTU3UGH4umQW1XsEMSokJaj+OEaRkXwolf9x22o4SJR 56NQ5qY50k/X4GlvuIX4pc8Iw2Vny6ycmiDHdViCweluVGGmV8um+JwpavsNRRlnxh YOWyBE7dBcCP1UxwqaY2KzVoQBrsRCn9utJ7FtQA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Cong Wang , syzbot , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 24/44] ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path Date: Mon, 14 Feb 2022 10:25:47 +0100 Message-Id: <20220214092448.693863686@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Eric Dumazet [ Upstream commit 5611a00697c8ecc5aad04392bea629e9d6a20463 ] ip[6]mr_free_table() can only be called under RTNL lock. RTNL: assertion failed at net/core/dev.c (10367) WARNING: CPU: 1 PID: 5890 at net/core/dev.c:10367 unregister_netdevice_many= +0x1246/0x1850 net/core/dev.c:10367 Modules linked in: CPU: 1 PID: 5890 Comm: syz-executor.2 Not tainted 5.16.0-syzkaller-11627-g4= 22ee58dc0ef #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Goo= gle 01/01/2011 RIP: 0010:unregister_netdevice_many+0x1246/0x1850 net/core/dev.c:10367 Code: 0f 85 9b ee ff ff e8 69 07 4b fa ba 7f 28 00 00 48 c7 c6 00 90 ae 8a = 48 c7 c7 40 90 ae 8a c6 05 6d b1 51 06 01 e8 8c 90 d8 01 <0f> 0b e9 70 ee f= f ff e8 3e 07 4b fa 4c 89 e7 e8 86 2a 59 fa e9 ee RSP: 0018:ffffc900046ff6e0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888050f51d00 RSI: ffffffff815fa008 RDI: fffff520008dfece RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815f3d6e R11: 0000000000000000 R12: 00000000fffffff4 R13: dffffc0000000000 R14: ffffc900046ff750 R15: ffff88807b7dc000 FS: 00007f4ab736e700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fee0b4f8990 CR3: 000000001e7d2000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mroute_clean_tables+0x244/0xb40 net/ipv6/ip6mr.c:1509 ip6mr_free_table net/ipv6/ip6mr.c:389 [inline] ip6mr_rules_init net/ipv6/ip6mr.c:246 [inline] ip6mr_net_init net/ipv6/ip6mr.c:1306 [inline] ip6mr_net_init+0x3f0/0x4e0 net/ipv6/ip6mr.c:1298 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x54f/0xbb0 net/core/net_namespace.c:331 copy_net_ns+0x318/0x760 net/core/net_namespace.c:475 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178 copy_process+0x2e0c/0x7300 kernel/fork.c:2167 kernel_clone+0xe7/0xab0 kernel/fork.c:2555 __do_sys_clone+0xc8/0x110 kernel/fork.c:2672 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f4ab89f9059 Code: Unable to access opcode bytes at RIP 0x7f4ab89f902f. RSP: 002b:00007f4ab736e118 EFLAGS: 00000206 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007f4ab8b0bf60 RCX: 00007f4ab89f9059 RDX: 0000000020000280 RSI: 0000000020000270 RDI: 0000000040200000 RBP: 00007f4ab8a5308d R08: 0000000020000300 R09: 0000000020000300 R10: 00000000200002c0 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffc3977cc1f R14: 00007f4ab736e300 R15: 0000000000022000 Fixes: f243e5a7859a ("ipmr,ip6mr: call ip6mr_free_table() on failure path") Signed-off-by: Eric Dumazet Cc: Cong Wang Reported-by: syzbot Link: https://lore.kernel.org/r/20220208053451.2885398-1-eric.dumazet@gmail= .com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- net/ipv4/ipmr.c | 2 ++ net/ipv6/ip6mr.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index ce3d5f734fdb1..0a68020d1de1b 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -248,7 +248,9 @@ static int __net_init ipmr_rules_init(struct net *net) return 0; =20 err2: + rtnl_lock(); ipmr_free_table(mrt); + rtnl_unlock(); err1: fib_rules_unregister(ops); return err; diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 459f282d90e16..f8d60d511d3ed 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -252,7 +252,9 @@ static int __net_init ip6mr_rules_init(struct net *net) return 0; =20 err2: + rtnl_lock(); ip6mr_free_table(mrt); + rtnl_unlock(); err1: fib_rules_unregister(ops); return err; --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35F9FC433FE for ; Mon, 14 Feb 2022 09:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243519AbiBNJcf (ORCPT ); Mon, 14 Feb 2022 04:32:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242948AbiBNJcA (ORCPT ); Mon, 14 Feb 2022 04:32:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32B81AD88; Mon, 14 Feb 2022 01:30:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8849260F8F; Mon, 14 Feb 2022 09:30:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47A37C340E9; Mon, 14 Feb 2022 09:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831045; bh=iWIBNLBJO5CJdZKiHtFwcviHl/A29NlmVmJ+y4S9YPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NVjST7WT1Hnl9zydBskqyYXGmt5Aq/epCiHkjRyHi9CiWvtbYAk+HD+Yo0aiwJKGF SetvrqrHDNgqjfOm94RYcI3SjFMfgHRui4dsTfZp83hn8hkRF5AXmuUUiY+aHHkgvE aKp4Oh1U2yX/JO2VQzPmH5wFr+Cq7f0AVJcFHFK0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Vlad Buslov , Antoine Tenart , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 25/44] net: do not keep the dst cache when uncloning an skb dst and its metadata Date: Mon, 14 Feb 2022 10:25:48 +0100 Message-Id: <20220214092448.724623719@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Antoine Tenart [ Upstream commit cfc56f85e72f5b9c5c5be26dc2b16518d36a7868 ] When uncloning an skb dst and its associated metadata a new dst+metadata is allocated and the tunnel information from the old metadata is copied over there. The issue is the tunnel metadata has references to cached dst, which are copied along the way. When a dst+metadata refcount drops to 0 the metadata is freed including the cached dst entries. As they are also referenced in the initial dst+metadata, this ends up in UaFs. In practice the above did not happen because of another issue, the dst+metadata was never freed because its refcount never dropped to 0 (this will be fixed in a subsequent patch). Fix this by initializing the dst cache after copying the tunnel information from the old metadata to also unshare the dst cache. Fixes: d71785ffc7e7 ("net: add dst_cache to ovs vxlan lwtunnel") Cc: Paolo Abeni Reported-by: Vlad Buslov Tested-by: Vlad Buslov Signed-off-by: Antoine Tenart Acked-by: Paolo Abeni Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- include/net/dst_metadata.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h index 0b3c2aaed3c82..bf820c54e7ccd 100644 --- a/include/net/dst_metadata.h +++ b/include/net/dst_metadata.h @@ -121,6 +121,19 @@ static inline struct metadata_dst *tun_dst_unclone(str= uct sk_buff *skb) =20 memcpy(&new_md->u.tun_info, &md_dst->u.tun_info, sizeof(struct ip_tunnel_info) + md_size); +#ifdef CONFIG_DST_CACHE + /* Unclone the dst cache if there is one */ + if (new_md->u.tun_info.dst_cache.cache) { + int ret; + + ret =3D dst_cache_init(&new_md->u.tun_info.dst_cache, GFP_ATOMIC); + if (ret) { + metadata_dst_free(new_md); + return ERR_PTR(ret); + } + } +#endif + skb_dst_drop(skb); dst_hold(&new_md->dst); skb_dst_set(skb, &new_md->dst); --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EE41C433F5 for ; Mon, 14 Feb 2022 09:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243743AbiBNJcb (ORCPT ); Mon, 14 Feb 2022 04:32:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243293AbiBNJcB (ORCPT ); Mon, 14 Feb 2022 04:32:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A05B81ADA5; Mon, 14 Feb 2022 01:30:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D22EB80DC4; Mon, 14 Feb 2022 09:30:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7101FC340E9; Mon, 14 Feb 2022 09:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831048; bh=qH5C2MIZZSUsnft6+Hfq14w5C40qpkh3d9Peu90YZeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0bYNEwJeOpbuGN1sY/NpDATz8+9TG/duQzlbv4AooQATajh4LzDsqTLLvnhwepMgW tL0qBNIp6tphzu/+Z7DvQf8svo6Uk5bpu9BVNFPkQsXJ/6YkaOQzw5KojMsMqJcOxo kPx36eOizWDdFv3QNsrPPjZGsO7nYzdSdAsNLgIs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pravin B Shelar , Vlad Buslov , Antoine Tenart , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 26/44] net: fix a memleak when uncloning an skb dst and its metadata Date: Mon, 14 Feb 2022 10:25:49 +0100 Message-Id: <20220214092448.756130347@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Antoine Tenart [ Upstream commit 9eeabdf17fa0ab75381045c867c370f4cc75a613 ] When uncloning an skb dst and its associated metadata, a new dst+metadata is allocated and later replaces the old one in the skb. This is helpful to have a non-shared dst+metadata attached to a specific skb. The issue is the uncloned dst+metadata is initialized with a refcount of 1, which is increased to 2 before attaching it to the skb. When tun_dst_unclone returns, the dst+metadata is only referenced from a single place (the skb) while its refcount is 2. Its refcount will never drop to 0 (when the skb is consumed), leading to a memory leak. Fix this by removing the call to dst_hold in tun_dst_unclone, as the dst+metadata refcount is already 1. Fixes: fc4099f17240 ("openvswitch: Fix egress tunnel info.") Cc: Pravin B Shelar Reported-by: Vlad Buslov Tested-by: Vlad Buslov Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- include/net/dst_metadata.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h index bf820c54e7ccd..177b1aabf95d1 100644 --- a/include/net/dst_metadata.h +++ b/include/net/dst_metadata.h @@ -135,7 +135,6 @@ static inline struct metadata_dst *tun_dst_unclone(stru= ct sk_buff *skb) #endif =20 skb_dst_drop(skb); - dst_hold(&new_md->dst); skb_dst_set(skb, &new_md->dst); return new_md; } --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB7C1C433F5 for ; Mon, 14 Feb 2022 09:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243724AbiBNJc0 (ORCPT ); Mon, 14 Feb 2022 04:32:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243294AbiBNJcB (ORCPT ); Mon, 14 Feb 2022 04:32:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD8581ADA6; Mon, 14 Feb 2022 01:30:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6D44BB80DC4; Mon, 14 Feb 2022 09:30:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84EA6C340EF; Mon, 14 Feb 2022 09:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831051; bh=LJ1sXuZ/bCb8N5WhK7UxNrm625DKnrhrSRqj0JPsg+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzQaeVT4efsCbJ7f0P3kLR51vhOH4s8vqqsuqLQpcnzLUrLjIG9MBtFD9MRV3dgYY xbf7pJhbesVt/QoyTm6hAZrJOU+6K/HiFs8kpAXZjQnJyq8zx4ySq+dBs6cXyg1OY7 8vbBdFsex7+yAZbumR97/S2teLoBe74v/oN1AWxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Maloy , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 27/44] tipc: rate limit warning for received illegal binding update Date: Mon, 14 Feb 2022 10:25:50 +0100 Message-Id: <20220214092448.789538927@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jon Maloy [ Upstream commit c7223d687758462826a20e9735305d55bb874c70 ] It would be easy to craft a message containing an illegal binding table update operation. This is handled correctly by the code, but the corresponding warning printout is not rate limited as is should be. We fix this now. Fixes: b97bf3fd8f6a ("[TIPC] Initial merge") Signed-off-by: Jon Maloy Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- net/tipc/name_distr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 7ebcaff8c1c4f..963f607b34999 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -288,7 +288,7 @@ static bool tipc_update_nametbl(struct net *net, struct= distr_item *i, return true; } } else { - pr_warn("Unrecognized name table message received\n"); + pr_warn_ratelimited("Unknown name table message received\n"); } return false; } --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE086C433F5 for ; Mon, 14 Feb 2022 09:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243756AbiBNJcm (ORCPT ); Mon, 14 Feb 2022 04:32:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243613AbiBNJcB (ORCPT ); Mon, 14 Feb 2022 04:32:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34CCA1ADB1; Mon, 14 Feb 2022 01:30:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E1F09B80DC6; Mon, 14 Feb 2022 09:30:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7CB9C340E9; Mon, 14 Feb 2022 09:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831054; bh=LGnMrv8zyFJ9Jznd8mvnS6QMJ59LaXA+jxgRSmNbVW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O0/gZ2xoSvi0VG1Tv4qhtEM7cyMsrGQYTHVRJpnpTsOxSH9bHfzXd7geu0BKsUvww CCLFtgsbgwAZ13RnZrI1EnKAn8PGbM3PjURb9J74a2GMDg+QMmFz3JA8DdwYEaOhb8 rUqb7REla9MlohPjup7YSo0kCOBqOtajqCuvJkwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Selwin Sebastian , Raju Rangoju , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 28/44] net: amd-xgbe: disable interrupts during pci removal Date: Mon, 14 Feb 2022 10:25:51 +0100 Message-Id: <20220214092448.821089086@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Raju Rangoju [ Upstream commit 68c2d6af1f1e469544d6cbe9a601d96fb9c00e7f ] Hardware interrupts are enabled during the pci probe, however, they are not disabled during pci removal. Disable all hardware interrupts during pci removal to avoid any issues. Fixes: e75377404726 ("amd-xgbe: Update PCI support to use new IRQ functions= ") Suggested-by: Selwin Sebastian Signed-off-by: Raju Rangoju Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c b/drivers/net/etherne= t/amd/xgbe/xgbe-pci.c index 82d1f416ee2ac..569e6d3d066bf 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c @@ -400,6 +400,9 @@ static void xgbe_pci_remove(struct pci_dev *pdev) =20 pci_free_irq_vectors(pdata->pcidev); =20 + /* Disable all interrupts in the hardware */ + XP_IOWRITE(pdata, XP_INT_EN, 0x0); + xgbe_free_pdata(pdata); } =20 --=20 2.34.1 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A54F2C433EF for ; Mon, 14 Feb 2022 09:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243596AbiBNJco (ORCPT ); Mon, 14 Feb 2022 04:32:44 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243615AbiBNJcB (ORCPT ); Mon, 14 Feb 2022 04:32:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8631D1ADB5; Mon, 14 Feb 2022 01:30:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2356E60C8A; Mon, 14 Feb 2022 09:30:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1A96C340EF; Mon, 14 Feb 2022 09:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831057; bh=oot8H8SG+fLifHmlvEmUgAK75vhWQy+DzZGm3AcsJhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=brGMhA3URKhtYCWmy+cgLbsopHaIi1BK87UXjP/AqN9v9eCqnRusZ/9WnGqMqg1g4 BwfPpYD0u9tpHgsUCcikJUKsRhDe4sv/SpEXxB8eDrs5nf/62vokkRgpEeimeJYU76 T7gvWI+LjBzxRpr5ylTAF9KbeIrSFI9HbVx6jpmw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Johannesmeyer , Jakob Koschel Subject: [PATCH 4.14 29/44] vt_ioctl: fix array_index_nospec in vt_setactivate Date: Mon, 14 Feb 2022 10:25:52 +0100 Message-Id: <20220214092448.854594545@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jakob Koschel commit 61cc70d9e8ef5b042d4ed87994d20100ec8896d9 upstream. array_index_nospec ensures that an out-of-bounds value is set to zero on the transient path. Decreasing the value by one afterwards causes a transient integer underflow. vsa.console should be decreased first and then sanitized with array_index_nospec. Kasper Acknowledgements: Jakob Koschel, Brian Johannesmeyer, Kaveh Razavi, Herbert Bos, Cristiano Giuffrida from the VUSec group at VU Amsterdam. Co-developed-by: Brian Johannesmeyer Signed-off-by: Brian Johannesmeyer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220127144406.3589293-1-jakobkoschel@gmail= .com Cc: stable Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/tty/vt/vt_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/tty/vt/vt_ioctl.c +++ b/drivers/tty/vt/vt_ioctl.c @@ -715,9 +715,9 @@ int vt_ioctl(struct tty_struct *tty, if (vsa.console =3D=3D 0 || vsa.console > MAX_NR_CONSOLES) ret =3D -ENXIO; else { - vsa.console =3D array_index_nospec(vsa.console, - MAX_NR_CONSOLES + 1); vsa.console--; + vsa.console =3D array_index_nospec(vsa.console, + MAX_NR_CONSOLES); console_lock(); ret =3D vc_allocate(vsa.console); if (ret =3D=3D 0) { From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64D9CC433EF for ; Mon, 14 Feb 2022 09:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243801AbiBNJcw (ORCPT ); Mon, 14 Feb 2022 04:32:52 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243585AbiBNJcL (ORCPT ); Mon, 14 Feb 2022 04:32:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B59E660A9C; Mon, 14 Feb 2022 01:31:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 61559B80DC7; Mon, 14 Feb 2022 09:31:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73FF1C340E9; Mon, 14 Feb 2022 09:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831064; bh=M/5dKUxzJXnKgyxX5TYZlhdq53UpEzROZzEaWXAB0Dc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gX23ZAx2k5YYQaShxNrWYYcagKZjveESIdp+t8SW4cgFPFVutO1IHsAxYtL/qpDg3 YkqDVuE/G5VvE/jW2QxZV4Ld0DffBDms9dMsObRIoluvLC0qV2l8j86XJ8AjWcbXYT XBjUIW4CJ/VJE4/ymkvzWy7uFFAUcBJ16rl1kpXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Johannesmeyer , Jakob Koschel Subject: [PATCH 4.14 30/44] vt_ioctl: add array_index_nospec to VT_ACTIVATE Date: Mon, 14 Feb 2022 10:25:53 +0100 Message-Id: <20220214092448.884698830@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jakob Koschel commit 28cb138f559f8c1a1395f5564f86b8bbee83631b upstream. in vt_setactivate an almost identical code path has been patched with array_index_nospec. In the VT_ACTIVATE path the user input is from a system call argument instead of a usercopy. For consistency both code paths should have the same mitigations applied. Kasper Acknowledgements: Jakob Koschel, Brian Johannesmeyer, Kaveh Razavi, Herbert Bos, Cristiano Giuffrida from the VUSec group at VU Amsterdam. Co-developed-by: Brian Johannesmeyer Signed-off-by: Brian Johannesmeyer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220127144406.3589293-2-jakobkoschel@gmail= .com Cc: stable Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/tty/vt/vt_ioctl.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/tty/vt/vt_ioctl.c +++ b/drivers/tty/vt/vt_ioctl.c @@ -691,6 +691,7 @@ int vt_ioctl(struct tty_struct *tty, ret =3D -ENXIO; else { arg--; + arg =3D array_index_nospec(arg, MAX_NR_CONSOLES); console_lock(); ret =3D vc_allocate(arg); console_unlock(); From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E3BEC433F5 for ; Mon, 14 Feb 2022 09:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244043AbiBNJeY (ORCPT ); Mon, 14 Feb 2022 04:34:24 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233486AbiBNJdo (ORCPT ); Mon, 14 Feb 2022 04:33:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D9B1ADA9; Mon, 14 Feb 2022 01:32:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3D1B4B80DC1; Mon, 14 Feb 2022 09:32:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 694E6C340E9; Mon, 14 Feb 2022 09:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831132; bh=WVAeUqgrH/pNsmuq3GgGhWwHLzCf/geaD98MM19BHyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJ7ntrP/sWcp8otYd0p3nIo+/nEaGQTFpLgGrd2aI/KFBbnEkGxYNCSVZIkyVf//r r0v84rrb4XGCL4BN+cRmK6jZtfxNLudX2QCzLfQ13VqDMqmNXNXq1ViH5VReAQGtZ3 WKqTfmI8tlHjLs/3OOBUMpDhdWqk+YitElFmhRbY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kosuke Tatsukawa Subject: [PATCH 4.14 31/44] n_tty: wake up poll(POLLRDNORM) on receiving data Date: Mon, 14 Feb 2022 10:25:54 +0100 Message-Id: <20220214092448.919319254@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: TATSUKAWA KOSUKE (=E7=AB=8B=E5=B7=9D =E6=B1=9F=E4=BB=8B) commit c816b2e65b0e86b95011418cad334f0524fc33b8 upstream. The poll man page says POLLRDNORM is equivalent to POLLIN when used as an event. $ man poll POLLRDNORM Equivalent to POLLIN. However, in n_tty driver, POLLRDNORM does not return until timeout even if there is terminal input, whereas POLLIN returns. The following test program works until kernel-3.17, but the test stops in poll() after commit 57087d515441 ("tty: Fix spurious poll() wakeups"). [Steps to run test program] $ cc -o test-pollrdnorm test-pollrdnorm.c $ ./test-pollrdnorm foo <-- Type in something from the terminal followed by [RET]. The string should be echoed back. ------------------------< test-pollrdnorm.c >------------------------ #include #include #include #include void main(void) { int n; unsigned char buf[8]; struct pollfd fds[1] =3D {{ 0, POLLRDNORM, 0 }}; n =3D poll(fds, 1, -1); if (n < 0) perror("poll"); n =3D read(0, buf, 8); if (n < 0) perror("read"); if (n > 0) write(1, buf, n); } ------------------------------------------------------------------------ The attached patch fixes this problem. Many calls to wake_up_interruptible_poll() in the kernel source code already specify "POLLIN | POLLRDNORM". Fixes: 57087d515441 ("tty: Fix spurious poll() wakeups") Cc: stable@vger.kernel.org Signed-off-by: Kosuke Tatsukawa Link: https://lore.kernel.org/r/TYCPR01MB81901C0F932203D30E452B3EA5209@TYCP= R01MB8190.jpnprd01.prod.outlook.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/tty/n_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -1377,7 +1377,7 @@ handle_newline: put_tty_queue(c, ldata); smp_store_release(&ldata->canon_head, ldata->read_head); kill_fasync(&tty->fasync, SIGIO, POLL_IN); - wake_up_interruptible_poll(&tty->read_wait, POLLIN); + wake_up_interruptible_poll(&tty->read_wait, POLLIN | POLLRDNORM); return 0; } } @@ -1658,7 +1658,7 @@ static void __receive_buf(struct tty_str =20 if (read_cnt(ldata)) { kill_fasync(&tty->fasync, SIGIO, POLL_IN); - wake_up_interruptible_poll(&tty->read_wait, POLLIN); + wake_up_interruptible_poll(&tty->read_wait, POLLIN | POLLRDNORM); } } =20 From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 242C7C433F5 for ; Mon, 14 Feb 2022 09:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243786AbiBNJda (ORCPT ); Mon, 14 Feb 2022 04:33:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243740AbiBNJc6 (ORCPT ); Mon, 14 Feb 2022 04:32:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B42A654B6; Mon, 14 Feb 2022 01:31:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3458360DFD; Mon, 14 Feb 2022 09:31:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E503DC340E9; Mon, 14 Feb 2022 09:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831089; bh=yNeV4S/hx/CrA/gyt+MVKfADNTqU4+/vMXzNu6rvsqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aBlZt3acfSLYO7GW+q3VkPSjjKbE5N+5rV6x7UF47tSQLSO9hHP4NQI7qikQHRj/U 1oyX5h6kgv9w8b9sMpibz6pTtDZ7PUXq9gku6MTfrPRUsp+VwyD4Qmw+UQ7hL7GjU2 +zeA0M/djNceBD4u5fvt2JFsz0+BY4qGALeqoFxI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus , Sean Anderson Subject: [PATCH 4.14 32/44] usb: ulpi: Move of_node_put to ulpi_dev_release Date: Mon, 14 Feb 2022 10:25:55 +0100 Message-Id: <20220214092448.949781329@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sean Anderson commit 092f45b13e51666fe8ecbf2d6cd247aa7e6c1f74 upstream. Drivers are not unbound from the device when ulpi_unregister_interface is called. Move of_node-freeing code to ulpi_dev_release which is called only after all users are gone. Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") Cc: stable Reviewed-by: Heikki Krogerus Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20220127190004.1446909-2-sean.anderson@seco= .com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/common/ulpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -135,6 +135,7 @@ static const struct attribute_group *ulp =20 static void ulpi_dev_release(struct device *dev) { + of_node_put(dev->of_node); kfree(to_ulpi_dev(dev)); } =20 @@ -303,7 +304,6 @@ EXPORT_SYMBOL_GPL(ulpi_register_interfac */ void ulpi_unregister_interface(struct ulpi *ulpi) { - of_node_put(ulpi->dev.of_node); device_unregister(&ulpi->dev); } EXPORT_SYMBOL_GPL(ulpi_unregister_interface); From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DADC1C433EF for ; Mon, 14 Feb 2022 09:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230211AbiBNJd6 (ORCPT ); Mon, 14 Feb 2022 04:33:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243633AbiBNJdZ (ORCPT ); Mon, 14 Feb 2022 04:33:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF6FCAE48; Mon, 14 Feb 2022 01:31:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8BB80B80DD1; Mon, 14 Feb 2022 09:31:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6146C340E9; Mon, 14 Feb 2022 09:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831105; bh=sjzPQJ4NRhqLJBSxXcRylQRoO81qn0Tb+LLValorUhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zfxjdOOccVhIc+EM3Cte1nebIcjAkw++zL55XkfqoWetN5kPoIZxo6FCE5soK6R+w o6Us5Xw2QL/JiX52q1EgZqR51HBLCY3HXnyvT6okDaFZ5AMyxh9OJwPrpINPGqwyB7 4Qmehca4hsO8rkMzSOVEHXAdkOpVsmfgNBEUiHqM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus , Sean Anderson Subject: [PATCH 4.14 33/44] usb: ulpi: Call of_node_put correctly Date: Mon, 14 Feb 2022 10:25:56 +0100 Message-Id: <20220214092448.980656771@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sean Anderson commit 0a907ee9d95e3ac35eb023d71f29eae0aaa52d1b upstream. of_node_put should always be called on device nodes gotten from of_get_*. Additionally, it should only be called after there are no remaining users. To address the first issue, call of_node_put if later steps in ulpi_register fail. To address the latter, call put_device if device_register fails, which will call ulpi_dev_release if necessary. Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") Cc: stable Reviewed-by: Heikki Krogerus Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20220127190004.1446909-3-sean.anderson@seco= .com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/common/ulpi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -252,12 +252,16 @@ static int ulpi_register(struct device * return ret; =20 ret =3D ulpi_read_id(ulpi); - if (ret) + if (ret) { + of_node_put(ulpi->dev.of_node); return ret; + } =20 ret =3D device_register(&ulpi->dev); - if (ret) + if (ret) { + put_device(&ulpi->dev); return ret; + } =20 dev_dbg(&ulpi->dev, "registered ULPI PHY: vendor %04x, product %04x\n", ulpi->id.vendor, ulpi->id.product); From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25F95C433EF for ; Mon, 14 Feb 2022 09:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243928AbiBNJeB (ORCPT ); Mon, 14 Feb 2022 04:34:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243812AbiBNJdZ (ORCPT ); Mon, 14 Feb 2022 04:33:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F509BF6D; Mon, 14 Feb 2022 01:31:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C3E42B80DD1; Mon, 14 Feb 2022 09:31:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7B2FC340E9; Mon, 14 Feb 2022 09:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831108; bh=am5yNQtyIYQDH+bydUQ02sPjeH53/Ufx0EW0u8104+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eNjwSNQgPcfQK0GBYu0Ph1UXXsn3CoNd0Vp47mIVrw31MYjoyEYhMLsub/fzhcR/m E8ALV95eP98XLeSE3TxZ/tUhXwuEnecmOqpvTlo30xom4HN02WeObcmDw16QUaQAia rbsJqBaZ83hHlLLm9GsW1++yOBuYL1Dm1GWtL8qM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavankumar Kondeti , Udipto Goswami Subject: [PATCH 4.14 34/44] usb: dwc3: gadget: Prevent core from processing stale TRBs Date: Mon, 14 Feb 2022 10:25:57 +0100 Message-Id: <20220214092449.011455274@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Udipto Goswami commit 117b4e96c7f362eb6459543883fc07f77662472c upstream. With CPU re-ordering on write instructions, there might be a chance that the HWO is set before the TRB is updated with the new mapped buffer address. And in the case where core is processing a list of TRBs it is possible that it fetched the TRBs when the HWO is set but before the buffer address is updated. Prevent this by adding a memory barrier before the HWO is updated to ensure that the core always process the updated TRBs. Fixes: f6bafc6a1c9d ("usb: dwc3: convert TRBs into bitshifts") Cc: stable Reviewed-by: Pavankumar Kondeti Signed-off-by: Udipto Goswami Link: https://lore.kernel.org/r/1644207958-18287-1-git-send-email-quic_ugos= wami@quicinc.com Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/dwc3/gadget.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1004,6 +1004,19 @@ static void __dwc3_prepare_one_trb(struc if (usb_endpoint_xfer_bulk(dep->endpoint.desc) && dep->stream_capable) trb->ctrl |=3D DWC3_TRB_CTRL_SID_SOFN(stream_id); =20 + /* + * As per data book 4.2.3.2TRB Control Bit Rules section + * + * The controller autonomously checks the HWO field of a TRB to determine= if the + * entire TRB is valid. Therefore, software must ensure that the rest of = the TRB + * is valid before setting the HWO field to '1'. In most systems, this me= ans that + * software must update the fourth DWORD of a TRB last. + * + * However there is a possibility of CPU re-ordering here which can cause + * controller to observe the HWO bit set prematurely. + * Add a write memory barrier to prevent CPU re-ordering. + */ + wmb(); trb->ctrl |=3D DWC3_TRB_CTRL_HWO; =20 dwc3_ep_inc_enq(dep); From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D269C433EF for ; Mon, 14 Feb 2022 09:33:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243811AbiBNJeE (ORCPT ); Mon, 14 Feb 2022 04:34:04 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243637AbiBNJdZ (ORCPT ); Mon, 14 Feb 2022 04:33:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DFCAE51; Mon, 14 Feb 2022 01:31:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 29D56B80DCA; Mon, 14 Feb 2022 09:31:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2960EC340E9; Mon, 14 Feb 2022 09:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831112; bh=PlUT2RePeY30xtamiW/pQwZCCreOuj7JuuL7sC9vnh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L/hAMiRH4QbYtA4fw2j5JBigVi4sg7BrnXsgRMqCdPgM48XBPqA3bYyqRmiqyZeqT nti1yi6XqNkoSQketnZblxe2FZCiJ4CMM2JJx16rsrhRJxzXta0BCisR/HYykjyDfU I7vmuXHOHjyfycfO3ScqgqDA62AQuDWpSRlshUSk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Szymon Heidrich , stable@kernel.org Subject: [PATCH 4.14 35/44] USB: gadget: validate interface OS descriptor requests Date: Mon, 14 Feb 2022 10:25:58 +0100 Message-Id: <20220214092449.044654543@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Szymon Heidrich commit 75e5b4849b81e19e9efe1654b30d7f3151c33c2c upstream. Stall the control endpoint in case provided index exceeds array size of MAX_CONFIG_INTERFACES or when the retrieved function pointer is null. Signed-off-by: Szymon Heidrich Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/gadget/composite.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1940,6 +1940,9 @@ unknown: if (w_index !=3D 0x5 || (w_value >> 8)) break; interface =3D w_value & 0xFF; + if (interface >=3D MAX_CONFIG_INTERFACES || + !os_desc_cfg->interface[interface]) + break; buf[6] =3D w_index; if (w_length =3D=3D 0x0A) { count =3D count_ext_prop(os_desc_cfg, From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 812D4C433FE for ; Mon, 14 Feb 2022 09:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232736AbiBNJeI (ORCPT ); Mon, 14 Feb 2022 04:34:08 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243879AbiBNJdZ (ORCPT ); Mon, 14 Feb 2022 04:33:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6C4AE59; Mon, 14 Feb 2022 01:31:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C3A1060F8F; Mon, 14 Feb 2022 09:31:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2385C36AE7; Mon, 14 Feb 2022 09:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831116; bh=2gge4O5EMd2sOxc5pLIMQF4jXVkp7Vr1+Gj3J7QqJiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkXePqPYSf4ZIjuG/DT201PtpffdMMm9kaPbXwEeCpuM2fgd5evC/K5CdzkPESZPC +KlZ1nJFwFb+yky9z/9pBX2nf6zBXVayF5OwU0ZzKz+xQIR8EgBuiVUW3KznzGfQqB gbbjY2yyng0qqfV0IJqSparKOS7kBRUMXY+keLbE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Szymon Heidrich , stable@kernel.org Subject: [PATCH 4.14 36/44] usb: gadget: rndis: check size of RNDIS_MSG_SET command Date: Mon, 14 Feb 2022 10:25:59 +0100 Message-Id: <20220214092449.076117393@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Greg Kroah-Hartman commit 38ea1eac7d88072bbffb630e2b3db83ca649b826 upstream. Check the size of the RNDIS_MSG_SET command given to us before attempting to respond to an invalid message size. Reported-by: Szymon Heidrich Cc: stable@kernel.org Tested-by: Szymon Heidrich Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/gadget/function/rndis.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c @@ -640,14 +640,17 @@ static int rndis_set_response(struct rnd rndis_set_cmplt_type *resp; rndis_resp_t *r; =20 + BufLength =3D le32_to_cpu(buf->InformationBufferLength); + BufOffset =3D le32_to_cpu(buf->InformationBufferOffset); + if ((BufLength > RNDIS_MAX_TOTAL_SIZE) || + (BufOffset + 8 >=3D RNDIS_MAX_TOTAL_SIZE)) + return -EINVAL; + r =3D rndis_add_response(params, sizeof(rndis_set_cmplt_type)); if (!r) return -ENOMEM; resp =3D (rndis_set_cmplt_type *)r->buf; =20 - BufLength =3D le32_to_cpu(buf->InformationBufferLength); - BufOffset =3D le32_to_cpu(buf->InformationBufferOffset); - #ifdef VERBOSE_DEBUG pr_debug("%s: Length: %d\n", __func__, BufLength); pr_debug("%s: Offset: %d\n", __func__, BufOffset); From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8212C433EF for ; Mon, 14 Feb 2022 09:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244000AbiBNJeL (ORCPT ); Mon, 14 Feb 2022 04:34:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243834AbiBNJd0 (ORCPT ); Mon, 14 Feb 2022 04:33:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7C6FAE5E; Mon, 14 Feb 2022 01:32:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7EE91B80A0A; Mon, 14 Feb 2022 09:32:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3CA7C340E9; Mon, 14 Feb 2022 09:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831119; bh=xzeq+EGNmCaiYAud31itFAruvzeWe7Bm7g4rLQpNoro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v9Ua82wJW7PHGNdq170XkkxGo3X50ghDE/5dO2OfM6IbRCywae2e+CbxX+zObg6YZ k16RK8dfVkU6pgddhYg9SJgEZ8WNDJYto3ZuGljn3/9/goaELUrrj68TAAQITXnw9l qpjC6gx6jZqqnUb87iPmxuuKKQ37VZv6Taesx6RU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cameron Williams , Johan Hovold Subject: [PATCH 4.14 37/44] USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320 Date: Mon, 14 Feb 2022 10:26:00 +0100 Message-Id: <20220214092449.107665232@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Cameron Williams commit fbb9b194e15a63c56c5664e76ccd0e85c6100cea upstream. This patch adds support for the Brainboxes US-159, US-235 and US-320 USB-to-Serial devices. Signed-off-by: Cameron Williams Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/serial/ftdi_sio.c | 3 +++ drivers/usb/serial/ftdi_sio_ids.h | 3 +++ 2 files changed, 6 insertions(+) --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -964,6 +964,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_023_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_034_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_101_PID) }, + { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_159_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_1_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_2_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_3_PID) }, @@ -972,12 +973,14 @@ static const struct usb_device_id id_tab { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_6_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_7_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_8_PID) }, + { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_235_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_257_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_1_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_2_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_3_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_4_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_313_PID) }, + { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_320_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_324_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_1_PID) }, { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_2_PID) }, --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h @@ -1506,6 +1506,9 @@ #define BRAINBOXES_VX_023_PID 0x1003 /* VX-023 ExpressCard 1 Port RS422/4= 85 */ #define BRAINBOXES_VX_034_PID 0x1004 /* VX-034 ExpressCard 2 Port RS422/4= 85 */ #define BRAINBOXES_US_101_PID 0x1011 /* US-101 1xRS232 */ +#define BRAINBOXES_US_159_PID 0x1021 /* US-159 1xRS232 */ +#define BRAINBOXES_US_235_PID 0x1017 /* US-235 1xRS232 */ +#define BRAINBOXES_US_320_PID 0x1019 /* US-320 1xRS422/485 */ #define BRAINBOXES_US_324_PID 0x1013 /* US-324 1xRS422/485 1Mbaud */ #define BRAINBOXES_US_606_1_PID 0x2001 /* US-606 6 Port RS232 Serial Port= 1 and 2 */ #define BRAINBOXES_US_606_2_PID 0x2002 /* US-606 6 Port RS232 Serial Port= 3 and 4 */ From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 941C5C433EF for ; Mon, 14 Feb 2022 09:34:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243915AbiBNJeO (ORCPT ); Mon, 14 Feb 2022 04:34:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243902AbiBNJd1 (ORCPT ); Mon, 14 Feb 2022 04:33:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7024AE67; Mon, 14 Feb 2022 01:32:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9FCD9B80DD5; Mon, 14 Feb 2022 09:32:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3BB0C340E9; Mon, 14 Feb 2022 09:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831122; bh=n4817CO9pdbJ3ChJpjW17R3o3ihg1GkqoU+V/JWWfz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RXXgHA1sDz5q+AJIsYHXmibgNt29OI6DnIpFuFrBjb5hS2/8oNMDkae3CZoN7fEas ErqIZLs9EToeuv3W8Rlk3Q6WvI6mcawH+MKHNIQ5moYsAIPQiUg7L9HcLHUVKYFd/b JN1AA/NpUQuDXWdt9qKyj4KziyEVgvYXPHsm35iI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pawel Dembicki , Johan Hovold Subject: [PATCH 4.14 38/44] USB: serial: option: add ZTE MF286D modem Date: Mon, 14 Feb 2022 10:26:01 +0100 Message-Id: <20220214092449.138817342@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Pawel Dembicki commit d48384c7ed6c8fe4727eaa0f3048f62afd1cd715 upstream. Modem from ZTE MF286D is an Qualcomm MDM9250 based 3G/4G modem. T: Bus=3D02 Lev=3D01 Prnt=3D01 Port=3D00 Cnt=3D01 Dev#=3D 3 Spd=3D5000 Mx= Ch=3D 0 D: Ver=3D 3.00 Cls=3D00(>ifc ) Sub=3D00 Prot=3D00 MxPS=3D 9 #Cfgs=3D 1 P: Vendor=3D19d2 ProdID=3D1485 Rev=3D52.87 S: Manufacturer=3DZTE,Incorporated S: Product=3DZTE Technologies MSM S: SerialNumber=3DMF286DZTED000000 C:* #Ifs=3D 7 Cfg#=3D 1 Atr=3D80 MxPwr=3D896mA A: FirstIf#=3D 0 IfCount=3D 2 Cls=3D02(comm.) Sub=3D06 Prot=3D00 I:* If#=3D 0 Alt=3D 0 #EPs=3D 1 Cls=3D02(comm.) Sub=3D02 Prot=3Dff Driver= =3Drndis_host E: Ad=3D82(I) Atr=3D03(Int.) MxPS=3D 8 Ivl=3D32ms I:* If#=3D 1 Alt=3D 0 #EPs=3D 2 Cls=3D0a(data ) Sub=3D00 Prot=3D00 Driver= =3Drndis_host E: Ad=3D81(I) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms E: Ad=3D01(O) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms I:* If#=3D 2 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3Doption E: Ad=3D83(I) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms E: Ad=3D02(O) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms I:* If#=3D 3 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3Doption E: Ad=3D85(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D84(I) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms E: Ad=3D03(O) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms I:* If#=3D 4 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3Doption E: Ad=3D87(I) Atr=3D03(Int.) MxPS=3D 10 Ivl=3D32ms E: Ad=3D86(I) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms E: Ad=3D04(O) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms I:* If#=3D 5 Alt=3D 0 #EPs=3D 3 Cls=3Dff(vend.) Sub=3Dff Prot=3Dff Driver= =3Dqmi_wwan E: Ad=3D88(I) Atr=3D03(Int.) MxPS=3D 8 Ivl=3D32ms E: Ad=3D8e(I) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms E: Ad=3D0f(O) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms I:* If#=3D 6 Alt=3D 0 #EPs=3D 2 Cls=3Dff(vend.) Sub=3D42 Prot=3D01 Driver= =3Dusbfs E: Ad=3D05(O) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms E: Ad=3D89(I) Atr=3D02(Bulk) MxPS=3D1024 Ivl=3D0ms Signed-off-by: Pawel Dembicki Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1652,6 +1652,8 @@ static const struct usb_device_id option .driver_info =3D RSVD(2) }, { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x1476, 0xff) }, /* GosunCn Z= TE WeLink ME3630 (ECM/NCM mode) */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0x00, 0x00) = }, /* ZTE MF871A */ + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff),= /* ZTE MF286D */ + .driver_info =3D RSVD(5) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) = }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) = }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) = }, From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F298C433EF for ; Mon, 14 Feb 2022 09:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244013AbiBNJeS (ORCPT ); Mon, 14 Feb 2022 04:34:18 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243768AbiBNJd1 (ORCPT ); Mon, 14 Feb 2022 04:33:27 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE87AE6D; Mon, 14 Feb 2022 01:32:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1B9D960F87; Mon, 14 Feb 2022 09:32:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D17E0C340E9; Mon, 14 Feb 2022 09:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831125; bh=PlvEcycpV1nvF2g388FL0znRyecBtkKmN44AHTvezXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VGrJ4R3k9T7ujOkZr1SAZ7FaOMyo5ejt733EBC3ouX1Y2pWsC6VKDShVUj3eDpPWw cA17tqvDJpWGn2SIfLmQtvP6kGaYSV1a+SSQO94R7JtlhA2o2KFpUfJwxguSkJ28V9 ReOIdbxv6yLSKkJepljnQyjdMfkj+YKjAe7vTgBs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephan Brunner , Johan Hovold Subject: [PATCH 4.14 39/44] USB: serial: ch341: add support for GW Instek USB2.0-Serial devices Date: Mon, 14 Feb 2022 10:26:02 +0100 Message-Id: <20220214092449.168749199@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Stephan Brunner commit fa77ce201f7f2d823b07753575122d1ae5597fbe upstream. Programmable lab power supplies made by GW Instek, such as the GPP-2323, have a USB port exposing a serial port to control the device. Stringing the supplied Windows driver, references to the ch341 chip are found. Binding the existing ch341 driver to the VID/PID of the GPP-2323 ("GW Instek USB2.0-Serial" as per the USB product name) works out of the box, communication and control is now possible. This patch should work with any GPP series power supply due to similarities in the product line. Signed-off-by: Stephan Brunner Link: https://lore.kernel.org/r/4a47b864-0816-6f6a-efee-aa20e74bcdc6@stepha= n-brunner.net Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/serial/ch341.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -87,6 +87,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x1a86, 0x5523) }, { USB_DEVICE(0x1a86, 0x7522) }, { USB_DEVICE(0x1a86, 0x7523) }, + { USB_DEVICE(0x2184, 0x0057) }, { USB_DEVICE(0x4348, 0x5523) }, { USB_DEVICE(0x9986, 0x7523) }, { }, From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2314C433F5 for ; Mon, 14 Feb 2022 09:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243780AbiBNJeV (ORCPT ); Mon, 14 Feb 2022 04:34:21 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243936AbiBNJd2 (ORCPT ); Mon, 14 Feb 2022 04:33:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64962BF7C; Mon, 14 Feb 2022 01:32:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 21A72B80DC9; Mon, 14 Feb 2022 09:32:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 327F1C340F1; Mon, 14 Feb 2022 09:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831128; bh=RA1ihH4o+p/0O+GwVfq3zFPzcw3UMJyaeNiAp/qhKdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ELVWXbqfUo+yCFB7FeTC0ew7oyBK3FQq5hy2JNnl3+9vwSXe10L0XFaEvuPp2+VQV fxkuC+QCpxs8Kw1INGRsk+q31cMWCo4EgUksffUiPyi1SPJxKGr/DnqKOPcMtNrkZc C//BNOQ1PhZMl5IkfN8/JhyZKuB50BPkByqi7KzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Russell , Johan Hovold Subject: [PATCH 4.14 40/44] USB: serial: cp210x: add NCR Retail IO box id Date: Mon, 14 Feb 2022 10:26:03 +0100 Message-Id: <20220214092449.199474522@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Johan Hovold commit b50f8f09c622297d3cf46e332e17ba8adedec9af upstream. Add the device id for NCR's Retail IO box (CP2105) used in NCR FastLane SelfServ Checkout - R6C: https://www.ncr.com/product-catalog/ncr-fastlane-selfserv-checkout-r6c Reported-by: Scott Russell Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -55,6 +55,7 @@ static int cp210x_port_remove(struct usb static void cp210x_dtr_rts(struct usb_serial_port *p, int on); =20 static const struct usb_device_id id_table[] =3D { + { USB_DEVICE(0x0404, 0x034C) }, /* NCR Retail IO Box */ { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */ { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GS= M Mobile */ From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C39BC433F5 for ; Mon, 14 Feb 2022 09:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243212AbiBNJdl (ORCPT ); Mon, 14 Feb 2022 04:33:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243500AbiBNJdI (ORCPT ); Mon, 14 Feb 2022 04:33:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB036BF4D; Mon, 14 Feb 2022 01:31:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3CA4D60DFD; Mon, 14 Feb 2022 09:31:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B52EC340E9; Mon, 14 Feb 2022 09:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831092; bh=q5LWd1j9Zs3lkXGE5hEMxO6tSIR7816KEF9BxtRV9co=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A0eEfk2Vh8AHbpQAJfnrgVAqpEBhIfSADNPvdbmyylWHmLG/PCZhaDNp320H5Otuq VM2ihe8brtuvcQB6BCId1clGFEFgw4ubb5neW6osdB9v1R4FOZ1BsPss8oSn9ACV3Y 4fIsZg2Afj6xPozx7/oK7+SNU7onUfNJx4VjuW3Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Russell , Johan Hovold Subject: [PATCH 4.14 41/44] USB: serial: cp210x: add CPI Bulk Coin Recycler id Date: Mon, 14 Feb 2022 10:26:04 +0100 Message-Id: <20220214092449.232784952@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Johan Hovold commit 6ca0c6283340d819bf9c7d8e76be33c9fbd903ab upstream. Add the device id for the Crane Payment Innovation / Money Controls Bulk Coin Recycler: https://www.cranepi.com/en/system/files/Support/OM_BCR_EN_V1-04_0.pdf Reported-by: Scott Russell Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -73,6 +73,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */ { USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */ { USB_DEVICE(0x0FDE, 0xCA05) }, /* OWL Wireless Electricity Monitor CM-16= 0 */ + { USB_DEVICE(0x106F, 0x0003) }, /* CPI / Money Controls Bulk Coin Recycle= r */ { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09B60C433EF for ; Mon, 14 Feb 2022 09:33:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243674AbiBNJdp (ORCPT ); Mon, 14 Feb 2022 04:33:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243865AbiBNJdN (ORCPT ); Mon, 14 Feb 2022 04:33:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 742A260D90; Mon, 14 Feb 2022 01:31:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 26D8FB80DCC; Mon, 14 Feb 2022 09:31:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B360C340E9; Mon, 14 Feb 2022 09:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831096; bh=uevaLRTtbu0gQTNmH5s19jDCZEKQ+0PLVKpDgPs9ZbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dBqfFpXMTV6Ae2mCOYkB2i7y1jV7VdyB6wPH/yeFSXLDlnOpqB63eMI55f2V3C+Hn 4ehUVxpHrrmhWoOl5ybaI59VCl9U6XI+sPOnEUnKUmh9auMBzyMUrUrGyRPulDdXTj 5w7gMaCvHPu9NiDJPNa2pW9+5P1zzwY49o3HJJoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Lutomirski , Will Drewry , Kees Cook Subject: [PATCH 4.14 42/44] seccomp: Invalidate seccomp mode to catch death failures Date: Mon, 14 Feb 2022 10:26:05 +0100 Message-Id: <20220214092449.263018817@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kees Cook commit 495ac3069a6235bfdf516812a2a9b256671bbdf9 upstream. If seccomp tries to kill a process, it should never see that process again. To enforce this proactively, switch the mode to something impossible. If encountered: WARN, reject all syscalls, and attempt to kill the process again even harder. Cc: Andy Lutomirski Cc: Will Drewry Fixes: 8112c4f140fa ("seccomp: remove 2-phase API") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- kernel/seccomp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -28,6 +28,9 @@ #include #include =20 +/* Not exposed in headers: strictly internal use only. */ +#define SECCOMP_MODE_DEAD (SECCOMP_MODE_FILTER + 1) + #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER #include #endif @@ -632,6 +635,7 @@ static void __secure_computing_strict(in #ifdef SECCOMP_DEBUG dump_stack(); #endif + current->seccomp.mode =3D SECCOMP_MODE_DEAD; seccomp_log(this_syscall, SIGKILL, SECCOMP_RET_KILL_THREAD, true); do_exit(SIGKILL); } @@ -746,6 +750,7 @@ static int __seccomp_filter(int this_sys case SECCOMP_RET_KILL_THREAD: case SECCOMP_RET_KILL_PROCESS: default: + current->seccomp.mode =3D SECCOMP_MODE_DEAD; seccomp_log(this_syscall, SIGSYS, action, true); /* Dump core only if this is the last remaining thread. */ if (action =3D=3D SECCOMP_RET_KILL_PROCESS || @@ -798,6 +803,11 @@ int __secure_computing(const struct secc return 0; case SECCOMP_MODE_FILTER: return __seccomp_filter(this_syscall, sd, false); + /* Surviving SECCOMP_RET_KILL_* must be proactively impossible. */ + case SECCOMP_MODE_DEAD: + WARN_ON_ONCE(1); + do_exit(SIGKILL); + return -1; default: BUG(); } From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6479C433F5 for ; Mon, 14 Feb 2022 09:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiBNJds (ORCPT ); Mon, 14 Feb 2022 04:33:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243867AbiBNJdN (ORCPT ); Mon, 14 Feb 2022 04:33:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3591B65785; Mon, 14 Feb 2022 01:31:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B71E460DFD; Mon, 14 Feb 2022 09:31:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DB93C340E9; Mon, 14 Feb 2022 09:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831099; bh=vKR3XLW8cjvpm8Z/9x3036EkCMG759mpw8h0+7mcmx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r5EjL4brRV/zi0JmcLekfEke2QQ+RWWwnW0WwU4+cboEc2AlHbdXZ68wadTnt1acV NDRudmu22TxA8d8u0WHaZfqzPF5vpWWIcegVsN2HrRwQ/Yg30XnsApI8dUglgKRqDW 1lUN0Ytp+CbM8Xbfp+64wmfIBb519RIyn8WICeU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Armin Wolf , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Guenter Roeck Subject: [PATCH 4.14 43/44] hwmon: (dell-smm) Speed up setting of fan speed Date: Mon, 14 Feb 2022 10:26:06 +0100 Message-Id: <20220214092449.293304202@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Armin Wolf commit c0d79987a0d82671bff374c07f2201f9bdf4aaa2 upstream. When setting the fan speed, i8k_set_fan() calls i8k_get_fan_status(), causing an unnecessary SMM call since from the two users of this function, only i8k_ioctl_unlocked() needs to know the new fan status while dell_smm_write() ignores the new fan status. Since SMM calls can be very slow while also making error reporting difficult for dell_smm_write(), remove the function call from i8k_set_fan() and call it separately in i8k_ioctl_unlocked(). Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf Reviewed-by: Pali Roh=C3=A1r Link: https://lore.kernel.org/r/20211021190531.17379-6-W_Armin@gmx.de Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- drivers/hwmon/dell-smm-hwmon.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -294,7 +294,7 @@ static int i8k_get_fan_nominal_speed(int } =20 /* - * Set the fan speed (off, low, high). Returns the new fan status. + * Set the fan speed (off, low, high, ...). */ static int i8k_set_fan(int fan, int speed) { @@ -303,7 +303,7 @@ static int i8k_set_fan(int fan, int spee speed =3D (speed < 0) ? 0 : ((speed > i8k_fan_max) ? i8k_fan_max : speed); regs.ebx =3D (fan & 0xff) | (speed << 8); =20 - return i8k_smm(®s) ? : i8k_get_fan_status(fan); + return i8k_smm(®s); } =20 static int i8k_get_temp_type(int sensor) @@ -417,7 +417,7 @@ static int i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg) { int val =3D 0; - int speed; + int speed, err; unsigned char buff[16]; int __user *argp =3D (int __user *)arg; =20 @@ -478,7 +478,11 @@ i8k_ioctl_unlocked(struct file *fp, unsi if (copy_from_user(&speed, argp + 1, sizeof(int))) return -EFAULT; =20 - val =3D i8k_set_fan(val, speed); + err =3D i8k_set_fan(val, speed); + if (err < 0) + return err; + + val =3D i8k_get_fan_status(val); break; =20 default: From nobody Sun Jun 28 04:36:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40228C433EF for ; Mon, 14 Feb 2022 09:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243769AbiBNJdy (ORCPT ); Mon, 14 Feb 2022 04:33:54 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243870AbiBNJdY (ORCPT ); Mon, 14 Feb 2022 04:33:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 459DBBF6C; Mon, 14 Feb 2022 01:31:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6DAE60FFF; Mon, 14 Feb 2022 09:31:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4486C340E9; Mon, 14 Feb 2022 09:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831102; bh=Uj2nSFtwqR3ZK3vkD7VM+uy5Bie9c8gJ+7OMKjQ4i+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzIn/r+DuEoxViKREiELNNW8JvsaJPjXlxoluu9BEaUiLBV85YgjkAz25d/p7YTwJ 54Feu08E0YTo06FeKQF6wqB3/VdB1yIq/mFBKMh98ObT/dj4Ep07DsvDJ1YD/I//1I cruwvf0fqGwMJBKhuFC2hgl/AZQvlF9psVvkaVxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Song Liu , Rik van Riel , "Peter Zijlstra (Intel)" Subject: [PATCH 4.14 44/44] perf: Fix list corruption in perf_cgroup_switch() Date: Mon, 14 Feb 2022 10:26:07 +0100 Message-Id: <20220214092449.324669342@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092447.897544753@linuxfoundation.org> References: <20220214092447.897544753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Song Liu commit 5f4e5ce638e6a490b976ade4a40017b40abb2da0 upstream. There's list corruption on cgrp_cpuctx_list. This happens on the following path: perf_cgroup_switch: list_for_each_entry(cgrp_cpuctx_list) cpu_ctx_sched_in ctx_sched_in ctx_pinned_sched_in merge_sched_in perf_cgroup_event_disable: remove the event from the list Use list_for_each_entry_safe() to allow removing an entry during iteration. Fixes: 058fe1c0440e ("perf/core: Make cgroup switch visit only cpuctxs with= cgroup events") Signed-off-by: Song Liu Reviewed-by: Rik van Riel Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220204004057.2961252-1-song@kernel.org Signed-off-by: Greg Kroah-Hartman Tested-by: Guenter Roeck Tested-by: Linux Kernel Functional Testing Tested-by: Slade Watkins --- kernel/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -716,7 +716,7 @@ static DEFINE_PER_CPU(struct list_head, */ static void perf_cgroup_switch(struct task_struct *task, int mode) { - struct perf_cpu_context *cpuctx; + struct perf_cpu_context *cpuctx, *tmp; struct list_head *list; unsigned long flags; =20 @@ -727,7 +727,7 @@ static void perf_cgroup_switch(struct ta local_irq_save(flags); =20 list =3D this_cpu_ptr(&cgrp_cpuctx_list); - list_for_each_entry(cpuctx, list, cgrp_cpuctx_entry) { + list_for_each_entry_safe(cpuctx, tmp, list, cgrp_cpuctx_entry) { WARN_ON_ONCE(cpuctx->ctx.nr_cgroups =3D=3D 0); =20 perf_ctx_lock(cpuctx, cpuctx->task_ctx);