From patchwork Mon Jun 1 17:53:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224884 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C347FC433DF for ; Mon, 1 Jun 2020 18:56:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EC8320679 for ; Mon, 1 Jun 2020 18:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037818; bh=oqkKnpN3JQgcqYTFZVsmVD/urZXJAlIzlMfHX9kho9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cxEnPxLTO/W9nkngAth9SPEnkzCaqRA8Zfu08br6XgebcWZFt0FxAgeITwOTiPoF8 Uchy1XjZ1MZA5+1yk0GF1uRWrG4gy7nP9CSbLW5HZv+hC/zBlkY4X9Kkuv7jFwkxlK wCLqM0AdUT2oqPFTrnpm3nAF2vLpI9L2s4u1qmk0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729605AbgFASAL (ORCPT ); Mon, 1 Jun 2020 14:00:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729604AbgFASAK (ORCPT ); Mon, 1 Jun 2020 14:00:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4CAB22073B; Mon, 1 Jun 2020 18:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034409; bh=oqkKnpN3JQgcqYTFZVsmVD/urZXJAlIzlMfHX9kho9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wh6z/EcFQIUVRech6ZSk8ZCF1bi1Pn+4q2RxP+CaNtJhfus0TO0lmAKialOHo7a+m SMPgq15avqcRG3vC2gjeJM6piOCo+75kRlL7be1R9uUpZyfniwCYzGCF5AScAZ9D/R I6qihXpu4J9VKCVxjK/PXJMZE6n2WGiKhYGqF9Tc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Zijlstra , Eric Dumazet , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , Jiri Pirko , Arvind Sankar , Jiong Wang , Yuqi Jin , Shaokun Zhang Subject: [PATCH 4.14 04/77] net: revert "net: get rid of an signed integer overflow in ip_idents_reserve()" Date: Mon, 1 Jun 2020 19:53:09 +0200 Message-Id: <20200601174017.232490389@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yuqi Jin [ Upstream commit a6211caa634da39d861a47437ffcda8b38ef421b ] Commit adb03115f459 ("net: get rid of an signed integer overflow in ip_idents_reserve()") used atomic_cmpxchg to replace "atomic_add_return" inside the function "ip_idents_reserve". The reason was to avoid UBSAN warning. However, this change has caused performance degrade and in GCC-8, fno-strict-overflow is now mapped to -fwrapv -fwrapv-pointer and signed integer overflow is now undefined by default at all optimization levels[1]. Moreover, it was a bug in UBSAN vs -fwrapv /-fno-strict-overflow, so Let's revert it safely. [1] https://gcc.gnu.org/gcc-8/changes.html Suggested-by: Peter Zijlstra Suggested-by: Eric Dumazet Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: Hideaki YOSHIFUJI Cc: Jakub Kicinski Cc: Jiri Pirko Cc: Arvind Sankar Cc: Peter Zijlstra Cc: Eric Dumazet Cc: Jiong Wang Signed-off-by: Yuqi Jin Signed-off-by: Shaokun Zhang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/route.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -499,18 +499,16 @@ u32 ip_idents_reserve(u32 hash, int segs atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ; u32 old = ACCESS_ONCE(*p_tstamp); u32 now = (u32)jiffies; - u32 new, delta = 0; + u32 delta = 0; if (old != now && cmpxchg(p_tstamp, old, now) == old) delta = prandom_u32_max(now - old); - /* Do not use atomic_add_return() as it makes UBSAN unhappy */ - do { - old = (u32)atomic_read(p_id); - new = old + delta + segs; - } while (atomic_cmpxchg(p_id, old, new) != old); - - return new - segs; + /* If UBSAN reports an error there, please make sure your compiler + * supports -fno-strict-overflow before reporting it that was a bug + * in UBSAN, and it has been fixed in GCC-8. + */ + return atomic_add_return(segs + delta, p_id) - segs; } EXPORT_SYMBOL(ip_idents_reserve); From patchwork Mon Jun 1 17:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62876C433E0 for ; Mon, 1 Jun 2020 18:56:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F60A206C3 for ; Mon, 1 Jun 2020 18:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037813; bh=oc9000K0Njl65rxCNw3uZQ0DDNTTXplezompeOn/yzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=r9ry5N9afrkDl70qpF2x7sv5ohwljJoklh7xHmbhESp3ucu8VfUmGlY/mAxARiODl pQaWZ9NO3X2H5C0aahV+0Bhr8nVPy75t7M4daPNHfqsMLD3i3RavpTb+PUbWEak1CF A4iBWnb/YvF342F7J/3ZS0/CV3ChqkDY8V6Ifm/Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729622AbgFASAV (ORCPT ); Mon, 1 Jun 2020 14:00:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:42874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728837AbgFASAM (ORCPT ); Mon, 1 Jun 2020 14:00:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DE71207DA; Mon, 1 Jun 2020 18:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034412; bh=oc9000K0Njl65rxCNw3uZQ0DDNTTXplezompeOn/yzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EysgoO2TkjIDFPP8CaoOb31z1Tr0iOznVl7P+h33MM0dYj7b2rQiEBnrN8ropmDp0 qVj4UK4+SSYZODSO4+yJ5KYocdFwasJieYJyGLtJ441d0ZoECSYHwurYUFS8AxTmF2 2KW6ODRTeE95BJACQHxjVFsRCcMXJWKo5dGxKOsg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jamal Hadi Salim , Roman Mashak , "David S. Miller" Subject: [PATCH 4.14 05/77] net sched: fix reporting the first-time use timestamp Date: Mon, 1 Jun 2020 19:53:10 +0200 Message-Id: <20200601174017.398306482@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Roman Mashak [ Upstream commit b15e62631c5f19fea9895f7632dae9c1b27fe0cd ] When a new action is installed, firstuse field of 'tcf_t' is explicitly set to 0. Value of zero means "new action, not yet used"; as a packet hits the action, 'firstuse' is stamped with the current jiffies value. tcf_tm_dump() should return 0 for firstuse if action has not yet been hit. Fixes: 48d8ee1694dd ("net sched actions: aggregate dumping of actions timeinfo") Cc: Jamal Hadi Salim Signed-off-by: Roman Mashak Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/act_api.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -69,7 +69,8 @@ static inline void tcf_tm_dump(struct tc { dtm->install = jiffies_to_clock_t(jiffies - stm->install); dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse); - dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse); + dtm->firstuse = stm->firstuse ? + jiffies_to_clock_t(jiffies - stm->firstuse) : 0; dtm->expires = jiffies_to_clock_t(stm->expires); } From patchwork Mon Jun 1 17:53:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C49AC433DF for ; Mon, 1 Jun 2020 18:57:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 008B6206C3 for ; Mon, 1 Jun 2020 18:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037827; bh=2kWCVXZYXUw1sPg7WO9hPr23Qd/vPlm0bq90WakJSmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P6aD50DcphyB1ANyhKZP86SB+aFJZMnVcFnZ/6r2FtZ7oD0Y6FENRoHOx/c8Mr6x/ PITPmCMHTwDKc6Nxbh6v2S4C+I8cQXcX3FIcglc+FybhEFGBHVO7d9Ghe+fllf4xtr kmce/+hZRhWUQlfOY65xCg2Z4rw9S3OX5L8FobtE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729831AbgFAS45 (ORCPT ); Mon, 1 Jun 2020 14:56:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728877AbgFASAT (ORCPT ); Mon, 1 Jun 2020 14:00:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 46531206E2; Mon, 1 Jun 2020 18:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034418; bh=2kWCVXZYXUw1sPg7WO9hPr23Qd/vPlm0bq90WakJSmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDnZXFVIPFZwDfgiQmlJ6hvoGTgkvOiuYH7Dp9GFnKLMa2AcPHWyxF6cvXNp4BGRG eEDWc74NsFWVpz1kGCoR88DJiqjYTy0PeYjGT+d+ZpHd11RktlVz8o/2Q34H93zyNa INbziuxQJVzIiRUhi6NM2WaWE55Kw953SWOHIbj8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Moshe Shemesh , Tariq Toukan , Saeed Mahameed Subject: [PATCH 4.14 08/77] net/mlx5e: Update netdev txq on completions during closure Date: Mon, 1 Jun 2020 19:53:13 +0200 Message-Id: <20200601174017.905106006@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Moshe Shemesh [ Upstream commit 5e911e2c06bd8c17df29147a5e2d4b17fafda024 ] On sq closure when we free its descriptors, we should also update netdev txq on completions which would not arrive. Otherwise if we reopen sqs and attach them back, for example on fw fatal recovery flow, we may get tx timeout. Fixes: 29429f3300a3 ("net/mlx5e: Timeout if SQ doesn't flush during close") Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -496,8 +496,9 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *c void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq) { struct mlx5e_tx_wqe_info *wi; + u32 nbytes = 0; + u16 ci, npkts = 0; struct sk_buff *skb; - u16 ci; int i; while (sq->cc != sq->pc) { @@ -518,8 +519,11 @@ void mlx5e_free_txqsq_descs(struct mlx5e } dev_kfree_skb_any(skb); + npkts++; + nbytes += wi->num_bytes; sq->cc += wi->num_wqebbs; } + netdev_tx_completed_queue(sq->txq, npkts, nbytes); } #ifdef CONFIG_MLX5_CORE_IPOIB From patchwork Mon Jun 1 17:53:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224886 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD441C433DF for ; Mon, 1 Jun 2020 18:56:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82552206C3 for ; Mon, 1 Jun 2020 18:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037807; bh=v0C1Z9ww9x+pvRa/lCYtmJtx83bS0uWaaBktRdlhRdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GK8Ev9nzE0wiOmNmp612v94EmQIi/O4LuEq0JjnndmMJjwZAYqMeQ8z8u8tDbfQtN TiqJHiCQDgKH71fVYcuZusI0FDMSPQkX42sAXhdqvleic+QEtDYd9Rq0m3FnxgJfPJ fDb9OeqjFxJ/JHkWm8BvtdKd54nwuMjuwqiCDryc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728012AbgFASAZ (ORCPT ); Mon, 1 Jun 2020 14:00:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:43044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729058AbgFASAV (ORCPT ); Mon, 1 Jun 2020 14:00:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 803F92074B; Mon, 1 Jun 2020 18:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034421; bh=v0C1Z9ww9x+pvRa/lCYtmJtx83bS0uWaaBktRdlhRdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aHEaCYMPpkivbTgB8kmKug7PQPF9AMQKGAZM+9gUK2TGxmJtMT9C3D4BmHduYnCE0 N6pJtgnOCvEiFk8uBOQn+dW2dzZ4bxulPeNATP7sDfuOHCZFwLlDEnWFbgWI0yV4hU BJhlHQuuRG+E3oLU0TLPpCggQt1awZdysSeEEGck= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Julia Lawall , Manivannan Sadhasivam , Bjorn Andersson , "David S. Miller" Subject: [PATCH 4.14 09/77] net: qrtr: Fix passing invalid reference to qrtr_local_enqueue() Date: Mon, 1 Jun 2020 19:53:14 +0200 Message-Id: <20200601174018.099237527@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Manivannan Sadhasivam [ Upstream commit d28ea1fbbf437054ef339afec241019f2c4e2bb6 ] Once the traversal of the list is completed with list_for_each_entry(), the iterator (node) will point to an invalid object. So passing this to qrtr_local_enqueue() which is outside of the iterator block is erroneous eventhough the object is not used. So fix this by passing NULL to qrtr_local_enqueue(). Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Reported-by: kbuild test robot Reported-by: Julia Lawall Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bjorn Andersson Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/qrtr/qrtr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -660,7 +660,7 @@ static int qrtr_bcast_enqueue(struct qrt } mutex_unlock(&qrtr_node_lock); - qrtr_local_enqueue(node, skb); + qrtr_local_enqueue(NULL, skb); return 0; } From patchwork Mon Jun 1 17:53:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D94FC433E0 for ; Mon, 1 Jun 2020 18:57:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DF90206E2 for ; Mon, 1 Jun 2020 18:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037852; bh=RHYFlKGmv3ZEU4RWy/4On0Pa7vSBAT0uv4j1Gh7M49Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TvnIvtloWG0NCV74ozH6I+wVxP0irgNzEd3H+3XIpxw6RsrVmXHlFd/mtyyWGp3bc ljqxbV9jMwhSblgyayyflcN79iVO7W6b7QE/fwWmafi8cbxOzoqg153XvKNcGBW5jp k/8IjwhbFbr+29B8G770pIoYR9AmLWlXumTnDOUY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728795AbgFAS5b (ORCPT ); Mon, 1 Jun 2020 14:57:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:42402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729555AbgFAR7w (ORCPT ); Mon, 1 Jun 2020 13:59:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73E46206E2; Mon, 1 Jun 2020 17:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034391; bh=RHYFlKGmv3ZEU4RWy/4On0Pa7vSBAT0uv4j1Gh7M49Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZMFCEthxgUwpLrI/RLaLZJkAE0lfStHCr+wvRhTEFtkAEEFuk1PASHliweIJCTm23 RjpDdqB5pWxVanSYkuzM4O+rWmUBj7tUgX08W1ME2li+cTZ2rUpqWrdpU54L0o6o1p lpCS3nzO9iKo9x0wmU+xCVcb/Ymrf34N6aciz5xo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , "David S. Miller" Subject: [PATCH 4.14 11/77] net/mlx4_core: fix a memory leak bug. Date: Mon, 1 Jun 2020 19:53:16 +0200 Message-Id: <20200601174018.557560240@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Qiushi Wu commit febfd9d3c7f74063e8e630b15413ca91b567f963 upstream. In function mlx4_opreq_action(), pointer "mailbox" is not released, when mlx4_cmd_box() return and error, causing a memory leak bug. Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can free this pointer. Fixes: fe6f700d6cbb ("net/mlx4_core: Respond to operation request by firmware") Signed-off-by: Qiushi Wu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c @@ -2715,7 +2715,7 @@ void mlx4_opreq_action(struct work_struc if (err) { mlx4_err(dev, "Failed to retrieve required operation: %d\n", err); - return; + goto out; } MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET); From patchwork Mon Jun 1 17:53:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224882 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80F7FC433E0 for ; Mon, 1 Jun 2020 18:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 531C6206C3 for ; Mon, 1 Jun 2020 18:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037834; bh=yYeTSMmM5FxusSZEIdctCarTpv7x8v6BuKfesZquWXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gfxXaxykPdkUn55VVZEtNt5+IHCdb5XLkm2nVerqdWT/NKCewFGdsStC1Wo0ewh57 sId+BumoftWmXyyNPGcdajFuAeVGoJTlk+bIrVF5Rl3KFRYai1iVj5GjdzBbp+ekfQ E2CBEsVesOM8HCwR4BqmFTboBOyGSDPU01k1c76I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728811AbgFASAA (ORCPT ); Mon, 1 Jun 2020 14:00:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:42554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729584AbgFAR77 (ORCPT ); Mon, 1 Jun 2020 13:59:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BEE4206E2; Mon, 1 Jun 2020 17:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034398; bh=yYeTSMmM5FxusSZEIdctCarTpv7x8v6BuKfesZquWXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jW0l8ftMFS+nu4E/z5msiF9IPnJpHCVpB7lIWcyZ+viDcl2XYVMLP2mRwxmCKRASs b6HyWQkKXS4CChQfepqL/FZODf+2jW5RG/+4ytERbXoVtHBLsHTIcxrEKJm4h3j0fh piPJDCWqhLrlU7yMey6ArNqCoS5u6m21iJP2Wvdc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Jonker , Heiko Stuebner , Sasha Levin Subject: [PATCH 4.14 14/77] ARM: dts: rockchip: fix pinctrl sub nodename for spi in rk322x.dtsi Date: Mon, 1 Jun 2020 19:53:19 +0200 Message-Id: <20200601174019.076908390@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johan Jonker [ Upstream commit 855bdca1781c79eb661f89c8944c4a719ce720e8 ] A test with the command below gives these errors: arch/arm/boot/dts/rk3229-evb.dt.yaml: spi-0: '#address-cells' is a required property arch/arm/boot/dts/rk3229-evb.dt.yaml: spi-1: '#address-cells' is a required property arch/arm/boot/dts/rk3229-xms6.dt.yaml: spi-0: '#address-cells' is a required property arch/arm/boot/dts/rk3229-xms6.dt.yaml: spi-1: '#address-cells' is a required property The $nodename pattern for spi nodes is "^spi(@.*|-[0-9a-f])*$". To prevent warnings rename 'spi-0' and 'spi-1' pinctrl sub nodenames to 'spi0' and 'spi1' in 'rk322x.dtsi'. make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/spi-controller.yaml Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20200424123923.8192-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner Signed-off-by: Sasha Levin --- arch/arm/boot/dts/rk322x.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index f59f7cc62be6..0c60dbc4b46a 100644 --- a/arch/arm/boot/dts/rk322x.dtsi +++ b/arch/arm/boot/dts/rk322x.dtsi @@ -950,7 +950,7 @@ }; }; - spi-0 { + spi0 { spi0_clk: spi0-clk { rockchip,pins = <0 9 RK_FUNC_2 &pcfg_pull_up>; }; @@ -968,7 +968,7 @@ }; }; - spi-1 { + spi1 { spi1_clk: spi1-clk { rockchip,pins = <0 23 RK_FUNC_2 &pcfg_pull_up>; }; From patchwork Mon Jun 1 17:53:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B934C433E0 for ; Mon, 1 Jun 2020 18:00:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 613D52074B for ; Mon, 1 Jun 2020 18:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034405; bh=EVMYPFXCa8UDgn/EF4So3rbeYZBZ4Xjld31+FkORFH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vOvJTzD1GtSaAedMg7XiSkgl63V586IsUEAGRVkh61fSLKnq9VOdQ1LUKG7g6ovP6 ZK+0zHLVZaQqJRLNvpLyo54B6CsYHvT4YRdPPZOYLHWqB0JIllBzkuxKADzLim6mhA DtOG++FqhiHI+lnSUDSOrycjl0Ir5lo//ZTTfDTw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729592AbgFASAC (ORCPT ); Mon, 1 Jun 2020 14:00:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:42588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729587AbgFASAB (ORCPT ); Mon, 1 Jun 2020 14:00:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73060206E2; Mon, 1 Jun 2020 18:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034400; bh=EVMYPFXCa8UDgn/EF4So3rbeYZBZ4Xjld31+FkORFH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ryElohxY3QoHhzAmgy7yKxGJqvEihPvrA3zMgSq4FNzCdRnACHsGS0gs200qZtq6q 2ilazZY1PNr5Klsf9ivS7zeZ2N6Kmn06Rl5RZtE7uCqFNskkKqzsfUagLifhLV2s/a dxzNaC6pj9Viwt/+neyilPQDBYILYEPpWJvKhwkQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Warren , Linus Walleij , Sasha Levin Subject: [PATCH 4.14 15/77] gpio: tegra: mask GPIO IRQs during IRQ shutdown Date: Mon, 1 Jun 2020 19:53:20 +0200 Message-Id: <20200601174019.217567368@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stephen Warren [ Upstream commit 0cf253eed5d2bdf7bb3152457b38f39b012955f7 ] The driver currently leaves GPIO IRQs unmasked even when the GPIO IRQ client has released the GPIO IRQ. This allows the HW to raise IRQs, and SW to process them, after shutdown. Fix this by masking the IRQ when it's shut down. This is usually taken care of by the irqchip core, but since this driver has a custom irq_shutdown implementation, it must do this explicitly itself. Signed-off-by: Stephen Warren Link: https://lore.kernel.org/r/20200427232605.11608-1-swarren@wwwdotorg.org Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 1eb857e2f62f..dd801f5d5253 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -356,6 +356,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d) struct tegra_gpio_info *tgi = bank->tgi; unsigned int gpio = d->hwirq; + tegra_gpio_irq_mask(d); gpiochip_unlock_as_irq(&tgi->gc, gpio); } From patchwork Mon Jun 1 17:53:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 850EDC433DF for ; Mon, 1 Jun 2020 18:57:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62218206C3 for ; Mon, 1 Jun 2020 18:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037842; bh=TG+9HF2alshZxc1Ns252ZMmuUWyXitjY2aWNEIsHztk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dH556C0PGTlB7GBLe0F7zCcO6ZcnkTcahRWbgd3YWIl38PgOtkYNVP/wEulbcVtHA lRfeMelM7gG7tg+3bSN/LnrU6Uq9afe46TDgdeplVjW1Hlwg8GD0FFlEru/oI3ami2 0+FW1rsJgVAN3CsmyB0VCrlXF3wDm+kxcijeTPCg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730254AbgFAS5O (ORCPT ); Mon, 1 Jun 2020 14:57:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728120AbgFASAD (ORCPT ); Mon, 1 Jun 2020 14:00:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC52A206E2; Mon, 1 Jun 2020 18:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034403; bh=TG+9HF2alshZxc1Ns252ZMmuUWyXitjY2aWNEIsHztk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cbhv1+D72N7wSQA2Kh7BriOlgAAzMrMRCMlQBsDD39ipWwqFGUpsyywoXen0wOI5E Bh/v3CdTDaom+PP3O/aCdQ4MhRHv+hotqNvodd2UuQBj6Eokfswsivjbb6VJMb+Isr lUXGtAdkFHQB97XyvbH3sgnNsNQ+1i5jsbJNOuK8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 16/77] net: microchip: encx24j600: add missed kthread_stop Date: Mon, 1 Jun 2020 19:53:21 +0200 Message-Id: <20200601174019.378767998@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chuhong Yuan [ Upstream commit ff8ce319e9c25e920d994cc35236f0bb32dfc8f3 ] This driver calls kthread_run() in probe, but forgets to call kthread_stop() in probe failure and remove. Add the missed kthread_stop() to fix it. Signed-off-by: Chuhong Yuan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/microchip/encx24j600.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c index f831238d9793..84b6ad76f5bc 100644 --- a/drivers/net/ethernet/microchip/encx24j600.c +++ b/drivers/net/ethernet/microchip/encx24j600.c @@ -1075,7 +1075,7 @@ static int encx24j600_spi_probe(struct spi_device *spi) if (unlikely(ret)) { netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n", ret); - goto out_free; + goto out_stop; } eidled = encx24j600_read_reg(priv, EIDLED); @@ -1093,6 +1093,8 @@ static int encx24j600_spi_probe(struct spi_device *spi) out_unregister: unregister_netdev(priv->ndev); +out_stop: + kthread_stop(priv->kworker_task); out_free: free_netdev(ndev); @@ -1105,6 +1107,7 @@ static int encx24j600_spi_remove(struct spi_device *spi) struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev); unregister_netdev(priv->ndev); + kthread_stop(priv->kworker_task); free_netdev(priv->ndev); From patchwork Mon Jun 1 17:53:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F083FC433DF for ; Mon, 1 Jun 2020 18:01:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C885D2065C for ; Mon, 1 Jun 2020 18:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034477; bh=CuBTDqU7i9gT/BrbieKiGX7Ca/D8uLOthjeVO9EfLPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zFZRrhhmTeb+IdD2/LrKVngx+kYE2kwdhFWxYi/tiQl1XyuSbRH7SkTRJlZJnPNIZ hBi5fVHGWEryp/RYc4Qv6ZssYEVBxar5n3+gINkhJx/1Nm2PUTrIpEi4cb26hBH4zO bS16bv/yCahJn12fizMR5rYzdLf1HMKkn5TesEv4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728630AbgFASBQ (ORCPT ); Mon, 1 Jun 2020 14:01:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:44118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729759AbgFASBP (ORCPT ); Mon, 1 Jun 2020 14:01:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0397E206E2; Mon, 1 Jun 2020 18:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034474; bh=CuBTDqU7i9gT/BrbieKiGX7Ca/D8uLOthjeVO9EfLPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TzvSCgrvLhpGYLMWL4TcgxvQqVcJjfZ7cagvnVT7f/Xvhu1mXF3rD//+i2JLlsdg4 JCNBiJnuyAc09pNjFZhMDmwpSrjIUaCK6LdbHL0yU35gLz3Y8juwNth4DHdJ3i46pu xL96iLVrDUgOiZycVza73IxoTbfcxE/H7+icMclQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , kbuild test robot , Masahiro Yamada , Felipe Balbi , Sasha Levin Subject: [PATCH 4.14 20/77] usb: gadget: legacy: fix redundant initialization warnings Date: Mon, 1 Jun 2020 19:53:25 +0200 Message-Id: <20200601174020.054553107@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada [ Upstream commit d13cce757954fa663c69845611957396843ed87a ] Fix the following cppcheck warnings: drivers/usb/gadget/legacy/inode.c:1364:8: style: Redundant initialization for 'value'. The initialized value is overwritten$ value = -EOPNOTSUPP; ^ drivers/usb/gadget/legacy/inode.c:1331:15: note: value is initialized int value = -EOPNOTSUPP; ^ drivers/usb/gadget/legacy/inode.c:1364:8: note: value is overwritten value = -EOPNOTSUPP; ^ drivers/usb/gadget/legacy/inode.c:1817:8: style: Redundant initialization for 'value'. The initialized value is overwritten$ value = -EINVAL; ^ drivers/usb/gadget/legacy/inode.c:1787:18: note: value is initialized ssize_t value = len, length = len; ^ drivers/usb/gadget/legacy/inode.c:1817:8: note: value is overwritten value = -EINVAL; ^ Acked-by: Alan Stern Reported-by: kbuild test robot Signed-off-by: Masahiro Yamada Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/legacy/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 5c28bee327e1..e431a8bc3a9d 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -1364,7 +1364,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) req->buf = dev->rbuf; req->context = NULL; - value = -EOPNOTSUPP; switch (ctrl->bRequest) { case USB_REQ_GET_DESCRIPTOR: @@ -1788,7 +1787,7 @@ static ssize_t dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) { struct dev_data *dev = fd->private_data; - ssize_t value = len, length = len; + ssize_t value, length = len; unsigned total; u32 tag; char *kbuf; From patchwork Mon Jun 1 17:53:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DCC8C433DF for ; Mon, 1 Jun 2020 18:55:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73E5F207D0 for ; Mon, 1 Jun 2020 18:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037704; bh=aVWBkr/MbZ67KkqkDZdoxyT8qvaVzqO3nHWvC9kgK+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Sf3Ze4x0twUWrpFLsWwt2YOeQfiZ7cKud8JHtAe1IVSRNFWEw3qIyj/xtOJXDYV7/ dcworNxuVQA4WXT3ldMgPm7MJ7VmaZC4Ryt8MIupzZzWI0uy5fEuvx48fXecgu9pVF xTM3ozaIkplAGmglgtaa9rL7GBL69+ztVYZBkEcI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728697AbgFASBm (ORCPT ); Mon, 1 Jun 2020 14:01:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729818AbgFASBj (ORCPT ); Mon, 1 Jun 2020 14:01:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 673C3207DF; Mon, 1 Jun 2020 18:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034498; bh=aVWBkr/MbZ67KkqkDZdoxyT8qvaVzqO3nHWvC9kgK+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3wK4xJGUXRFTP+sxdgb49iPn1NAxql8pjKghMz4CShd0aliB4LUcC6RvUOy1MzDl 0yrNw7jWevjpUtMZD61UtxuXy5dvvDI6pTD/XFh1J4q9XV7tFE+XTe1JmRDkg5GrMp JZ9lHbCx1Gic4rcKYg86ozkK9+Y9SMkaZHZm5jpc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 21/77] net: freescale: select CONFIG_FIXED_PHY where needed Date: Mon, 1 Jun 2020 19:53:26 +0200 Message-Id: <20200601174020.202776499@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 99352c79af3e5f2e4724abf37fa5a2a3299b1c81 ] I ran into a randconfig build failure with CONFIG_FIXED_PHY=m and CONFIG_GIANFAR=y: x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier' It seems the same thing can happen with dpaa and ucc_geth, so change all three to do an explicit 'select FIXED_PHY'. The fixed-phy driver actually has an alternative stub function that theoretically allows building network drivers when fixed-phy is disabled, but I don't see how that would help here, as the drivers presumably would not work then. Signed-off-by: Arnd Bergmann Acked-by: Florian Fainelli Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/Kconfig | 2 ++ drivers/net/ethernet/freescale/dpaa/Kconfig | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig index 6e490fd2345d..71f0640200bc 100644 --- a/drivers/net/ethernet/freescale/Kconfig +++ b/drivers/net/ethernet/freescale/Kconfig @@ -76,6 +76,7 @@ config UCC_GETH depends on QUICC_ENGINE select FSL_PQ_MDIO select PHYLIB + select FIXED_PHY ---help--- This driver supports the Gigabit Ethernet mode of the QUICC Engine, which is available on some Freescale SOCs. @@ -89,6 +90,7 @@ config GIANFAR depends on HAS_DMA select FSL_PQ_MDIO select PHYLIB + select FIXED_PHY select CRC32 ---help--- This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx, diff --git a/drivers/net/ethernet/freescale/dpaa/Kconfig b/drivers/net/ethernet/freescale/dpaa/Kconfig index a654736237a9..8fec41e57178 100644 --- a/drivers/net/ethernet/freescale/dpaa/Kconfig +++ b/drivers/net/ethernet/freescale/dpaa/Kconfig @@ -2,6 +2,7 @@ menuconfig FSL_DPAA_ETH tristate "DPAA Ethernet" depends on FSL_DPAA && FSL_FMAN select PHYLIB + select FIXED_PHY select FSL_FMAN_MAC ---help--- Data Path Acceleration Architecture Ethernet driver, From patchwork Mon Jun 1 17:53:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224898 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6005C433DF for ; Mon, 1 Jun 2020 18:54:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C711206C3 for ; Mon, 1 Jun 2020 18:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037695; bh=aW1gOOs4HbyBdM6yTnX+lhvxry2Uif7eLZDEZKmV2NQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t4ZipH/296FepA/LdwzaEjWMr5NF5PQcAwXup2w9nsM6srqoEaSY92vUl1Twt4rMY wkQf6B8U/4l+P7o6p8PObKio9mcFG2xxolwHZYoIZSBSdNvC9a7FN41SWJwNbgKPb0 lE3xeWpYAmqO27N+TbOWnbMsIHiQpdOUpuOjQOEY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728636AbgFASyv (ORCPT ); Mon, 1 Jun 2020 14:54:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728688AbgFASBu (ORCPT ); Mon, 1 Jun 2020 14:01:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98A752065C; Mon, 1 Jun 2020 18:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034510; bh=aW1gOOs4HbyBdM6yTnX+lhvxry2Uif7eLZDEZKmV2NQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g06DTov0Ud8ToNmasrv0+omGipAPYauPXsejOuALWgbQZoRggGEJK7u5WOwIEkkz/ MznzhchxRgrpBxsxCrSmR9md3pgE+4FS4hrn6v9ShhtWOltRABIjBQi9IzdYYD2JcF 7yd9lVSh3jAamYgasZafra94rSUYxxFSk4981/x8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hilliard , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.14 24/77] Input: usbtouchscreen - add support for BonXeon TP Date: Mon, 1 Jun 2020 19:53:29 +0200 Message-Id: <20200601174020.748589900@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: James Hilliard [ Upstream commit e3b4f94ef52ae1592cbe199bd38dbdc0d58b2217 ] Based on available information this uses the singletouch irtouch protocol. This is tested and confirmed to be fully functional on the BonXeon TP hardware I have. Signed-off-by: James Hilliard Link: https://lore.kernel.org/r/20200413184217.55700-1-james.hilliard1@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/touchscreen/usbtouchscreen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 2c41107240de..499402a975b3 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -197,6 +197,7 @@ static const struct usb_device_id usbtouch_devices[] = { #endif #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH + {USB_DEVICE(0x255e, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, {USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES}, From patchwork Mon Jun 1 17:53:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6D67C433E0 for ; Mon, 1 Jun 2020 18:54:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7F8C20679 for ; Mon, 1 Jun 2020 18:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037682; bh=vm7kTXpPIK1kbmpMniFBh+WsEPqC5IjnMdgczS7nkzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IB7Z4jj9VXgzfvUUXinbAtrjZzoRiwfdk+POGOBrK4lOI0aAa5cdEDbQmzkuwklgK 5pzlZWezmdUNo265PwdzzbQ70YnFW+fHxkRRlUuxWZutMb+Qtclq6pu0NluNOtjH7z 5d4H3bMb2bcpU1jM1HDAdHM4PLIatTWH1ulwOBv0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730284AbgFASyh (ORCPT ); Mon, 1 Jun 2020 14:54:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:44970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729848AbgFASBz (ORCPT ); Mon, 1 Jun 2020 14:01:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19C66206E2; Mon, 1 Jun 2020 18:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034514; bh=vm7kTXpPIK1kbmpMniFBh+WsEPqC5IjnMdgczS7nkzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f3ZyJ70r3hzAXT04NG+poEdxvXp09Biftxu1FsS8dCUd54K48AYZWJzAPRuzlnCk5 W9N7IKcZ4br4VTDV2MX6p+aB/GngzCu5XM8sFPFCyUSDX2YvFuPBzkXNeuUif2lb+z EuJNVYTX8+aJzQ3mgrxzWIfSvZ5Wlrxd8hf0Ui3k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Maret , Brendan Shanks , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.14 26/77] Input: evdev - call input_flush_device() on release(), not flush() Date: Mon, 1 Jun 2020 19:53:31 +0200 Message-Id: <20200601174021.132584191@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Brendan Shanks [ Upstream commit 09264098ff153f60866039d60b31d39b66f55a31 ] input_flush_device() should only be called once the struct file is being released and no open descriptors remain, but evdev_flush() was calling it whenever a file descriptor was closed. This caused uploaded force-feedback effects to be erased when a process did a dup()/close() on the event FD, called system(), etc. Call input_flush_device() from evdev_release() instead. Reported-by: Mathieu Maret Signed-off-by: Brendan Shanks Link: https://lore.kernel.org/r/20200421231003.7935-1-bshanks@codeweavers.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/evdev.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 925571475005..2463d02e3f99 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -342,20 +342,6 @@ static int evdev_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &client->fasync); } -static int evdev_flush(struct file *file, fl_owner_t id) -{ - struct evdev_client *client = file->private_data; - struct evdev *evdev = client->evdev; - - mutex_lock(&evdev->mutex); - - if (evdev->exist && !client->revoked) - input_flush_device(&evdev->handle, file); - - mutex_unlock(&evdev->mutex); - return 0; -} - static void evdev_free(struct device *dev) { struct evdev *evdev = container_of(dev, struct evdev, dev); @@ -469,6 +455,10 @@ static int evdev_release(struct inode *inode, struct file *file) unsigned int i; mutex_lock(&evdev->mutex); + + if (evdev->exist && !client->revoked) + input_flush_device(&evdev->handle, file); + evdev_ungrab(evdev, client); mutex_unlock(&evdev->mutex); @@ -1331,7 +1321,6 @@ static const struct file_operations evdev_fops = { .compat_ioctl = evdev_ioctl_compat, #endif .fasync = evdev_fasync, - .flush = evdev_flush, .llseek = no_llseek, }; From patchwork Mon Jun 1 17:53:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20772C433DF for ; Mon, 1 Jun 2020 18:56:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFD92206E2 for ; Mon, 1 Jun 2020 18:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037805; bh=PkdW5MIE/xVsJ3P/RLDQdhXyZozb/Kq6uznN5go3Yag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cbHl3famZYcCgRcTssZ+WIqgPS7jr1fFV0VWIpGRAt90pBAwJ2GYasGNMe25TT1gI rPV10H2ej3nNfS554wmP93sPSJvGZZyT4pWi2fhqoFEpa5vf+vvGTK83Yp5tB4yefZ O6af7PYWHsjQmrFM+W6xQEfpjq6pM519n1UPPw54= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728938AbgFASAc (ORCPT ); Mon, 1 Jun 2020 14:00:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:43194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729644AbgFASAa (ORCPT ); Mon, 1 Jun 2020 14:00:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E54D2065C; Mon, 1 Jun 2020 18:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034429; bh=PkdW5MIE/xVsJ3P/RLDQdhXyZozb/Kq6uznN5go3Yag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bk3XEIBLbD7hd/zMZOsD/zh6ohXmeY6hknfnuiPke8ltnlu47ktRJXOTJ7E2QGm/k NpfKi4pzdgS16n33M4JboiF9ERAUELSYMlvV2dGBZgHQ2EIDFhLyhnF7k9IKvGC5FL uygLrsGQs2DlEROD2m3LFF7+RNWdxUc2GMllbMas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Linus Walleij , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.14 28/77] Input: dlink-dir685-touchkeys - fix a typo in driver name Date: Mon, 1 Jun 2020 19:53:33 +0200 Message-Id: <20200601174021.628862977@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET [ Upstream commit 38347374ae3f1ec4df56dd688bd603a64e79a0ed ] According to the file name and Kconfig, a 'k' is missing in this driver name. It should be "dlink-dir685-touchkeys". Fixes: 131b3de7016b ("Input: add D-Link DIR-685 touchkeys driver") Signed-off-by: Christophe JAILLET Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20200412213937.5287-1-christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/keyboard/dlink-dir685-touchkeys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/dlink-dir685-touchkeys.c b/drivers/input/keyboard/dlink-dir685-touchkeys.c index 88e321b76397..6fe4062e3ac2 100644 --- a/drivers/input/keyboard/dlink-dir685-touchkeys.c +++ b/drivers/input/keyboard/dlink-dir685-touchkeys.c @@ -142,7 +142,7 @@ MODULE_DEVICE_TABLE(of, dir685_tk_of_match); static struct i2c_driver dir685_tk_i2c_driver = { .driver = { - .name = "dlin-dir685-touchkeys", + .name = "dlink-dir685-touchkeys", .of_match_table = of_match_ptr(dir685_tk_of_match), }, .probe = dir685_tk_probe, From patchwork Mon Jun 1 17:53:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64707C433DF for ; Mon, 1 Jun 2020 18:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AB75206C3 for ; Mon, 1 Jun 2020 18:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037799; bh=fBZvDbLjHpbUJL2gKLdLwRD4VPHSZY8vhp3Jox947ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xLPd/gMWUX36UmnhUXnsS/DVnnl+5xErCW+SrkS4K9W/SKhxBO+aPnEDrrZUlb5gw +G8diS9OFPYMUfyUBdzq6pVvCkqaKmvnRB9/hvwJ8AgpEOfhtKVYMdBGPnvxFgtMty MGgIjc3ZRV40Fs4xEBGwDqd7kECdpOtE7OAnf/oA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729604AbgFASAf (ORCPT ); Mon, 1 Jun 2020 14:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:43302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729118AbgFASAf (ORCPT ); Mon, 1 Jun 2020 14:00:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C609B2065C; Mon, 1 Jun 2020 18:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034434; bh=fBZvDbLjHpbUJL2gKLdLwRD4VPHSZY8vhp3Jox947ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=txeKoefR3HBvGZfXS/xjSn/S1jlIeAjA34pWUcX0+yOR1z6HAW4VZOlc6j2Q1+bB9 Jf80Jj1eC3XCmR71cEGOuMU7wqlp36okopjORffULK951Do2um3JweVSZdS+PZeZVd Z7GptCi9rug3SeJfVfxzlYuPLFKuXZEKCm6JFbxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Green , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.14 30/77] Input: synaptics-rmi4 - really fix attn_data use-after-free Date: Mon, 1 Jun 2020 19:53:35 +0200 Message-Id: <20200601174022.046583793@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Evan Green [ Upstream commit d5a5e5b5fa7b86c05bf073acc0ba98fa280174ec ] Fix a use-after-free noticed by running with KASAN enabled. If rmi_irq_fn() is run twice in a row, then rmi_f11_attention() (among others) will end up reading from drvdata->attn_data.data, which was freed and left dangling in rmi_irq_fn(). Commit 55edde9fff1a ("Input: synaptics-rmi4 - prevent UAF reported by KASAN") correctly identified and analyzed this bug. However the attempted fix only NULLed out a local variable, missing the fact that drvdata->attn_data is a struct, not a pointer. NULL out the correct pointer in the driver data to prevent the attention functions from copying from it. Fixes: 55edde9fff1a ("Input: synaptics-rmi4 - prevent UAF reported by KASAN") Fixes: b908d3cd812a ("Input: synaptics-rmi4 - allow to add attention data") Signed-off-by: Evan Green Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200427145537.1.Ic8f898e0147beeee2c005ee7b20f1aebdef1e7eb@changeid Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/rmi4/rmi_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 997ccae7ee05..633fd0d660c1 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -232,7 +232,7 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id) if (count) { kfree(attn_data.data); - attn_data.data = NULL; + drvdata->attn_data.data = NULL; } if (!kfifo_is_empty(&drvdata->attn_fifo)) From patchwork Mon Jun 1 17:53:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF485C433E0 for ; Mon, 1 Jun 2020 18:56:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD7A3206C3 for ; Mon, 1 Jun 2020 18:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037780; bh=Uu427Pif+dmGwUKTeKrRVMNQQRMF0AAQYGAbly+3Wr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kTPSzQWaH0qBkipJMbSSQF65rFhm8rq0zdjzIjc0KNkSfAqrbhxCckX+UVyRNX1W/ a5KBQjc4/diEr6mu/AIdQo3jzyXr6q+zImnZF8Gn4ux0EW6C2JOLaSQmJEMlUkzrzq 57SUXkzC+CKFpqFs16k+nvRsbku2O2vhj5Y1GhXo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729904AbgFAS4U (ORCPT ); Mon, 1 Jun 2020 14:56:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:43398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729677AbgFASAj (ORCPT ); Mon, 1 Jun 2020 14:00:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53BAD2065C; Mon, 1 Jun 2020 18:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034438; bh=Uu427Pif+dmGwUKTeKrRVMNQQRMF0AAQYGAbly+3Wr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZTPdaz7Mzrqk2x/u2vYAKTWvaTux0Whxmw+lXw34MzCKXzYyAQ0OkDBxJBQml2oP yfT6Z6IYXXYhdlsxAHhcUlMap2/C6zqMy1RM7JxWspdJTBFV0nxPyZk8+fKTgjUsGj PIBhnqz6647OVXohg62wEBMZ5va+Zd7issAA2iwA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Agner , Nicolas Pitre , Russell King , Sasha Levin Subject: [PATCH 4.14 32/77] ARM: 8843/1: use unified assembler in headers Date: Mon, 1 Jun 2020 19:53:37 +0200 Message-Id: <20200601174022.344327002@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stefan Agner [ Upstream commit c001899a5d6c2d7a0f3b75b2307ddef137fb46a6 ] Use unified assembler syntax (UAL) in headers. Divided syntax is considered deprecated. This will also allow to build the kernel using LLVM's integrated assembler. Signed-off-by: Stefan Agner Acked-by: Nicolas Pitre Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/include/asm/assembler.h | 12 ++++++------ arch/arm/include/asm/vfpmacros.h | 8 ++++---- arch/arm/lib/bitops.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 88286dd483ff..965224d14e6c 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -374,9 +374,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) .macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER() 9999: .if \inc == 1 - \instr\cond\()b\()\t\().w \reg, [\ptr, #\off] + \instr\()b\t\cond\().w \reg, [\ptr, #\off] .elseif \inc == 4 - \instr\cond\()\t\().w \reg, [\ptr, #\off] + \instr\t\cond\().w \reg, [\ptr, #\off] .else .error "Unsupported inc macro argument" .endif @@ -415,9 +415,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) .rept \rept 9999: .if \inc == 1 - \instr\cond\()b\()\t \reg, [\ptr], #\inc + \instr\()b\t\cond \reg, [\ptr], #\inc .elseif \inc == 4 - \instr\cond\()\t \reg, [\ptr], #\inc + \instr\t\cond \reg, [\ptr], #\inc .else .error "Unsupported inc macro argument" .endif @@ -458,7 +458,7 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req #ifndef CONFIG_CPU_USE_DOMAINS adds \tmp, \addr, #\size - 1 - sbcccs \tmp, \tmp, \limit + sbcscc \tmp, \tmp, \limit bcs \bad #ifdef CONFIG_CPU_SPECTRE movcs \addr, #0 @@ -472,7 +472,7 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) sub \tmp, \limit, #1 subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr addhs \tmp, \tmp, #1 @ if (tmp >= 0) { - subhss \tmp, \tmp, \size @ tmp = limit - (addr + size) } + subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) } movlo \addr, #0 @ if (tmp < 0) addr = NULL csdb #endif diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h index ef5dfedacd8d..628c336e8e3b 100644 --- a/arch/arm/include/asm/vfpmacros.h +++ b/arch/arm/include/asm/vfpmacros.h @@ -29,13 +29,13 @@ ldr \tmp, =elf_hwcap @ may not have MVFR regs ldr \tmp, [\tmp, #0] tst \tmp, #HWCAP_VFPD32 - ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} + ldclne p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} addeq \base, \base, #32*4 @ step over unused register space #else VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field cmp \tmp, #2 @ 32 x 64bit registers? - ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} + ldcleq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} addne \base, \base, #32*4 @ step over unused register space #endif #endif @@ -53,13 +53,13 @@ ldr \tmp, =elf_hwcap @ may not have MVFR regs ldr \tmp, [\tmp, #0] tst \tmp, #HWCAP_VFPD32 - stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} + stclne p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} addeq \base, \base, #32*4 @ step over unused register space #else VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field cmp \tmp, #2 @ 32 x 64bit registers? - stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} + stcleq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} addne \base, \base, #32*4 @ step over unused register space #endif #endif diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index 93cddab73072..95bd35991288 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h @@ -7,7 +7,7 @@ ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 - strneb r1, [ip] @ assert word-aligned + strbne r1, [ip] @ assert word-aligned mov r2, #1 and r3, r0, #31 @ Get bit offset mov r0, r0, lsr #5 @@ -32,7 +32,7 @@ ENDPROC(\name ) ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 - strneb r1, [ip] @ assert word-aligned + strbne r1, [ip] @ assert word-aligned mov r2, #1 and r3, r0, #31 @ Get bit offset mov r0, r0, lsr #5 @@ -62,7 +62,7 @@ ENDPROC(\name ) ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 - strneb r1, [ip] @ assert word-aligned + strbne r1, [ip] @ assert word-aligned and r2, r0, #31 mov r0, r0, lsr #5 mov r3, #1 @@ -89,7 +89,7 @@ ENDPROC(\name ) ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 - strneb r1, [ip] @ assert word-aligned + strbne r1, [ip] @ assert word-aligned and r3, r0, #31 mov r0, r0, lsr #5 save_and_disable_irqs ip From patchwork Mon Jun 1 17:53:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DCE3C433E1 for ; Mon, 1 Jun 2020 18:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 355562073B for ; Mon, 1 Jun 2020 18:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034446; bh=4MGp3GhSPRW69gWgo1kGqYevai5ODOUvvSzkzf6cRa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KrSEli9HYl5vbLPx8sci1OF7FlTXsrgSEqnRDhyLbL/QdbSDByIEzH6eX2oXKnvpZ kFX1Slvw5Vqrr0knyVLpaN0QHIkPt9LWDbCfTU7p90t/2gi+Tg/O1Ik8RcFs6iqGZR Q/vvIqEuZCzCXI8fej0Tg41L5XdYdeRHE3lWl8Yo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729691AbgFASAo (ORCPT ); Mon, 1 Jun 2020 14:00:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:43470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729690AbgFASAn (ORCPT ); Mon, 1 Jun 2020 14:00:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4A4F2065C; Mon, 1 Jun 2020 18:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034443; bh=4MGp3GhSPRW69gWgo1kGqYevai5ODOUvvSzkzf6cRa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fY86HWTcibmDwhtPekMCt6RFx+DoZ1TK50zrwQtOfM8azz05nHUddtR5JS3T/Wn8g 6obxWi0zMWAjFYhMoPTHx4lGisXPG+8bXO8Otr2gdYLtNQ3ypjTZeYmqpY/S+LLSGE aaFoieHhHYy9ZKM/SWnJSbGZts1WnwMLudEG2ZCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , Sasha Levin Subject: [PATCH 4.14 34/77] ARM: uaccess: integrate uaccess_save and uaccess_restore Date: Mon, 1 Jun 2020 19:53:39 +0200 Message-Id: <20200601174022.668016202@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Russell King [ Upstream commit 8ede890b0bcebe8c760aacfe20e934d98c3dc6aa ] Integrate uaccess_save / uaccess_restore macros into the new uaccess_entry / uaccess_exit macros respectively. Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/include/asm/uaccess-asm.h | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h index d475e3e8145d..e46468b91eaa 100644 --- a/arch/arm/include/asm/uaccess-asm.h +++ b/arch/arm/include/asm/uaccess-asm.h @@ -67,30 +67,23 @@ #endif .endm - .macro uaccess_save, tmp #ifdef CONFIG_CPU_SW_DOMAIN_PAN - mrc p15, 0, \tmp, c3, c0, 0 - str \tmp, [sp, #SVC_DACR] -#endif - .endm - - .macro uaccess_restore -#ifdef CONFIG_CPU_SW_DOMAIN_PAN - ldr r0, [sp, #SVC_DACR] - mcr p15, 0, r0, c3, c0, 0 +#define DACR(x...) x +#else +#define DACR(x...) #endif - .endm /* * Save the address limit on entry to a privileged exception and * if using PAN, save and disable usermode access. */ .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable - ldr \tmp0, [\tsk, #TI_ADDR_LIMIT] - mov \tmp1, #TASK_SIZE - str \tmp1, [\tsk, #TI_ADDR_LIMIT] - str \tmp0, [sp, #SVC_ADDR_LIMIT] - uaccess_save \tmp0 + ldr \tmp1, [\tsk, #TI_ADDR_LIMIT] + mov \tmp2, #TASK_SIZE + str \tmp2, [\tsk, #TI_ADDR_LIMIT] + DACR( mrc p15, 0, \tmp0, c3, c0, 0) + DACR( str \tmp0, [sp, #SVC_DACR]) + str \tmp1, [sp, #SVC_ADDR_LIMIT] .if \disable uaccess_disable \tmp0 .endif @@ -99,8 +92,11 @@ /* Restore the user access state previously saved by uaccess_entry */ .macro uaccess_exit, tsk, tmp0, tmp1 ldr \tmp1, [sp, #SVC_ADDR_LIMIT] - uaccess_restore + DACR( ldr \tmp0, [sp, #SVC_DACR]) str \tmp1, [\tsk, #TI_ADDR_LIMIT] + DACR( mcr p15, 0, \tmp0, c3, c0, 0) .endm +#undef DACR + #endif /* __ASM_UACCESS_ASM_H__ */ From patchwork Mon Jun 1 17:53:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F442C433DF for ; Mon, 1 Jun 2020 18:56:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D1D1206C3 for ; Mon, 1 Jun 2020 18:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037772; bh=2ZPjej86uWTbLn4JuUOXaDIYjHQwrcYDh8zvLp7nqxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZYkg1WqfmclYqOl/Jr10V8z18DvxwPQcUheLVrXEyY5J2e2LDnwzZrKDWyCfXpwdO oOso/9I6rl1MLtWuuQ/UwXYY2StM9IK9sx6FgaO85rajXuJGOEE2nnRwZSH9fJrly9 tJEl9YzAk2eCJw5rhhMuXif9wOU2XKgJpqbtM4vE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729579AbgFAS4F (ORCPT ); Mon, 1 Jun 2020 14:56:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:43522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729697AbgFASAp (ORCPT ); Mon, 1 Jun 2020 14:00:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0AB34206E2; Mon, 1 Jun 2020 18:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034445; bh=2ZPjej86uWTbLn4JuUOXaDIYjHQwrcYDh8zvLp7nqxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7uauL5U9byjNVtvol6T1EhInkBTcOSUic8ojFEBbv77qr6Dzm5vYc9/ZvjimIxeE NGidboK+LUDoDQh+3Cmh2DIplCr1ypcblOK+pMuu06GBu269HwLjs3KRmHQr8lips2 2yUvByZHp/z81CuRfe09LEPK9feCYNeT9SZQp1Ns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomas Paukrt , Russell King , Sasha Levin Subject: [PATCH 4.14 35/77] ARM: uaccess: fix DACR mismatch with nested exceptions Date: Mon, 1 Jun 2020 19:53:40 +0200 Message-Id: <20200601174022.834527993@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Russell King [ Upstream commit 71f8af1110101facfad68989ff91f88f8e2c3e22 ] Tomas Paukrt reports that his SAM9X60 based system (ARM926, ARMv5TJ) fails to fix up alignment faults, eventually resulting in a kernel oops. The problem occurs when using CONFIG_CPU_USE_DOMAINS with commit e6978e4bf181 ("ARM: save and reset the address limit when entering an exception"). This is because the address limit is set back to TASK_SIZE on exception entry, and, although it is restored on exception exit, the domain register is not. Hence, this sequence can occur: interrupt pt_regs->addr_limit = addr_limit // USER_DS addr_limit = USER_DS alignment exception __probe_kernel_read() old_fs = get_fs() // USER_DS set_fs(KERNEL_DS) addr_limit = KERNEL_DS dacr.kernel = DOMAIN_MANAGER interrupt pt_regs->addr_limit = addr_limit // KERNEL_DS addr_limit = USER_DS alignment exception __probe_kernel_read() old_fs = get_fs() // USER_DS set_fs(KERNEL_DS) addr_limit = KERNEL_DS dacr.kernel = DOMAIN_MANAGER ... set_fs(old_fs) addr_limit = USER_DS dacr.kernel = DOMAIN_CLIENT ... addr_limit = pt_regs->addr_limit // KERNEL_DS interrupt returns At this point, addr_limit is correctly restored to KERNEL_DS for __probe_kernel_read() to continue execution, but dacr.kernel is not, it has been reset by the set_fs(old_fs) to DOMAIN_CLIENT. This would not have happened prior to the mentioned commit, because addr_limit would remain KERNEL_DS, so get_fs() would have returned KERNEL_DS, and so would correctly nest. This commit fixes the problem by also saving the DACR on exception entry if either CONFIG_CPU_SW_DOMAIN_PAN or CONFIG_CPU_USE_DOMAINS are enabled, and resetting the DACR appropriately on exception entry to match addr_limit and PAN settings. Fixes: e6978e4bf181 ("ARM: save and reset the address limit when entering an exception") Reported-by: Tomas Paukrt Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/include/asm/uaccess-asm.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h index e46468b91eaa..907571fd05c6 100644 --- a/arch/arm/include/asm/uaccess-asm.h +++ b/arch/arm/include/asm/uaccess-asm.h @@ -67,15 +67,21 @@ #endif .endm -#ifdef CONFIG_CPU_SW_DOMAIN_PAN +#if defined(CONFIG_CPU_SW_DOMAIN_PAN) || defined(CONFIG_CPU_USE_DOMAINS) #define DACR(x...) x #else #define DACR(x...) #endif /* - * Save the address limit on entry to a privileged exception and - * if using PAN, save and disable usermode access. + * Save the address limit on entry to a privileged exception. + * + * If we are using the DACR for kernel access by the user accessors + * (CONFIG_CPU_USE_DOMAINS=y), always reset the DACR kernel domain + * back to client mode, whether or not \disable is set. + * + * If we are using SW PAN, set the DACR user domain to no access + * if \disable is set. */ .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable ldr \tmp1, [\tsk, #TI_ADDR_LIMIT] @@ -84,8 +90,17 @@ DACR( mrc p15, 0, \tmp0, c3, c0, 0) DACR( str \tmp0, [sp, #SVC_DACR]) str \tmp1, [sp, #SVC_ADDR_LIMIT] - .if \disable - uaccess_disable \tmp0 + .if \disable && IS_ENABLED(CONFIG_CPU_SW_DOMAIN_PAN) + /* kernel=client, user=no access */ + mov \tmp2, #DACR_UACCESS_DISABLE + mcr p15, 0, \tmp2, c3, c0, 0 + instr_sync + .elseif IS_ENABLED(CONFIG_CPU_USE_DOMAINS) + /* kernel=client */ + bic \tmp2, \tmp0, #domain_mask(DOMAIN_KERNEL) + orr \tmp2, \tmp2, #domain_val(DOMAIN_KERNEL, DOMAIN_CLIENT) + mcr p15, 0, \tmp2, c3, c0, 0 + instr_sync .endif .endm From patchwork Mon Jun 1 17:53:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F382FC433DF for ; Mon, 1 Jun 2020 18:56:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D124420679 for ; Mon, 1 Jun 2020 18:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037763; bh=0fwH1kl3TnLGLnKNcAtcv7dUqXFLkD4bHPfFezszlEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Fyau2g+kvO1PSXTzEZUCl/bHLQF65XKMBl4u7ASQe23tzXpbCIMU5LILnNJ7L5TKk iLFV375l9jPNIlzt3omarnplM+YcHASRVcelvYEPxyG1QRtKKaGFrKdWSkl8j4zUsf 9Vq91btSdvEZNG2WJ3YQRqXd+WMyGr0FmHi/jGe8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728967AbgFASAx (ORCPT ); Mon, 1 Jun 2020 14:00:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:43642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729015AbgFASAw (ORCPT ); Mon, 1 Jun 2020 14:00:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B76772065C; Mon, 1 Jun 2020 18:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034452; bh=0fwH1kl3TnLGLnKNcAtcv7dUqXFLkD4bHPfFezszlEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sJG3Mnk6TqgZzUI4oTjH7XzaNcbCOwq8C96zk66RWPy+wJNmeDzM1/j5j3RX7ITZ5 +XWsJD/vLv74qFVNym4shfWueM39g8VhMCZPp3kRdQig0qL5ypVuNv2qt7jFH9wu3C 50w6wD95b0sg2WultJR3rdUYiKxnhktiGHdue4+Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lin Yi , Mike Marciniszyn , Kaike Wan , Dennis Dalessandro , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 37/77] IB/qib: Call kobject_put() when kobject_init_and_add() fails Date: Mon, 1 Jun 2020 19:53:42 +0200 Message-Id: <20200601174023.151917029@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kaike Wan [ Upstream commit a35cd6447effd5c239b564c80fa109d05ff3d114 ] When kobject_init_and_add() returns an error in the function qib_create_port_files(), the function kobject_put() is not called for the corresponding kobject, which potentially leads to memory leak. This patch fixes the issue by calling kobject_put() even if kobject_init_and_add() fails. In addition, the ppd->diagc_kobj is released along with other kobjects when the sysfs is unregistered. Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Link: https://lore.kernel.org/r/20200512031328.189865.48627.stgit@awfm-01.aw.intel.com Cc: Suggested-by: Lin Yi Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/qib/qib_sysfs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c index d831f3e61ae8..2626205780ee 100644 --- a/drivers/infiniband/hw/qib/qib_sysfs.c +++ b/drivers/infiniband/hw/qib/qib_sysfs.c @@ -756,7 +756,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, qib_dev_err(dd, "Skipping linkcontrol sysfs info, (err %d) port %u\n", ret, port_num); - goto bail; + goto bail_link; } kobject_uevent(&ppd->pport_kobj, KOBJ_ADD); @@ -766,7 +766,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, qib_dev_err(dd, "Skipping sl2vl sysfs info, (err %d) port %u\n", ret, port_num); - goto bail_link; + goto bail_sl; } kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD); @@ -776,7 +776,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, qib_dev_err(dd, "Skipping diag_counters sysfs info, (err %d) port %u\n", ret, port_num); - goto bail_sl; + goto bail_diagc; } kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD); @@ -789,7 +789,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, qib_dev_err(dd, "Skipping Congestion Control sysfs info, (err %d) port %u\n", ret, port_num); - goto bail_diagc; + goto bail_cc; } kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD); @@ -871,6 +871,7 @@ void qib_verbs_unregister_sysfs(struct qib_devdata *dd) &cc_table_bin_attr); kobject_put(&ppd->pport_cc_kobj); } + kobject_put(&ppd->diagc_kobj); kobject_put(&ppd->sl2vl_kobj); kobject_put(&ppd->pport_kobj); } From patchwork Mon Jun 1 17:53:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59CA7C433DF for ; Mon, 1 Jun 2020 18:00:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F1DC2073B for ; Mon, 1 Jun 2020 18:00:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034459; bh=66iuDiF/gA+232VOa28AdKQaZlJM8eguxmtMywYIR5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Icif1WRif0vqnPcysztIbFoUhzkYE0MKK4Oc96linkixr0MgXatSIh7P+owvOnG/d ey8sW7qfuQ1G3jGqLY5tJstM+IHixpBxEY9VPncE8lYFRIBnZ1AWy3zFHDCMOrDmMk dqTm/FUAp5vZ0+XMiTfxZwffRdXXxLnzjyD/rGEw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729720AbgFASA5 (ORCPT ); Mon, 1 Jun 2020 14:00:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729027AbgFASAy (ORCPT ); Mon, 1 Jun 2020 14:00:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F14F3206E2; Mon, 1 Jun 2020 18:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034454; bh=66iuDiF/gA+232VOa28AdKQaZlJM8eguxmtMywYIR5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Un63yAKmW6eM+RISCog3uANBrnvuh94E9qLxEcoKmsANrzwTZQgqSXqPSZT7Pp6e X2kf9gM6WBFJgUODsM7SZx0eu1xWbeiNXY0MibPn2yz6VoQMNDqEP9ta/ohT7M9abN pV9/fGfZw+UzVgNo2Iw62pCwFz7s5lAb9GXsaHQo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Reichel , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 38/77] ARM: dts: imx6q-bx50v3: Add internal switch Date: Mon, 1 Jun 2020 19:53:43 +0200 Message-Id: <20200601174023.316856026@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sebastian Reichel [ Upstream commit e26dead442689a861358f33126210b0f8de615a9 ] B850v3, B650v3 and B450v3 all have a GPIO bit banged MDIO bus to communicate with a Marvell switch. On all devices the switch is connected to a PCI based network card, which needs to be referenced by DT, so this also adds the common PCI root node. Signed-off-by: Sebastian Reichel Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- arch/arm/boot/dts/imx6q-bx50v3.dtsi | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/arch/arm/boot/dts/imx6q-bx50v3.dtsi b/arch/arm/boot/dts/imx6q-bx50v3.dtsi index 1015e55ca8f7..8420378d095d 100644 --- a/arch/arm/boot/dts/imx6q-bx50v3.dtsi +++ b/arch/arm/boot/dts/imx6q-bx50v3.dtsi @@ -92,6 +92,56 @@ mux-int-port = <1>; mux-ext-port = <4>; }; + + aliases { + mdio-gpio0 = &mdio0; + }; + + mdio0: mdio-gpio { + compatible = "virtual,mdio-gpio"; + gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>, /* mdc */ + <&gpio2 7 GPIO_ACTIVE_HIGH>; /* mdio */ + + #address-cells = <1>; + #size-cells = <0>; + + switch@0 { + compatible = "marvell,mv88e6085"; /* 88e6240*/ + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + switch_ports: ports { + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + switchphy0: switchphy@0 { + reg = <0>; + }; + + switchphy1: switchphy@1 { + reg = <1>; + }; + + switchphy2: switchphy@2 { + reg = <2>; + }; + + switchphy3: switchphy@3 { + reg = <3>; + }; + + switchphy4: switchphy@4 { + reg = <4>; + }; + }; + }; + }; }; &ecspi5 { @@ -326,3 +376,15 @@ tcxo-clock-frequency = <26000000>; }; }; + +&pcie { + /* Synopsys, Inc. Device */ + pci_root: root@0,0 { + compatible = "pci16c3,abcd"; + reg = <0x00000000 0 0 0 0>; + + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + }; +}; From patchwork Mon Jun 1 17:53:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4FE0C433E0 for ; Mon, 1 Jun 2020 18:55:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3D5820872 for ; Mon, 1 Jun 2020 18:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037758; bh=mLNn3yn5BCIPZ460pohBxEcmBo7jmel2BEb77JX38QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pnN8RQtaAXAOo7DXnXP0l+UhRuzVuYGnv2w7BA8deNn49fhJc1M6hy2l8JrFEYaxP 34vqlhvuFDx5kYTLuaEOpXQEmWyKqpTzn+P1pgzYneazFr3m8PrsmfstKb+277o1WD qFRipOJXH4+a0bpBouH4lQaUocRYwM1uOUbBBPag= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729725AbgFASBA (ORCPT ); Mon, 1 Jun 2020 14:01:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:43792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729721AbgFASA7 (ORCPT ); Mon, 1 Jun 2020 14:00:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6EA7A206E2; Mon, 1 Jun 2020 18:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034458; bh=mLNn3yn5BCIPZ460pohBxEcmBo7jmel2BEb77JX38QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G6LsCPynrE7lWoKRMRg3Uq9fI8v3HQkYUP2Klh+bSwbTkt8gK73omAnF4Jgryor/v 1pJPNF+mvM+ANgcrMlEZlmPdmb1+A13OZqu7639361n9aJq9GL+GEft7s2RNWbqrHo mXP6kPltBGr+YTBShw/pMr4RwgtQEH+u8rYfkSVQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Vincent_Stehl=C3=A9?= , Stefan Wahren , Florian Fainelli , Sasha Levin Subject: [PATCH 4.14 40/77] ARM: dts: bcm2835-rpi-zero-w: Fix led polarity Date: Mon, 1 Jun 2020 19:53:45 +0200 Message-Id: <20200601174023.622966561@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vincent Stehlé [ Upstream commit 58bb90ab415562eededb932455046924e65df342 ] The status "ACT" led on the Raspberry Pi Zero W is on when GPIO 47 is low. This has been verified on a board and somewhat confirmed by both the GPIO name ("STATUS_LED_N") and the reduced schematics [1]. [1]: https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_ZeroW_1p1_reduced.pdf Fixes: 2c7c040c73e9 ("ARM: dts: bcm2835: Add Raspberry Pi Zero W") Signed-off-by: Vincent Stehlé Cc: Stefan Wahren Cc: Florian Fainelli Tested-by: Stefan Wahren Signed-off-by: Florian Fainelli Signed-off-by: Sasha Levin --- arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts index e5f2cca86f04..120776d45441 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts @@ -25,7 +25,7 @@ leds { act { - gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 47 GPIO_ACTIVE_LOW>; }; }; From patchwork Mon Jun 1 17:53:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 558C7C433E1 for ; Mon, 1 Jun 2020 18:55:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A98820679 for ; Mon, 1 Jun 2020 18:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037757; bh=lYfWziiWkn5jLrFvpyipxsyoD5WcN1/v/djhZEq/Zl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oRQq8UB2YurWsoeKL1FbuR7sULiqwcPk+nPqd+PybNRn2BgQzHB2UxFuRmHLKdey1 pIU/+5SE9+2LiJG+6Lb3gJfqFm3dWqSX8E6K2Y+/cAfeWS7xxxkemITnkRuNNI647Q T67LC22scvFl6ERpi2hufudze2Ibcpdu3BwFgYe8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730329AbgFASzo (ORCPT ); Mon, 1 Jun 2020 14:55:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:43926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729147AbgFASBG (ORCPT ); Mon, 1 Jun 2020 14:01:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F4F52065C; Mon, 1 Jun 2020 18:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034465; bh=lYfWziiWkn5jLrFvpyipxsyoD5WcN1/v/djhZEq/Zl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzqgcdamKkP89RxeOdvxFrKv02bkkrhwGCafGpzWrNCWaNftu5U3x4h7mUKH3jX6G NyWi5MK++RxEpglaJ+Etwx8qHQBClUPbGUtAKBdNZ9Z1m/fx7QQ/2yaawsWLdu5C0j m3pmunmWJmVcFkcbpHQrRgmfsgaxtdJgwiZoC9Yc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changming Liu , Takashi Iwai , Sasha Levin Subject: [PATCH 4.14 43/77] ALSA: hwdep: fix a left shifting 1 by 31 UB bug Date: Mon, 1 Jun 2020 19:53:48 +0200 Message-Id: <20200601174024.147973386@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Changming Liu [ Upstream commit fb8cd6481ffd126f35e9e146a0dcf0c4e8899f2e ] The "info.index" variable can be 31 in "1 << info.index". This might trigger an undefined behavior since 1 is signed. Fix this by casting 1 to 1u just to be sure "1u << 31" is defined. Signed-off-by: Changming Liu Cc: Link: https://lore.kernel.org/r/BL0PR06MB4548170B842CB055C9AF695DE5B00@BL0PR06MB4548.namprd06.prod.outlook.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/core/hwdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index a73baa1242be..727219f40201 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -229,14 +229,14 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw, if (copy_from_user(&info, _info, sizeof(info))) return -EFAULT; /* check whether the dsp was already loaded */ - if (hw->dsp_loaded & (1 << info.index)) + if (hw->dsp_loaded & (1u << info.index)) return -EBUSY; if (!access_ok(VERIFY_READ, info.image, info.length)) return -EFAULT; err = hw->ops.dsp_load(hw, &info); if (err < 0) return err; - hw->dsp_loaded |= (1 << info.index); + hw->dsp_loaded |= (1u << info.index); return 0; } From patchwork Mon Jun 1 17:53:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C504C433E0 for ; Mon, 1 Jun 2020 18:55:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72DEF20679 for ; Mon, 1 Jun 2020 18:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037743; bh=Qgy1DkMyJttUV/EGcXoWIBjsNpldUuS9juZMdzMfCXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xqOZHeZo9BGCkfRoQlsCZyaD7kJkZfNg9fOLoHMJeoHo9/bvshfynQPuN4ilxH/Pg 1tUq/iwQjlwFh6/lmweE9kVbmbHQ9YLMhQyavDtIx/zJLAB9IWWw+LU426tEiCrXAl QfwvaeLbTgniNGY4PwquGqFD26y2eAhllA85TWyA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729748AbgFASBL (ORCPT ); Mon, 1 Jun 2020 14:01:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:44022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729088AbgFASBK (ORCPT ); Mon, 1 Jun 2020 14:01:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 942912074B; Mon, 1 Jun 2020 18:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034470; bh=Qgy1DkMyJttUV/EGcXoWIBjsNpldUuS9juZMdzMfCXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KykdM8YfMK7978oQSvS94Rzh9XLKWpqX4hWShhjC6q/0wU2hOjVtMtkk+3MMqjHXk fBHD2q9WrsZSl+T7Z7HOPlCF0T1QNiPKgp97zZPgPrJoNghU8Uc+eYX6cbpLBQw4yD cvNKnrjfFL/dA4npI02rODtXaysH+bPjNNmBj38w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Lutomirski , "Eric W. Biederman" , Sasha Levin Subject: [PATCH 4.14 45/77] exec: Always set cap_ambient in cap_bprm_set_creds Date: Mon, 1 Jun 2020 19:53:50 +0200 Message-Id: <20200601174024.413430570@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric W. Biederman [ Upstream commit a4ae32c71fe90794127b32d26d7ad795813b502e ] An invariant of cap_bprm_set_creds is that every field in the new cred structure that cap_bprm_set_creds might set, needs to be set every time to ensure the fields does not get a stale value. The field cap_ambient is not set every time cap_bprm_set_creds is called, which means that if there is a suid or sgid script with an interpreter that has neither the suid nor the sgid bits set the interpreter should be able to accept ambient credentials. Unfortuantely because cap_ambient is not reset to it's original value the interpreter can not accept ambient credentials. Given that the ambient capability set is expected to be controlled by the caller, I don't think this is particularly serious. But it is definitely worth fixing so the code works correctly. I have tested to verify my reading of the code is correct and the interpreter of a sgid can receive ambient capabilities with this change and cannot receive ambient capabilities without this change. Cc: stable@vger.kernel.org Cc: Andy Lutomirski Fixes: 58319057b784 ("capabilities: ambient capabilities") Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin --- security/commoncap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/commoncap.c b/security/commoncap.c index ae26ef006988..ac031fa39190 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -711,6 +711,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm) int ret; kuid_t root_uid; + new->cap_ambient = old->cap_ambient; if (WARN_ON(!cap_ambient_invariant_ok(old))) return -EPERM; From patchwork Mon Jun 1 17:53:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9750C433DF for ; Mon, 1 Jun 2020 18:01:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8AEB620842 for ; Mon, 1 Jun 2020 18:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034481; bh=vqPe5wXWGtJi+pj6tIvR74j3GVkV7y51TSDQ7QNwyqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0c4QNXq9tSt3D3xL0J8kub7O8q0O2uqE9M1p5a0kRfDDzQT1p9yvE/4C39uITJzmI jdUWjVfZ07dqS/o/zOCccSSi6dlOYMC77l1aVkq7HSVuZ9G/QIvHIiBmUyCafxAx3a EGf2WkpJ3yvikfbre15LQHQs4vx1VaQPNRO0gzjg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729769AbgFASBU (ORCPT ); Mon, 1 Jun 2020 14:01:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:44226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729763AbgFASBT (ORCPT ); Mon, 1 Jun 2020 14:01:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 80C2A2065C; Mon, 1 Jun 2020 18:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034478; bh=vqPe5wXWGtJi+pj6tIvR74j3GVkV7y51TSDQ7QNwyqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nCXnZoKqoa+DWWf9tYP1hFDDMuSxrQaUd43HC4QXsDEmiXdeyOPIP03PgPLCI9uO7 g9iMWizc6uptFO/RrKig1jtIKe6gbk8Y1VOg31vqPZNX0Qa6glpHHW1xwTCz3B0T2/ Kk+gNWz/maehAytoV+3uRZqLHYeU5PLTXmGFn3pY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konstantin Khlebnikov , Andrew Morton , Hugh Dickins , "Kirill A. Shutemov" , Vlastimil Babka , David Rientjes , Linus Torvalds , Sasha Levin Subject: [PATCH 4.14 48/77] mm: remove VM_BUG_ON(PageSlab()) from page_mapcount() Date: Mon, 1 Jun 2020 19:53:53 +0200 Message-Id: <20200601174024.954046040@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Konstantin Khlebnikov [ Upstream commit 6988f31d558aa8c744464a7f6d91d34ada48ad12 ] Replace superfluous VM_BUG_ON() with comment about correct usage. Technically reverts commit 1d148e218a0d ("mm: add VM_BUG_ON_PAGE() to page_mapcount()"), but context lines have changed. Function isolate_migratepages_block() runs some checks out of lru_lock when choose pages for migration. After checking PageLRU() it checks extra page references by comparing page_count() and page_mapcount(). Between these two checks page could be removed from lru, freed and taken by slab. As a result this race triggers VM_BUG_ON(PageSlab()) in page_mapcount(). Race window is tiny. For certain workload this happens around once a year. page:ffffea0105ca9380 count:1 mapcount:0 mapping:ffff88ff7712c180 index:0x0 compound_mapcount: 0 flags: 0x500000000008100(slab|head) raw: 0500000000008100 dead000000000100 dead000000000200 ffff88ff7712c180 raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(PageSlab(page)) ------------[ cut here ]------------ kernel BUG at ./include/linux/mm.h:628! invalid opcode: 0000 [#1] SMP NOPTI CPU: 77 PID: 504 Comm: kcompactd1 Tainted: G W 4.19.109-27 #1 Hardware name: Yandex T175-N41-Y3N/MY81-EX0-Y3N, BIOS R05 06/20/2019 RIP: 0010:isolate_migratepages_block+0x986/0x9b0 The code in isolate_migratepages_block() was added in commit 119d6d59dcc0 ("mm, compaction: avoid isolating pinned pages") before adding VM_BUG_ON into page_mapcount(). This race has been predicted in 2015 by Vlastimil Babka (see link below). [akpm@linux-foundation.org: comment tweaks, per Hugh] Fixes: 1d148e218a0d ("mm: add VM_BUG_ON_PAGE() to page_mapcount()") Signed-off-by: Konstantin Khlebnikov Signed-off-by: Andrew Morton Acked-by: Hugh Dickins Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka Cc: David Rientjes Cc: Link: http://lkml.kernel.org/r/159032779896.957378.7852761411265662220.stgit@buzz Link: https://lore.kernel.org/lkml/557710E1.6060103@suse.cz/ Link: https://lore.kernel.org/linux-mm/158937872515.474360.5066096871639561424.stgit@buzz/T/ (v1) Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/mm.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 858ce84ac7c5..6f852d5fbada 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -549,6 +549,11 @@ static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags) extern void kvfree(const void *addr); +/* + * Mapcount of compound page as a whole, does not include mapped sub-pages. + * + * Must be called only for compound pages or any their tail sub-pages. + */ static inline int compound_mapcount(struct page *page) { VM_BUG_ON_PAGE(!PageCompound(page), page); @@ -568,10 +573,16 @@ static inline void page_mapcount_reset(struct page *page) int __page_mapcount(struct page *page); +/* + * Mapcount of 0-order page; when compound sub-page, includes + * compound_mapcount(). + * + * Result is undefined for pages which cannot be mapped into userspace. + * For example SLAB or special types of pages. See function page_has_type(). + * They use this place in struct page differently. + */ static inline int page_mapcount(struct page *page) { - VM_BUG_ON_PAGE(PageSlab(page), page); - if (unlikely(PageCompound(page))) return __page_mapcount(page); return atomic_read(&page->_mapcount) + 1; From patchwork Mon Jun 1 17:53:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,TVD_SPACE_RATIO,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A91ADC433DF for ; Mon, 1 Jun 2020 18:01:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C10D207DF for ; Mon, 1 Jun 2020 18:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034485; bh=HFNk47jELaw7uwMh7fkT5nlGQFTfz2GICQHMXpjGHI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uFcS2ztJTsKic6uaiImPqLxVQw2pYZrjkeW+tzE/AYEhabib0K7eMwxjeXlZ64+m/ lqMRyPfBvWV2VaPznSBcrMrtyQYrGtvZ2VF9AbhDBL7Xc2XRa+Lirxd0hfVPj0DSgO z1vs7SeMIjNWQxZ3eOtIsHdeW9f+NFxbEPDnCVCE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729783AbgFASBY (ORCPT ); Mon, 1 Jun 2020 14:01:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:44344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729779AbgFASBX (ORCPT ); Mon, 1 Jun 2020 14:01:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D9CC52065C; Mon, 1 Jun 2020 18:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034483; bh=HFNk47jELaw7uwMh7fkT5nlGQFTfz2GICQHMXpjGHI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p49JAdnEKIuUYphNS2Ru6FPP4rUBx/5KbOIOq48yWqgr+cG4fDdiNnG85uCiUbsh5 loioLgqPO8/93xINegOBjr+pg4eX9ZlCdRXTNFFi2l7gSpeOEZ8Tx1pFAF5O8KhYgd 2tZFJFWxPoHTlz0wGRzT1nJZut8mPGqzdE7H1y6s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Andrew Morton , Guenter Roeck , Linus Torvalds , Sasha Levin Subject: [PATCH 4.14 50/77] include/asm-generic/topology.h: guard cpumask_of_node() macro argument Date: Mon, 1 Jun 2020 19:53:55 +0200 Message-Id: <20200601174025.236191511@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 4377748c7b5187c3342a60fa2ceb60c8a57a8488 ] drivers/hwmon/amd_energy.c:195:15: error: invalid operands to binary expression ('void' and 'int') (channel - data->nr_cpus)); ~~~~~~~~~^~~~~~~~~~~~~~~~~ include/asm-generic/topology.h:51:42: note: expanded from macro 'cpumask_of_node' #define cpumask_of_node(node) ((void)node, cpu_online_mask) ^~~~ include/linux/cpumask.h:618:72: note: expanded from macro 'cpumask_first_and' #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p)) ^~~~~ Fixes: f0b848ce6fe9 ("cpumask: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask") Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters") Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton Acked-by: Guenter Roeck Link: http://lkml.kernel.org/r/20200527134623.930247-1-arnd@arndb.de Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/asm-generic/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index 5d2add1a6c96..864fcfa1df41 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -51,7 +51,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask) #else - #define cpumask_of_node(node) ((void)node, cpu_online_mask) + #define cpumask_of_node(node) ((void)(node), cpu_online_mask) #endif #endif #ifndef pcibus_to_node From patchwork Mon Jun 1 17:53:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33167C433DF for ; Mon, 1 Jun 2020 18:55:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F21D207DA for ; Mon, 1 Jun 2020 18:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037734; bh=Mvfv2+LDVLuaAE1w+GSOU7T1whIkDcVbpt5nCCZrk9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PKBCLFSV6tSgB2GeVObT26qUJoAqUQYTM6y+5A6Bl1XUy3HMRkdddIyl1sCD2Vbr6 xLcl/iGe5VeCvhuNWOVyvktLdfBZGeRoknORKIUTex5wCdKvvlm2pGQcZ3a44pVmd+ /4KOthc5j50n+x0zNtsZ/5XoLujreCU1qdvZQ/Vg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729792AbgFASza (ORCPT ); Mon, 1 Jun 2020 14:55:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:44384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729785AbgFASB0 (ORCPT ); Mon, 1 Jun 2020 14:01:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D40620776; Mon, 1 Jun 2020 18:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034485; bh=Mvfv2+LDVLuaAE1w+GSOU7T1whIkDcVbpt5nCCZrk9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWZLICT+e0oC7POFNqY/+e/utqK2uGl7gARR/W29SHmDYCrBCxGzzfNyyUyn0sh1X VwzvKJ2HvZxUdohOldvFFBvs+vbHVIXpPRuzzTd4ZLJpJg7g3qRhpaVyg2NIVKemSz 1teecKDX8CuHOqLrm8Lv9QXLMFO/qqePLqkl8AqU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , Joerg Roedel , Sasha Levin Subject: [PATCH 4.14 51/77] iommu: Fix reference count leak in iommu_group_alloc. Date: Mon, 1 Jun 2020 19:53:56 +0200 Message-Id: <20200601174025.379297364@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Qiushi Wu [ Upstream commit 7cc31613734c4870ae32f5265d576ef296621343 ] kobject_init_and_add() takes reference even when it fails. Thus, when kobject_init_and_add() returns an error, kobject_put() must be called to properly clean up the kobject. Fixes: d72e31c93746 ("iommu: IOMMU Groups") Signed-off-by: Qiushi Wu Link: https://lore.kernel.org/r/20200527210020.6522-1-wu000273@umn.edu Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -359,7 +359,7 @@ struct iommu_group *iommu_group_alloc(vo NULL, "%d", group->id); if (ret) { ida_simple_remove(&iommu_group_ida, group->id); - kfree(group); + kobject_put(&group->kobj); return ERR_PTR(ret); } From patchwork Mon Jun 1 17:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6A08C433DF for ; Mon, 1 Jun 2020 18:55:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9380B206C3 for ; Mon, 1 Jun 2020 18:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037718; bh=N0l1RPeo1SlGImHH28ykJupX+PqrhocXisBt8WWswmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iGyS1vfZmvTIHQsBVZdsJyLJamqCrCtvLxPB8YvMuN1iZgM9YoZ85vqnOHwO7yqEH HAwIQX4BL0KwW1oq1PtrAPofa70wcUVhI9hMqPZkPiqfhPg3RuxH0BMrgoG6eMvUTk xmJMHVM0SC48cJyeK7XYI+/mVKEzGBVKgMD0DpOI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728263AbgFASzJ (ORCPT ); Mon, 1 Jun 2020 14:55:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729809AbgFASBd (ORCPT ); Mon, 1 Jun 2020 14:01:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A96112073B; Mon, 1 Jun 2020 18:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034492; bh=N0l1RPeo1SlGImHH28ykJupX+PqrhocXisBt8WWswmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wwnwf/Jo+VibTriLs5Utn45Ttqj9o4n6flB9xvlXTtYhsnSaMJ8+TVaHrm+FFhGTT Y+7I8Wtt4+XmJp+m6SkuL2AD/GnZoD82suGN2M1Bhn//W2CPHC6ib17xZuQcSVuj5R V5h6bU/wSgaa/nVGCk7JTXMssQqZpmYEhMLzIFR8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Jenkins , Robin Murphy , Alexander Dahl , Borislav Petkov Subject: [PATCH 4.14 54/77] x86/dma: Fix max PFN arithmetic overflow on 32 bit systems Date: Mon, 1 Jun 2020 19:53:59 +0200 Message-Id: <20200601174025.781995133@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexander Dahl commit 88743470668ef5eb6b7ba9e0f99888e5999bf172 upstream. The intermediate result of the old term (4UL * 1024 * 1024 * 1024) is 4 294 967 296 or 0x100000000 which is no problem on 64 bit systems. The patch does not change the later overall result of 0x100000 for MAX_DMA32_PFN (after it has been shifted by PAGE_SHIFT). The new calculation yields the same result, but does not require 64 bit arithmetic. On 32 bit systems the old calculation suffers from an arithmetic overflow in that intermediate term in braces: 4UL aka unsigned long int is 4 byte wide and an arithmetic overflow happens (the 0x100000000 does not fit in 4 bytes), the in braces result is truncated to zero, the following right shift does not alter that, so MAX_DMA32_PFN evaluates to 0 on 32 bit systems. That wrong value is a problem in a comparision against MAX_DMA32_PFN in the init code for swiotlb in pci_swiotlb_detect_4gb() to decide if swiotlb should be active. That comparison yields the opposite result, when compiling on 32 bit systems. This was not possible before 1b7e03ef7570 ("x86, NUMA: Enable emulation on 32bit too") when that MAX_DMA32_PFN was first made visible to x86_32 (and which landed in v3.0). In practice this wasn't a problem, unless CONFIG_SWIOTLB is active on x86-32. However if one has set CONFIG_IOMMU_INTEL, since c5a5dc4cbbf4 ("iommu/vt-d: Don't switch off swiotlb if bounce page is used") there's a dependency on CONFIG_SWIOTLB, which was not necessarily active before. That landed in v5.4, where we noticed it in the fli4l Linux distribution. We have CONFIG_IOMMU_INTEL active on both 32 and 64 bit kernel configs there (I could not find out why, so let's just say historical reasons). The effect is at boot time 64 MiB (default size) were allocated for bounce buffers now, which is a noticeable amount of memory on small systems like pcengines ALIX 2D3 with 256 MiB memory, which are still frequently used as home routers. We noticed this effect when migrating from kernel v4.19 (LTS) to v5.4 (LTS) in fli4l and got that kernel messages for example: Linux version 5.4.22 (buildroot@buildroot) (gcc version 7.3.0 (Buildroot 2018.02.8)) #1 SMP Mon Nov 26 23:40:00 CET 2018 … Memory: 183484K/261756K available (4594K kernel code, 393K rwdata, 1660K rodata, 536K init, 456K bss , 78272K reserved, 0K cma-reserved, 0K highmem) … PCI-DMA: Using software bounce buffering for IO (SWIOTLB) software IO TLB: mapped [mem 0x0bb78000-0x0fb78000] (64MB) The initial analysis and the suggested fix was done by user 'sourcejedi' at stackoverflow and explicitly marked as GPLv2 for inclusion in the Linux kernel: https://unix.stackexchange.com/a/520525/50007 The new calculation, which does not suffer from that overflow, is the same as for arch/mips now as suggested by Robin Murphy. The fix was tested by fli4l users on round about two dozen different systems, including both 32 and 64 bit archs, bare metal and virtualized machines. [ bp: Massage commit message. ] Fixes: 1b7e03ef7570 ("x86, NUMA: Enable emulation on 32bit too") Reported-by: Alan Jenkins Suggested-by: Robin Murphy Signed-off-by: Alexander Dahl Signed-off-by: Borislav Petkov Reviewed-by: Greg Kroah-Hartman Cc: stable@vger.kernel.org Link: https://unix.stackexchange.com/q/520065/50007 Link: https://web.nettworks.org/bugs/browse/FFL-2560 Link: https://lkml.kernel.org/r/20200526175749.20742-1-post@lespocky.de Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/dma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/include/asm/dma.h +++ b/arch/x86/include/asm/dma.h @@ -74,7 +74,7 @@ #define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT) /* 4GB broken PCI/AGP hardware bus master zone */ -#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT) +#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT)) #ifdef CONFIG_X86_32 /* The maximum address that we can perform a DMA transfer to on this platform */ From patchwork Mon Jun 1 17:54:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C39A8C433E1 for ; Mon, 1 Jun 2020 18:01:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CE2220870 for ; Mon, 1 Jun 2020 18:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034501; bh=icln9GYrwczbeL9oIDaFajP22+KfqMbesbbmd5dp2K4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e+kEUywo2ehs6EbejyjABw2gBrt4JeBG+eEfJ47Ru020YU4ScYzCluDPgStlbL0rg axcgce2/VSGBsoL1lWJzGG+8eFj6C3FPT3Me2hkGjDCZDmPmNg2c3a7q8F9TNz8cw3 zukCmXi+AZx0vnr0MY0ilW3H9Uz0k93batHB45q8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729820AbgFASBj (ORCPT ); Mon, 1 Jun 2020 14:01:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:44614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728688AbgFASBh (ORCPT ); Mon, 1 Jun 2020 14:01:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 309962077D; Mon, 1 Jun 2020 18:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034496; bh=icln9GYrwczbeL9oIDaFajP22+KfqMbesbbmd5dp2K4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzFdAckMKMnJ6aJvdkV96ih5X3N+pHnRcPGmZyE+B93TVtoiwIZOtpXM//K4wgAL4 GkZi+2GrMGEzuxDYSHRY9RKXXrkElxMPm8u1qsFWD3elfTYLlbAxL15ln+QXimBv5L N+1vzsyTEZB9gOVjJwnISqZuONstEksb3T0XXqJA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , Steffen Klassert Subject: [PATCH 4.14 56/77] xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input Date: Mon, 1 Jun 2020 19:54:01 +0200 Message-Id: <20200601174026.129111172@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xin Long commit afcaf61be9d1dbdee5ec186d1dcc67b6b692180f upstream. For beet mode, when it's ipv6 inner address with nexthdrs set, the packet format might be: ---------------------------------------------------- | outer | | dest | | | ESP | ESP | | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV | ---------------------------------------------------- The nexthdr from ESP could be NEXTHDR_HOP(0), so it should continue processing the packet when nexthdr returns 0 in xfrm_input(). Otherwise, when ipv6 nexthdr is set, the packet will be dropped. I don't see any error cases that nexthdr may return 0. So fix it by removing the check for nexthdr == 0. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xin Long Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman --- net/xfrm/xfrm_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -402,7 +402,7 @@ resume: dev_put(skb->dev); spin_lock(&x->lock); - if (nexthdr <= 0) { + if (nexthdr < 0) { if (nexthdr == -EBADMSG) { xfrm_audit_state_icvfail(x, skb, x->type->proto); From patchwork Mon Jun 1 17:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225114 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BB40C433DF for ; Mon, 1 Jun 2020 18:01:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E191B20870 for ; Mon, 1 Jun 2020 18:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034505; bh=IcpnxHIxGuV4/d90h6QEyv3BV8vod2o5wUpxt9Rtmf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1x4aYC8lXtngelJqBiL1/ojB1rOmWxijT4CNpLeHonsJBzoDf5ux/e6YRXHtYUFkZ qU3oWBSLFHH7jC0jcayct2MxOLtofnSmh2QVG2L9GmTOMiIruIw4VXyll5t244Cbus zXhk3YhCKUHwMCmNyQWk+wiPTsIcf31ntLq7sQ74= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729826AbgFASBp (ORCPT ); Mon, 1 Jun 2020 14:01:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:44754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729821AbgFASBn (ORCPT ); Mon, 1 Jun 2020 14:01:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDD052073B; Mon, 1 Jun 2020 18:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034503; bh=IcpnxHIxGuV4/d90h6QEyv3BV8vod2o5wUpxt9Rtmf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VomXsRWdOlsIwiMMYd9heJKCd9PCCHPZi2st0E+hD4n5nRso8nqc/pqmUpBta1tEt LtBMQ+ub6KxGAVXPIxUxlPoW5UVAkEuZn60NaZeU1BE3l7Y9U2fCnCoKq66k18SkM2 g65ZXGZrhgmttKfNuDhMAVvI7XqxRtk9htjPJrwk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiumei Mu , Xin Long , Steffen Klassert Subject: [PATCH 4.14 58/77] xfrm: fix a warning in xfrm_policy_insert_list Date: Mon, 1 Jun 2020 19:54:03 +0200 Message-Id: <20200601174026.512034194@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xin Long commit ed17b8d377eaf6b4a01d46942b4c647378a79bdd upstream. This waring can be triggered simply by: # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ priority 1 mark 0 mask 0x10 #[1] # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ priority 2 mark 0 mask 0x1 #[2] # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ priority 2 mark 0 mask 0x10 #[3] Then dmesg shows: [ ] WARNING: CPU: 1 PID: 7265 at net/xfrm/xfrm_policy.c:1548 [ ] RIP: 0010:xfrm_policy_insert_list+0x2f2/0x1030 [ ] Call Trace: [ ] xfrm_policy_inexact_insert+0x85/0xe50 [ ] xfrm_policy_insert+0x4ba/0x680 [ ] xfrm_add_policy+0x246/0x4d0 [ ] xfrm_user_rcv_msg+0x331/0x5c0 [ ] netlink_rcv_skb+0x121/0x350 [ ] xfrm_netlink_rcv+0x66/0x80 [ ] netlink_unicast+0x439/0x630 [ ] netlink_sendmsg+0x714/0xbf0 [ ] sock_sendmsg+0xe2/0x110 The issue was introduced by Commit 7cb8a93968e3 ("xfrm: Allow inserting policies with matching mark and different priorities"). After that, the policies [1] and [2] would be able to be added with different priorities. However, policy [3] will actually match both [1] and [2]. Policy [1] was matched due to the 1st 'return true' in xfrm_policy_mark_match(), and policy [2] was matched due to the 2nd 'return true' in there. It caused WARN_ON() in xfrm_policy_insert_list(). This patch is to fix it by only (the same value and priority) as the same policy in xfrm_policy_mark_match(). Thanks to Yuehaibing, we could make this fix better. v1->v2: - check policy->mark.v == pol->mark.v only without mask. Fixes: 7cb8a93968e3 ("xfrm: Allow inserting policies with matching mark and different priorities") Reported-by: Xiumei Mu Signed-off-by: Xin Long Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman --- net/xfrm/xfrm_policy.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -722,12 +722,7 @@ static void xfrm_policy_requeue(struct x static bool xfrm_policy_mark_match(struct xfrm_policy *policy, struct xfrm_policy *pol) { - u32 mark = policy->mark.v & policy->mark.m; - - if (policy->mark.v == pol->mark.v && policy->mark.m == pol->mark.m) - return true; - - if ((mark & pol->mark.m) == pol->mark.v && + if (policy->mark.v == pol->mark.v && policy->priority == pol->priority) return true; From patchwork Mon Jun 1 17:54:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFBC9C433E0 for ; Mon, 1 Jun 2020 18:54:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A470120679 for ; Mon, 1 Jun 2020 18:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037640; bh=IUwtny+/JWT/oUv6BjzT1fZrlqINPZfCEVin8clKFn0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aMqnz95QuabvzQwvZUaCHO+RgbbfIutoZgBAq7uNusafDcxyTFWSiEmpa3slkBFQC 7wAQ3mrHrQm4h9sW1IimsFXGK3Um+j6qmsytbCStvuQAqU1mQHy96SK2Jz58bYgnhr DLsqCe+50e1htx/e262N1Ftk85+7ssAQdkGxfCJA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbgFASx4 (ORCPT ); Mon, 1 Jun 2020 14:53:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:45598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729935AbgFASC3 (ORCPT ); Mon, 1 Jun 2020 14:02:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5F852065C; Mon, 1 Jun 2020 18:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034548; bh=IUwtny+/JWT/oUv6BjzT1fZrlqINPZfCEVin8clKFn0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bGfl50dLfOY/5oQXTbDbzFdX/OvJwjrX1/vtSxxNR3pnqYgwjXXH/V0nOyoHOBGO4 4zKvrs6cE0lDF8zVeT4a/P2HdJdwZtXo7SgQHNjDKKDLsl/Zpcys5nsozBngujTmJE GKvpehUR6TWjWii66JFVJiXGEnQ6LVzU14fmVDq8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Sutter , Pablo Neira Ayuso Subject: [PATCH 4.14 64/77] netfilter: ipset: Fix subcounter update skip Date: Mon, 1 Jun 2020 19:54:09 +0200 Message-Id: <20200601174027.423091577@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Phil Sutter commit a164b95ad6055c50612795882f35e0efda1f1390 upstream. If IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE is set, user requested to not update counters in sub sets. Therefore IPSET_FLAG_SKIP_COUNTER_UPDATE must be set, not unset. Fixes: 6e01781d1c80e ("netfilter: ipset: set match: add support to match the counters") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/ipset/ip_set_list_set.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/ipset/ip_set_list_set.c +++ b/net/netfilter/ipset/ip_set_list_set.c @@ -61,7 +61,7 @@ list_set_ktest(struct ip_set *set, const /* Don't lookup sub-counters at all */ opt->cmdflags &= ~IPSET_FLAG_MATCH_COUNTERS; if (opt->cmdflags & IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE) - opt->cmdflags &= ~IPSET_FLAG_SKIP_COUNTER_UPDATE; + opt->cmdflags |= IPSET_FLAG_SKIP_COUNTER_UPDATE; list_for_each_entry_rcu(e, &map->members, list) { if (SET_WITH_TIMEOUT(set) && ip_set_timeout_expired(ext_timeout(e, set))) From patchwork Mon Jun 1 17:54:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B94A4C433E1 for ; Mon, 1 Jun 2020 18:02:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93A9B2065C for ; Mon, 1 Jun 2020 18:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034552; bh=5aO1MkiPsoZHL3Mh8v38hTldgDEBiyOrhHeqKbC4kKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TWqcdFdnyMGk8rViaJqsK9EvlgVYDjSkLCSdtkFzYQ0EcyW0f6c0czzLrudLynjVh 4QlAsED8Y25eh6Rh9VS5JyN+pdHtcV719fOILzL2fewqlIMPgi0JZCZ/39zN8mKgb6 xkRdfYc/bROEmkCRbTxj8EG0wYHsokMUkaDCshss= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729945AbgFASCc (ORCPT ); Mon, 1 Jun 2020 14:02:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:45648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbgFASCb (ORCPT ); Mon, 1 Jun 2020 14:02:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15CAE206E2; Mon, 1 Jun 2020 18:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034550; bh=5aO1MkiPsoZHL3Mh8v38hTldgDEBiyOrhHeqKbC4kKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o4sc1TBDkzEijOqgXQxM7pZr8zY1MZjU1DrHB6Xhpn7LYsC1uwhoVtKfnRAnB+cU1 VBDuOPppVVDCcA+OS9x6NUnR8jAcWP8cyG/jI8hejCZ1gYtrRU9HUr+XE7jJHBaKt2 3mDS7/IrUZwiX4vqUIViYG38kz6F55BEwHx107vU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 4.14 65/77] netfilter: nfnetlink_cthelper: unbreak userspace helper support Date: Mon, 1 Jun 2020 19:54:10 +0200 Message-Id: <20200601174027.589761257@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Pablo Neira Ayuso commit 703acd70f2496537457186211c2f03e792409e68 upstream. Restore helper data size initialization and fix memcopy of the helper data size. Fixes: 157ffffeb5dc ("netfilter: nfnetlink_cthelper: reject too large userspace allocation requests") Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nfnetlink_cthelper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -106,7 +106,7 @@ nfnl_cthelper_from_nlattr(struct nlattr if (help->helper->data_len == 0) return -EINVAL; - nla_memcpy(help->data, nla_data(attr), sizeof(help->data)); + nla_memcpy(help->data, attr, sizeof(help->data)); return 0; } @@ -240,6 +240,7 @@ nfnl_cthelper_create(const struct nlattr ret = -ENOMEM; goto err2; } + helper->data_len = size; helper->flags |= NF_CT_HELPER_F_USERSPACE; memcpy(&helper->tuple, tuple, sizeof(struct nf_conntrack_tuple)); From patchwork Mon Jun 1 17:54:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224906 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDDEC433DF for ; Mon, 1 Jun 2020 18:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30AC5206C3 for ; Mon, 1 Jun 2020 18:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037634; bh=gVlM85lAfJZ6wDZrOwqCY+DymGscbAQxro//HxDRrkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=K6Wcap9Hem5nAHTjKqAjG/EWWwtUZw9ORwUlEYz18gob8yXQXIY4wRzkx8lifYXzU Plx03+JuX6V1uxBMZnQN3MJQ25IKkkFmyUJE2u53gN4zO2IrMD5i/qDyeHwF159hge 6m0TVzSwRUOsDqw5Fd7YbgS6c8ZNafyYz7hKOdeU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729620AbgFASxu (ORCPT ); Mon, 1 Jun 2020 14:53:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:45746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728153AbgFASCf (ORCPT ); Mon, 1 Jun 2020 14:02:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8583B2065C; Mon, 1 Jun 2020 18:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034555; bh=gVlM85lAfJZ6wDZrOwqCY+DymGscbAQxro//HxDRrkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkFPnGN0Jkv6mui7old0UXfKNNu6nEJSvCeTt07hx/qMyxSR5zrsd5JXGsGuHKREy qpT2QD2GsLdic9U4T4sXWEN7Tx/FRBkbf4zhbgU23QVCcsvF8J/jLFWSIp3ylu/WVn bCyAhFQ6gdEwpFl5DJe4oBsBVqRkhUZ6GMJBd6c4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , Steffen Klassert Subject: [PATCH 4.14 67/77] esp6: get the right proto for transport mode in esp6_gso_encap Date: Mon, 1 Jun 2020 19:54:12 +0200 Message-Id: <20200601174027.900174373@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xin Long commit 3c96ec56828922e3fe5477f75eb3fc02f98f98b5 upstream. For transport mode, when ipv6 nexthdr is set, the packet format might be like: ---------------------------------------------------- | | dest | | | | ESP | ESP | | IP6 hdr| opts.| ESP | TCP | Data | Trailer | ICV | ---------------------------------------------------- What it wants to get for x-proto in esp6_gso_encap() is the proto that will be set in ESP nexthdr. So it should skip all ipv6 nexthdrs and get the real transport protocol. Othersize, the wrong proto number will be set into ESP nexthdr. This patch is to skip all ipv6 nexthdrs by calling ipv6_skip_exthdr() in esp6_gso_encap(). Fixes: 7862b4058b9f ("esp: Add gso handlers for esp4 and esp6") Signed-off-by: Xin Long Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman --- net/ipv6/esp6_offload.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/net/ipv6/esp6_offload.c +++ b/net/ipv6/esp6_offload.c @@ -121,9 +121,16 @@ static void esp6_gso_encap(struct xfrm_s struct ip_esp_hdr *esph; struct ipv6hdr *iph = ipv6_hdr(skb); struct xfrm_offload *xo = xfrm_offload(skb); - int proto = iph->nexthdr; + u8 proto = iph->nexthdr; skb_push(skb, -skb_network_offset(skb)); + + if (x->outer_mode->encap == XFRM_MODE_TRANSPORT) { + __be16 frag; + + ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &proto, &frag); + } + esph = ip_esp_hdr(skb); *skb_mac_header(skb) = IPPROTO_ESP; From patchwork Mon Jun 1 17:54:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4077C433E0 for ; Mon, 1 Jun 2020 18:02:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C77E620825 for ; Mon, 1 Jun 2020 18:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034560; bh=09pFT/p3AtZo/Gyy75xhoEPeOLdDUxHlPwMtz3ZgjI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Kz9VQgHd1oZsxjs+tqouzRs2oIB/GOy8q6GzszYnHVe9PfTBDu9pRO2HoMUm2Yxs9 3pScoFC9XSKV3w29t5gJqa/u3nKYWKDcj6GRT06xrGJRWQPAdLpYZLtMkES/+qIFdV aBu6t8kve0RGLXzDhqoSyc5t43pnjBalzagwi11I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729948AbgFASCi (ORCPT ); Mon, 1 Jun 2020 14:02:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:45814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728956AbgFASCh (ORCPT ); Mon, 1 Jun 2020 14:02:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF8A7206E2; Mon, 1 Jun 2020 18:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034557; bh=09pFT/p3AtZo/Gyy75xhoEPeOLdDUxHlPwMtz3ZgjI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZLFfQiwPL901hB7fF4IDOp4ydnMfc3vwecKAggM7gGM97T17bRcidCT/KAmiiIMi rYsw0+mm4pQ4dWJr2FZtOJN9HsHw54LQCFdfkjmy2z5gjQrA3FKRQoxC4e2PyEI3TJ ON0tlSzjYPWAHIo7woJerT5y+uRtev44QOHmnoo0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , "David S. Miller" Subject: [PATCH 4.14 68/77] qlcnic: fix missing release in qlcnic_83xx_interrupt_test. Date: Mon, 1 Jun 2020 19:54:13 +0200 Message-Id: <20200601174028.045243605@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Qiushi Wu commit 15c973858903009e995b2037683de29dfe968621 upstream. In function qlcnic_83xx_interrupt_test(), function qlcnic_83xx_diag_alloc_res() is not handled by function qlcnic_83xx_diag_free_res() after a call of the function qlcnic_alloc_mbx_args() failed. Fix this issue by adding a jump target "fail_mbx_args", and jump to this new target when qlcnic_alloc_mbx_args() failed. Fixes: b6b4316c8b2f ("qlcnic: Handle qlcnic_alloc_mbx_args() failure") Signed-off-by: Qiushi Wu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c @@ -3650,7 +3650,7 @@ int qlcnic_83xx_interrupt_test(struct ne ahw->diag_cnt = 0; ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST); if (ret) - goto fail_diag_irq; + goto fail_mbx_args; if (adapter->flags & QLCNIC_MSIX_ENABLED) intrpt_id = ahw->intr_tbl[0].id; @@ -3680,6 +3680,8 @@ int qlcnic_83xx_interrupt_test(struct ne done: qlcnic_free_mbx_args(&cmd); + +fail_mbx_args: qlcnic_83xx_diag_free_res(netdev, drv_sds_rings); fail_diag_irq: From patchwork Mon Jun 1 17:54:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70F19C433E0 for ; Mon, 1 Jun 2020 18:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4760420679 for ; Mon, 1 Jun 2020 18:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037674; bh=xC9hJYuRSl5pnTM9TMOSwz7SgPWF7neADVLAEPjyJ74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=N3sTbNS83rsA1IUrbxqzj45fafaQJQyoHGUgU9XVNYcO9PmueS0Bh3wTMa1vIeub1 u2F1/BFmrvL1EXrfAzj948VGQltWAUpdL1hGGoZ0b6FORZzOzpPC2rf+IZsxG/juI9 PFCq68ic6hAS4UvWCLI2LX/OyyfH/br8rYYVpp7U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729859AbgFASy0 (ORCPT ); Mon, 1 Jun 2020 14:54:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:45090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726901AbgFASCB (ORCPT ); Mon, 1 Jun 2020 14:02:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D24FA2065C; Mon, 1 Jun 2020 18:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034521; bh=xC9hJYuRSl5pnTM9TMOSwz7SgPWF7neADVLAEPjyJ74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XuAu44y8IVszvTeCx4kOTQGMRXVqS0W5QxvY0/jLrB6okRSb91G+8tYaMxKuix0NI aeivGFMSm/zFyyNyGB9q/g7TPydx667mgM8dlBmZwV5Z8s2Ca662jWVLe4jXIFlsCQ Z6z+s62vG794RavSCPrg/wQKqNl/2y8aa/6JAgFE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , Jay Vosburgh , "David S. Miller" Subject: [PATCH 4.14 69/77] bonding: Fix reference count leak in bond_sysfs_slave_add. Date: Mon, 1 Jun 2020 19:54:14 +0200 Message-Id: <20200601174028.225991942@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Qiushi Wu commit a068aab42258e25094bc2c159948d263ed7d7a77 upstream. kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous commit "b8eb718348b8" fixed a similar problem. Fixes: 07699f9a7c8d ("bonding: add sysfs /slave dir for bond slave devices.") Signed-off-by: Qiushi Wu Acked-by: Jay Vosburgh Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_sysfs_slave.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/bonding/bond_sysfs_slave.c +++ b/drivers/net/bonding/bond_sysfs_slave.c @@ -153,8 +153,10 @@ int bond_sysfs_slave_add(struct slave *s err = kobject_init_and_add(&slave->kobj, &slave_ktype, &(slave->dev->dev.kobj), "bonding_slave"); - if (err) + if (err) { + kobject_put(&slave->kobj); return err; + } for (a = slave_attrs; *a; ++a) { err = sysfs_create_file(&slave->kobj, &((*a)->attr)); From patchwork Mon Jun 1 17:54:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAF29C433DF for ; Mon, 1 Jun 2020 18:54:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B22620679 for ; Mon, 1 Jun 2020 18:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037664; bh=xe0N+7sYbFtwojUydJ8S15eOlZCR8+wuTi/LeGmYtAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cnJcBNhsl7626RRenuGpNOX509r+zNNSLv87JnHHyjrKGENdzYOPpMA3ZNeSsvbia gcl/N/3NNXAV0D3rPcd4h9OXNGOlpfsWQascRLXv92XMrwikvli2xtg4xxZ+O7I3dy +hvaXNgNP+1CshN1k34pKyc2CELcDzwtqqDfmXhQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728839AbgFASyT (ORCPT ); Mon, 1 Jun 2020 14:54:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:45130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729859AbgFASCD (ORCPT ); Mon, 1 Jun 2020 14:02:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 16DE22073B; Mon, 1 Jun 2020 18:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034523; bh=xe0N+7sYbFtwojUydJ8S15eOlZCR8+wuTi/LeGmYtAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CjysNHPzD1od84g/BjFGnbnl6fsLDkLSuz9R5P3sKlO7rfcG7z4DQPQi19juzCULc q96BO7zUwsuyjL9kd1AKcgOVPpyvGLrVNnqjcCjmZMu6y5SaY2YbuC/A4H6/aLp1Sb cvcIFZJ9s58SgzLuiwU4IwfxDLOdZuW5YdfiSBCU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org Subject: [PATCH 4.14 70/77] Revert "Input: i8042 - add ThinkPad S230u to i8042 nomux list" Date: Mon, 1 Jun 2020 19:54:15 +0200 Message-Id: <20200601174028.390129668@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dmitry Torokhov commit f4dec2d6160976b14e54be9c3950ce0f52385741 upstream. This reverts commit 18931506465a762ffd3f4803d36a18d336a67da9. From Kevin Locke: "... nomux only appeared to fix the issue because the controller continued working after warm reboots. After more thorough testing from both warm and cold start, I now believe the entry should be added to i8042_dmi_reset_table rather than i8042_dmi_nomux_table as i8042.reset=1 alone is sufficient to avoid the issue from both states while i8042.nomux is not." Signed-off-by: Greg Kroah-Hartman --- drivers/input/serio/i8042-x86ia64io.h | 7 ------- 1 file changed, 7 deletions(-) --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -545,13 +545,6 @@ static const struct dmi_system_id __init DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"), }, }, - { - /* Lenovo ThinkPad Twist S230u */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"), - }, - }, { } }; From patchwork Mon Jun 1 17:54:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4DA1C433E0 for ; Mon, 1 Jun 2020 18:02:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8324E207DF for ; Mon, 1 Jun 2020 18:02:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034528; bh=G5znw6b3xcWoE98cHwMwBHm1ZG+kgcYl3ptVUaPg7Kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zI3gsJ+gGOdplScYYjtZrpdQpZIR4ZdRqc6MLxlEsO4UMUHegaB0DuGQfMTcVX/eg lSqhiafxW3C0dT54bW3kbIHp1Z6AeBjD57p8qnM2N2sVHvBFQ1xKnJVB1aTwWGEpkl L1C9MHa4cOxNYGiMT6iyhP60IVKP90aR1otBumUM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729883AbgFASCH (ORCPT ); Mon, 1 Jun 2020 14:02:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:45192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729877AbgFASCG (ORCPT ); Mon, 1 Jun 2020 14:02:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5991F2065C; Mon, 1 Jun 2020 18:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034525; bh=G5znw6b3xcWoE98cHwMwBHm1ZG+kgcYl3ptVUaPg7Kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y5B6qpEOOaqxtJ5qzdK6+uJOwhjSRXHI6CeJrCvuljpzJavOTi/ds/NSvivZAYc1V sbOYkb07UPR9QUILCOEXtiR37ejV9De0Ih1b1WAgNAlKJ84rq9pGSn8hpnhle+lIoM 1VORon99t0Fls/bR6IFvevkXNjvizSFGOT4GgrJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Pablo Neira Ayuso Subject: [PATCH 4.14 71/77] netfilter: nf_conntrack_pptp: fix compilation warning with W=1 build Date: Mon, 1 Jun 2020 19:54:16 +0200 Message-Id: <20200601174028.556205769@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Pablo Neira Ayuso commit 4946ea5c1237036155c3b3a24f049fd5f849f8f6 upstream. >> include/linux/netfilter/nf_conntrack_pptp.h:13:20: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers] extern const char *const pptp_msg_name(u_int16_t msg); ^~~~~~ Reported-by: kbuild test robot Fixes: 4c559f15efcc ("netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- include/linux/netfilter/nf_conntrack_pptp.h | 2 +- net/netfilter/nf_conntrack_pptp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/netfilter/nf_conntrack_pptp.h +++ b/include/linux/netfilter/nf_conntrack_pptp.h @@ -5,7 +5,7 @@ #include -extern const char *const pptp_msg_name(u_int16_t msg); +const char *pptp_msg_name(u_int16_t msg); /* state of the control session */ enum pptp_ctrlsess_state { --- a/net/netfilter/nf_conntrack_pptp.c +++ b/net/netfilter/nf_conntrack_pptp.c @@ -90,7 +90,7 @@ static const char *const pptp_msg_name_a [PPTP_SET_LINK_INFO] = "SET_LINK_INFO" }; -const char *const pptp_msg_name(u_int16_t msg) +const char *pptp_msg_name(u_int16_t msg) { if (msg > PPTP_MSG_MAX) return pptp_msg_name_array[0]; From patchwork Mon Jun 1 17:54:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224902 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40BC5C433E0 for ; Mon, 1 Jun 2020 18:54:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05F6820679 for ; Mon, 1 Jun 2020 18:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037656; bh=u9RbMJt+W+v9l+9TcgBJ9HuUlcKo4R+C/yU5x9oNlvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ifc0qNYFX/u1SiNjZL1PN6oxUwfWhaLb8zL+S7e1vkt9k09NzrtAHMFbxBWyfax7v dvhKv218t+90BXFuFZNteHopcSYhXQzuarWMY5jA5igVMLUgqtdMwE8WZ46PNokrDE y50TbSn6gIXac36TciK1U9qSKSLU384Zsu1XA8Qw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729903AbgFASCO (ORCPT ); Mon, 1 Jun 2020 14:02:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:45280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729896AbgFASCK (ORCPT ); Mon, 1 Jun 2020 14:02:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA2652065C; Mon, 1 Jun 2020 18:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034530; bh=u9RbMJt+W+v9l+9TcgBJ9HuUlcKo4R+C/yU5x9oNlvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zN2FRVIDiFYYvVqm/Bh/qEgVoB3nWq3ZXfmSlPSSR0XswRcmmTcBAdW5XJRPIT8Xc VlrqNqcInhF55eQjRflctkWjA9PkLViRpS5KJtbL/3PP5v3Pc3B4zMMxEPaT8LYwOS D1vCRKN9z0d9dnVij5SgL6zyC8M8u0jbJNNgDSkM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guoqing Jiang , Arnd Bergmann , Guenter Roeck Subject: [PATCH 4.14 73/77] sc16is7xx: move label err_spi to correct section Date: Mon, 1 Jun 2020 19:54:18 +0200 Message-Id: <20200601174028.801093489@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Guoqing Jiang commit e00164a0f000de893944981f41a568c981aca658 upstream. err_spi is used when SERIAL_SC16IS7XX_SPI is enabled, so make the label only available under SERIAL_SC16IS7XX_SPI option. Otherwise, the below warning appears. drivers/tty/serial/sc16is7xx.c:1523:1: warning: label ‘err_spi’ defined but not used [-Wunused-label] err_spi: ^~~~~~~ Signed-off-by: Guoqing Jiang Fixes: ac0cdb3d9901 ("sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init()") Signed-off-by: Arnd Bergmann Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sc16is7xx.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1524,10 +1524,12 @@ static int __init sc16is7xx_init(void) #endif return ret; +#ifdef CONFIG_SERIAL_SC16IS7XX_SPI err_spi: #ifdef CONFIG_SERIAL_SC16IS7XX_I2C i2c_del_driver(&sc16is7xx_i2c_uart_driver); #endif +#endif err_i2c: uart_unregister_driver(&sc16is7xx_uart); return ret; From patchwork Mon Jun 1 17:54:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01197C433DF for ; Mon, 1 Jun 2020 18:54:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D691720885 for ; Mon, 1 Jun 2020 18:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037649; bh=CF/6RAc/H1vUJ3Q0XZsd6asmMAfIVyfNxYNu0uUyfrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OiUh3EXjtoZcuMWS+sFE+06EqhY91BL4QVIGICqoTJd9amilqwEAzYSou/hKj3lFT MT+QVhyOPHgHOhYHZ0zHl7Qf27mpNSIbNNC6LwO8O/KRSj1bSLhgXsH+PzIM8PNTmb Co1+1U+kr50j5uu3BxqcXESJ4ZYMTYxjzN+NhmNQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729901AbgFASCO (ORCPT ); Mon, 1 Jun 2020 14:02:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:45318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729900AbgFASCN (ORCPT ); Mon, 1 Jun 2020 14:02:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 286D32073B; Mon, 1 Jun 2020 18:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034532; bh=CF/6RAc/H1vUJ3Q0XZsd6asmMAfIVyfNxYNu0uUyfrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxq0QpMMFoHxw8ajjBfdsLwEZEfnkin+MJ04ha2eUam+LoxeiBldYbODmh9qDQZTw nEdRZTVJ3mqv87dgG+Z1XJMDX1e1QnVxTKuVOO/gsuzRRET2yhGsOJHmlaCSkO2lIv RtnzBg53wu0z44Tbec8JQvjYv+G0cC3KGDgRtsm8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Guenter Roeck Subject: [PATCH 4.14 74/77] rxrpc: Fix transport sockopts to get IPv4 errors on an IPv6 socket Date: Mon, 1 Jun 2020 19:54:19 +0200 Message-Id: <20200601174029.015066757@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Howells commit 37a675e768d7606fe8a53e0c459c9b53e121ac20 upstream. It seems that enabling IPV6_RECVERR on an IPv6 socket doesn't also turn on IP_RECVERR, so neither local errors nor ICMP-transported remote errors from IPv4 peer addresses are returned to the AF_RXRPC protocol. Make the sockopt setting code in rxrpc_open_socket() fall through from the AF_INET6 case to the AF_INET case to turn on all the AF_INET options too in the AF_INET6 case. Fixes: f2aeed3a591f ("rxrpc: Fix error reception on AF_INET6 sockets") Signed-off-by: David Howells Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- net/rxrpc/local_object.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -134,10 +134,10 @@ static int rxrpc_open_socket(struct rxrp } switch (local->srx.transport.family) { - case AF_INET: - /* we want to receive ICMP errors */ + case AF_INET6: + /* we want to receive ICMPv6 errors */ opt = 1; - ret = kernel_setsockopt(local->socket, SOL_IP, IP_RECVERR, + ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_RECVERR, (char *) &opt, sizeof(opt)); if (ret < 0) { _debug("setsockopt failed"); @@ -145,19 +145,22 @@ static int rxrpc_open_socket(struct rxrp } /* we want to set the don't fragment bit */ - opt = IP_PMTUDISC_DO; - ret = kernel_setsockopt(local->socket, SOL_IP, IP_MTU_DISCOVER, + opt = IPV6_PMTUDISC_DO; + ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_MTU_DISCOVER, (char *) &opt, sizeof(opt)); if (ret < 0) { _debug("setsockopt failed"); goto error; } - break; - case AF_INET6: + /* Fall through and set IPv4 options too otherwise we don't get + * errors from IPv4 packets sent through the IPv6 socket. + */ + + case AF_INET: /* we want to receive ICMP errors */ opt = 1; - ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_RECVERR, + ret = kernel_setsockopt(local->socket, SOL_IP, IP_RECVERR, (char *) &opt, sizeof(opt)); if (ret < 0) { _debug("setsockopt failed"); @@ -165,8 +168,8 @@ static int rxrpc_open_socket(struct rxrp } /* we want to set the don't fragment bit */ - opt = IPV6_PMTUDISC_DO; - ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_MTU_DISCOVER, + opt = IP_PMTUDISC_DO; + ret = kernel_setsockopt(local->socket, SOL_IP, IP_MTU_DISCOVER, (char *) &opt, sizeof(opt)); if (ret < 0) { _debug("setsockopt failed"); From patchwork Mon Jun 1 17:54:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8EC7C433E0 for ; Mon, 1 Jun 2020 18:54:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4486206C3 for ; Mon, 1 Jun 2020 18:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037643; bh=34OV/T33rjUYauDRA5grfF8VnK8diJYzM6GiXKWCvOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=usyu7OMkOgidCphghl+cbnVGc37JAq5/8HgDFKo0YhvxRsgud1ip0HY5hneObMhbt s35pA/y2x6EtTpbyj6IN8QFyOykBHyHxkl7zEyxERiMNZ5WCfdvI8isZ5OBW2L7TKc qEXJGg08fwfJaZsLARfwVCaAaGDS8MKK3Z67DoOc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729917AbgFASCU (ORCPT ); Mon, 1 Jun 2020 14:02:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:45450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729915AbgFASCT (ORCPT ); Mon, 1 Jun 2020 14:02:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E031E207DA; Mon, 1 Jun 2020 18:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034539; bh=34OV/T33rjUYauDRA5grfF8VnK8diJYzM6GiXKWCvOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ttRv9EyUtWSoahMU1gdnRqQ7vs9Jw/Qaj9djfQgQmsNYlUTPTWk7FDbiExf1Rf1Dn DWEDjV6dKsjHPsEdKKQghppMWitquLB4MPYZkUwNQWzra+sBHtsSnKCQy7y8rIfpIG S9k1xBX8/BhTRvBSSE+xYqSjwUQfwdMaL/XiuSIQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Salil Mehta , "David S. Miller" Subject: [PATCH 4.14 77/77] net: hns: Fixes the missing put_device in positive leg for roce reset Date: Mon, 1 Jun 2020 19:54:22 +0200 Message-Id: <20200601174029.792461483@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174016.396817032@linuxfoundation.org> References: <20200601174016.396817032@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Salil Mehta commit 4d96e13ee9cd1f7f801e8c7f4b12f09d1da4a5d8 upstream. This patch fixes the missing device reference release-after-use in the positive leg of the roce reset API of the HNS DSAF. Fixes: c969c6e7ab8c ("net: hns: Fix object reference leaks in hns_dsaf_roce_reset()") Reported-by: John Garry Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c @@ -3142,6 +3142,9 @@ int hns_dsaf_roce_reset(struct fwnode_ha dsaf_set_bit(credit, DSAF_SBM_ROCEE_CFG_CRD_EN_B, 1); dsaf_write_dev(dsaf_dev, DSAF_SBM_ROCEE_CFG_REG_REG, credit); } + + put_device(&pdev->dev); + return 0; } EXPORT_SYMBOL(hns_dsaf_roce_reset);