From patchwork Fri Jan 15 12:27:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364656 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 EFD2BC43333 for ; Fri, 15 Jan 2021 12:31:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBD34238A0 for ; Fri, 15 Jan 2021 12:31:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732286AbhAOMa6 (ORCPT ); Fri, 15 Jan 2021 07:30:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:36294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732335AbhAOMa5 (ORCPT ); Fri, 15 Jan 2021 07:30:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 548A2238EC; Fri, 15 Jan 2021 12:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713801; bh=Ga0NYENILrBNF9VVtN6sxeXlzBL70PaQJUPnZkNZZnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V7wBLEWuLyK8+OQtVdEYhiAwgB8LPpz2StwABjl9iNVRQKE9++ycgNGc/RcrOvR7Y xXk7UpXs0yfxIMmCH+5HRAJO7d11mcs5sEmKzUlFkot3fZLpgDj9OwddpquVrMUnTI 0DmvDN+bErfX04NMG33eA7iG3sjMtv8gmDrN5WEs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Disseldorp , Christoph Hellwig , Bart Van Assche , Sasha Levin Subject: [PATCH 4.9 02/25] target: simplify XCOPY wwn->se_dev lookup helper Date: Fri, 15 Jan 2021 13:27:33 +0100 Message-Id: <20210115121956.804545587@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Disseldorp [ Upstream commit 94aae4caacda89a1bdb7198b260f4ca3595b7ed7 ] target_xcopy_locate_se_dev_e4() is used to locate an se_dev, based on the WWN provided with the XCOPY request. Remove a couple of unneeded arguments, and rely on the caller for the src/dst test. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig Signed-off-by: Bart Van Assche Signed-off-by: Sasha Levin --- drivers/target/target_core_xcopy.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index a63b2fff82cc6..c4bd86976e450 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -52,18 +52,13 @@ static int target_xcopy_gen_naa_ieee(struct se_device *dev, unsigned char *buf) return 0; } -static int target_xcopy_locate_se_dev_e4(struct se_cmd *se_cmd, struct xcopy_op *xop, - bool src) +static int target_xcopy_locate_se_dev_e4(const unsigned char *dev_wwn, + struct se_device **found_dev) { struct se_device *se_dev; - unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN], *dev_wwn; + unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN]; int rc; - if (src) - dev_wwn = &xop->dst_tid_wwn[0]; - else - dev_wwn = &xop->src_tid_wwn[0]; - mutex_lock(&g_device_mutex); list_for_each_entry(se_dev, &g_device_list, g_dev_node) { @@ -77,15 +72,8 @@ static int target_xcopy_locate_se_dev_e4(struct se_cmd *se_cmd, struct xcopy_op if (rc != 0) continue; - if (src) { - xop->dst_dev = se_dev; - pr_debug("XCOPY 0xe4: Setting xop->dst_dev: %p from located" - " se_dev\n", xop->dst_dev); - } else { - xop->src_dev = se_dev; - pr_debug("XCOPY 0xe4: Setting xop->src_dev: %p from located" - " se_dev\n", xop->src_dev); - } + *found_dev = se_dev; + pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev); rc = target_depend_item(&se_dev->dev_group.cg_item); if (rc != 0) { @@ -242,9 +230,11 @@ static int target_xcopy_parse_target_descriptors(struct se_cmd *se_cmd, } if (xop->op_origin == XCOL_SOURCE_RECV_OP) - rc = target_xcopy_locate_se_dev_e4(se_cmd, xop, true); + rc = target_xcopy_locate_se_dev_e4(xop->dst_tid_wwn, + &xop->dst_dev); else - rc = target_xcopy_locate_se_dev_e4(se_cmd, xop, false); + rc = target_xcopy_locate_se_dev_e4(xop->src_tid_wwn, + &xop->src_dev); /* * If a matching IEEE NAA 0x83 descriptor for the requested device * is not located on this node, return COPY_ABORTED with ASQ/ASQC From patchwork Fri Jan 15 12:27:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364532 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 19CC8C432C3 for ; Fri, 15 Jan 2021 13:07:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1230235F8 for ; Fri, 15 Jan 2021 13:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732553AbhAONGw (ORCPT ); Fri, 15 Jan 2021 08:06:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:36412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732513AbhAOMbP (ORCPT ); Fri, 15 Jan 2021 07:31:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B1EE224F9; Fri, 15 Jan 2021 12:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713843; bh=ibyoc2rBqcrmn0fTDfCqzTf+/6rTCjCX10lhVzwFgL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B9GOKv76a0W5xsdeFMa3dJw+cZCReG1j7+YbRJ/67YAb70FU8cy40Vg0qSuKb8Nro Cb6CMcONzReyK5U4isydk+41YvLjQL0rhxV0Aj3Z29jvy2eb0udwObP8f3UuqxZ9F0 uG7THeOd9HtpipHHg3xTwpds9IbT2hXsoPUtyXeA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Disseldorp , Christoph Hellwig , Bart Van Assche , Sasha Levin Subject: [PATCH 4.9 06/25] target: add XCOPY target/segment desc sense codes Date: Fri, 15 Jan 2021 13:27:37 +0100 Message-Id: <20210115121956.996737941@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Disseldorp [ Upstream commit e864212078ded276bdb272b2e0ee6a979357ca8a ] As defined in http://www.t10.org/lists/asc-num.htm. To be used during validation of XCOPY target and segment descriptor lists. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig Signed-off-by: Bart Van Assche Signed-off-by: Sasha Levin --- drivers/target/target_core_transport.c | 24 ++++++++++++++++++++++++ include/target/target_core_base.h | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index e738b4621cbba..ecd707f74ddcb 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1736,6 +1736,10 @@ void transport_generic_request_failure(struct se_cmd *cmd, case TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED: case TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED: case TCM_COPY_TARGET_DEVICE_NOT_REACHABLE: + case TCM_TOO_MANY_TARGET_DESCS: + case TCM_UNSUPPORTED_TARGET_DESC_TYPE_CODE: + case TCM_TOO_MANY_SEGMENT_DESCS: + case TCM_UNSUPPORTED_SEGMENT_DESC_TYPE_CODE: break; case TCM_OUT_OF_RESOURCES: sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; @@ -2886,6 +2890,26 @@ static const struct sense_info sense_info_table[] = { .key = ILLEGAL_REQUEST, .asc = 0x26, /* INVALID FIELD IN PARAMETER LIST */ }, + [TCM_TOO_MANY_TARGET_DESCS] = { + .key = ILLEGAL_REQUEST, + .asc = 0x26, + .ascq = 0x06, /* TOO MANY TARGET DESCRIPTORS */ + }, + [TCM_UNSUPPORTED_TARGET_DESC_TYPE_CODE] = { + .key = ILLEGAL_REQUEST, + .asc = 0x26, + .ascq = 0x07, /* UNSUPPORTED TARGET DESCRIPTOR TYPE CODE */ + }, + [TCM_TOO_MANY_SEGMENT_DESCS] = { + .key = ILLEGAL_REQUEST, + .asc = 0x26, + .ascq = 0x08, /* TOO MANY SEGMENT DESCRIPTORS */ + }, + [TCM_UNSUPPORTED_SEGMENT_DESC_TYPE_CODE] = { + .key = ILLEGAL_REQUEST, + .asc = 0x26, + .ascq = 0x09, /* UNSUPPORTED SEGMENT DESCRIPTOR TYPE CODE */ + }, [TCM_PARAMETER_LIST_LENGTH_ERROR] = { .key = ILLEGAL_REQUEST, .asc = 0x1a, /* PARAMETER LIST LENGTH ERROR */ diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 30f99ce4c6cea..8a70d38f13329 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -178,6 +178,10 @@ enum tcm_sense_reason_table { TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED = R(0x16), TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED = R(0x17), TCM_COPY_TARGET_DEVICE_NOT_REACHABLE = R(0x18), + TCM_TOO_MANY_TARGET_DESCS = R(0x19), + TCM_UNSUPPORTED_TARGET_DESC_TYPE_CODE = R(0x1a), + TCM_TOO_MANY_SEGMENT_DESCS = R(0x1b), + TCM_UNSUPPORTED_SEGMENT_DESC_TYPE_CODE = R(0x1c), #undef R }; From patchwork Fri Jan 15 12:27:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364655 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 2853AC433E9 for ; Fri, 15 Jan 2021 12:31:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E684123339 for ; Fri, 15 Jan 2021 12:31:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732569AbhAOMbU (ORCPT ); Fri, 15 Jan 2021 07:31:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:36438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732552AbhAOMbR (ORCPT ); Fri, 15 Jan 2021 07:31:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC8C723356; Fri, 15 Jan 2021 12:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713848; bh=gQXy+mR9D1IBVflhFmLHtMzWnt6Si8GyfQOWY9wZi1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Blx4PZ5ahhfrk4vXLn2Jz7LHg+Tc5+Vn+nuUzSQXEjNuU4YIS8FBs9pFBuM71SZM6 0H0LW6bDbJkZ4jGriXLYGF0cq+l9CFCmUEgA0tMLw1+PIO6ekMZ3V4H5OByC2x1A1V VJfYjJ+QEt9y60+brcKfijayNXXrUV53Zey0D4Co= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Perle , Florian Westphal , Pablo Neira Ayuso , Jakub Kicinski Subject: [PATCH 4.9 08/25] net: ip: always refragment ip defragmented packets Date: Fri, 15 Jan 2021 13:27:39 +0100 Message-Id: <20210115121957.096031181@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Westphal [ Upstream commit bb4cc1a18856a73f0ff5137df0c2a31f4c50f6cf ] Conntrack reassembly records the largest fragment size seen in IPCB. However, when this gets forwarded/transmitted, fragmentation will only be forced if one of the fragmented packets had the DF bit set. In that case, a flag in IPCB will force fragmentation even if the MTU is large enough. This should work fine, but this breaks with ip tunnels. Consider client that sends a UDP datagram of size X to another host. The client fragments the datagram, so two packets, of size y and z, are sent. DF bit is not set on any of these packets. Middlebox netfilter reassembles those packets back to single size-X packet, before routing decision. packet-size-vs-mtu checks in ip_forward are irrelevant, because DF bit isn't set. At output time, ip refragmentation is skipped as well because x is still smaller than the mtu of the output device. If ttransmit device is an ip tunnel, the packet size increases to x+overhead. Also, tunnel might be configured to force DF bit on outer header. In this case, packet will be dropped (exceeds MTU) and an ICMP error is generated back to sender. But sender already respects the announced MTU, all the packets that it sent did fit the announced mtu. Force refragmentation as per original sizes unconditionally so ip tunnel will encapsulate the fragments instead. The only other solution I see is to place ip refragmentation in the ip_tunnel code to handle this case. Fixes: d6b915e29f4ad ("ip_fragment: don't forward defragmented DF packet") Reported-by: Christian Perle Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -300,7 +300,7 @@ static int ip_finish_output(struct net * if (skb_is_gso(skb)) return ip_finish_output_gso(net, sk, skb, mtu); - if (skb->len > mtu || (IPCB(skb)->flags & IPSKB_FRAG_PMTU)) + if (skb->len > mtu || IPCB(skb)->frag_max_size) return ip_fragment(net, sk, skb, mtu, ip_finish_output2); return ip_finish_output2(net, sk, skb); From patchwork Fri Jan 15 12:27:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364533 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 99795C433DB for ; Fri, 15 Jan 2021 13:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68B052371F for ; Fri, 15 Jan 2021 13:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732562AbhAOMbS (ORCPT ); Fri, 15 Jan 2021 07:31:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:36440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732558AbhAOMbR (ORCPT ); Fri, 15 Jan 2021 07:31:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1143B22473; Fri, 15 Jan 2021 12:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713850; bh=+naoE5RLeCxDZeFBlgzO+70Duj3VqGSf3t05YwDSO3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FCVwD7TO1fxBGerG4c+y2v4p8enGs+Nqb6mIE+Y/EWIfmbrNm1bY6EfKU2a+M9XFn A9yWGKgpcZhrBKZUMK/rblSKtxSlp1+jpVVMwxD9ZauBxG3r5HGwqJVxXakWmtTvWy QWkG1IglRLXz+fon+OiH2hqAfmqQ7ShQ66iYKca4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefano Brivio , Florian Westphal , Pablo Neira Ayuso , Jakub Kicinski Subject: [PATCH 4.9 09/25] net: fix pmtu check in nopmtudisc mode Date: Fri, 15 Jan 2021 13:27:40 +0100 Message-Id: <20210115121957.144368290@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Westphal [ Upstream commit 50c661670f6a3908c273503dfa206dfc7aa54c07 ] For some reason ip_tunnel insist on setting the DF bit anyway when the inner header has the DF bit set, EVEN if the tunnel was configured with 'nopmtudisc'. This means that the script added in the previous commit cannot be made to work by adding the 'nopmtudisc' flag to the ip tunnel configuration. Doing so breaks connectivity even for the without-conntrack/netfilter scenario. When nopmtudisc is set, the tunnel will skip the mtu check, so no icmp error is sent to client. Then, because inner header has DF set, the outer header gets added with DF bit set as well. IP stack then sends an error to itself because the packet exceeds the device MTU. Fixes: 23a3647bc4f93 ("ip_tunnels: Use skb-len to PMTU check.") Cc: Stefano Brivio Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_tunnel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -743,7 +743,11 @@ void ip_tunnel_xmit(struct sk_buff *skb, goto tx_error; } - if (tnl_update_pmtu(dev, skb, rt, tnl_params->frag_off, inner_iph)) { + df = tnl_params->frag_off; + if (skb->protocol == htons(ETH_P_IP) && !tunnel->ignore_df) + df |= (inner_iph->frag_off & htons(IP_DF)); + + if (tnl_update_pmtu(dev, skb, rt, df, inner_iph)) { ip_rt_put(rt); goto tx_error; } @@ -771,10 +775,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, ttl = ip4_dst_hoplimit(&rt->dst); } - df = tnl_params->frag_off; - if (skb->protocol == htons(ETH_P_IP) && !tunnel->ignore_df) - df |= (inner_iph->frag_off&htons(IP_DF)); - max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) + rt->dst.header_len + ip_encap_hlen(&tunnel->encap); if (max_headroom > dev->needed_headroom) From patchwork Fri Jan 15 12:27:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363613 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp277268jap; Fri, 15 Jan 2021 05:08:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbHYNsR2S1pFRGE7j1useOhxnwIns8UOTTMZWhqXQh1iYnwOZ2LFduPdaajvUHF4OAR1rT X-Received: by 2002:a17:906:7e0b:: with SMTP id e11mr8502145ejr.533.1610716030706; Fri, 15 Jan 2021 05:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610716030; cv=none; d=google.com; s=arc-20160816; b=UJu8ACNXTZ02gOqUttrx/VIqB/KJC9uTAVlRbRZ4JkZ6TN2kysjTkd5Ot9i1a+SjuQ b7R7Roh1S5lR9MsL/KcxqzcoLvVWr0eeVqC8UmfkItyEu2q+YvzKy4JvChpjAQ48g1YC ckiXC2kn8lpEax3Jlg+H7QxQMgHiusGdPRdswCx+fhxwUjKbon3xP7GbDxfuPBK5ehcq 1wGJUT76QsrkxakIg9fxKgHqOBPstkKa4mxP58SejGcsBYQCk+ajHr51WeuB87iLwktb VkwQoRTBEKMiqxXDULTlv/PlwkndutPNHcKJUQnkNlLn6laPt/zdzlzsPvn09VxKxxLX CD5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VxHKrXeobCtnuEWIpUl7kqErHLgB9Rr4uI/U2B/gJC4=; b=pB3RbanbQ+d/ZyVlKmZz2mV2Xb+KtsMngNNQZgE3is/OY/jqT0ehzfc9dBh1jdbC2S ygJ6Dd6KzGIRQfK3lnXyAxQxHgUkqOX6EFv89YpUNaZqucVk0ufb1/Qq+HIHu2f9qIkx Aom0ps4O9sAsfcDrhat4YFDYYuPTPAn7szLKGvtC1Z6vc/BlhGvhDTZd17JOeT3CYb19 BDvW5Di6fcaDjxeV9uyWQzLb+iunNrS+x+WqdPuEADoBoqZIsKOxXkVNKccUA9unZLrI ZGPHCZVMuXzxWwCocn1y1fOvnro2RSClzWMd26iVTNMg+KNLz35JryZMoXcgwCKqfKv8 2qPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2eCUBtZX; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si3543505edw.47.2021.01.15.05.07.10; Fri, 15 Jan 2021 05:07:10 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2eCUBtZX; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732758AbhAONGo (ORCPT + 13 others); Fri, 15 Jan 2021 08:06:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:36468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732571AbhAOMbU (ORCPT ); Fri, 15 Jan 2021 07:31:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A3DF23359; Fri, 15 Jan 2021 12:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713852; bh=zMvVyCvwo/EX6UZN4/MyQq2opcAvoCJ188svsQtvNys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2eCUBtZXJNMp/aCG/8rpzNtKxDzkg+uKuxN6qbBr13WH+bsKqlFDEPNVG6hvlbU/9 MDGHvO5at0RTxj+VRAS40SxsDbiy5hYgP1gGUujOR8KYck9GcUrSr39SbtDzJMURPh rmK61ngnLVri5Xn29KtX2ASk0ulE6/yCOKvKnilE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Cai , =?utf-8?b?RsSBbmctcnXDrCBTw7JuZw==?= , Nick Desaulniers , Kees Cook , Ingo Molnar , Luis Lozano , Manoj Gupta , linux-arch@vger.kernel.org, Nathan Chancellor Subject: [PATCH 4.9 10/25] vmlinux.lds.h: Add PGO and AutoFDO input sections Date: Fri, 15 Jan 2021 13:27:41 +0100 Message-Id: <20210115121957.192486980@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nick Desaulniers commit eff8728fe69880d3f7983bec3fb6cea4c306261f upstream. Basically, consider .text.{hot|unlikely|unknown}.* part of .text, too. When compiling with profiling information (collected via PGO instrumentations or AutoFDO sampling), Clang will separate code into .text.hot, .text.unlikely, or .text.unknown sections based on profiling information. After D79600 (clang-11), these sections will have a trailing `.` suffix, ie. .text.hot., .text.unlikely., .text.unknown.. When using -ffunction-sections together with profiling infomation, either explicitly (FGKASLR) or implicitly (LTO), code may be placed in sections following the convention: .text.hot., .text.unlikely., .text.unknown. where , , and are functions. (This produces one section per function; we generally try to merge these all back via linker script so that we don't have 50k sections). For the above cases, we need to teach our linker scripts that such sections might exist and that we'd explicitly like them grouped together, otherwise we can wind up with code outside of the _stext/_etext boundaries that might not be mapped properly for some architectures, resulting in boot failures. If the linker script is not told about possible input sections, then where the section is placed as output is a heuristic-laiden mess that's non-portable between linkers (ie. BFD and LLD), and has resulted in many hard to debug bugs. Kees Cook is working on cleaning this up by adding --orphan-handling=warn linker flag used in ARCH=powerpc to additional architectures. In the case of linker scripts, borrowing from the Zen of Python: explicit is better than implicit. Also, ld.bfd's internal linker script considers .text.hot AND .text.hot.* to be part of .text, as well as .text.unlikely and .text.unlikely.*. I didn't see support for .text.unknown.*, and didn't see Clang producing such code in our kernel builds, but I see code in LLVM that can produce such section names if profiling information is missing. That may point to a larger issue with generating or collecting profiles, but I would much rather be safe and explicit than have to debug yet another issue related to orphan section placement. Reported-by: Jian Cai Suggested-by: Fāng-ruì Sòng Signed-off-by: Nick Desaulniers Signed-off-by: Kees Cook Signed-off-by: Ingo Molnar Tested-by: Luis Lozano Tested-by: Manoj Gupta Acked-by: Kees Cook Cc: linux-arch@vger.kernel.org Cc: stable@vger.kernel.org Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=add44f8d5c5c05e08b11e033127a744d61c26aee Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1de778ed23ce7492c523d5850c6c6dbb34152655 Link: https://reviews.llvm.org/D79600 Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1084760 Link: https://lore.kernel.org/r/20200821194310.3089815-7-keescook@chromium.org Debugged-by: Luis Lozano [nc: Fix small conflict around lack of NOINSTR_TEXT and .text..refcount] Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- include/asm-generic/vmlinux.lds.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -460,7 +460,10 @@ */ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ - *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \ + *(.text.hot .text.hot.*) \ + *(TEXT_MAIN .text.fixup) \ + *(.text.unlikely .text.unlikely.*) \ + *(.text.unknown .text.unknown.*) \ *(.ref.text) \ MEM_KEEP(init.text) \ MEM_KEEP(exit.text) \ From patchwork Fri Jan 15 12:27:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364535 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 619DCC43333 for ; Fri, 15 Jan 2021 13:06:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49C76221FA for ; Fri, 15 Jan 2021 13:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732606AbhAOMbZ (ORCPT ); Fri, 15 Jan 2021 07:31:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:37364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732596AbhAOMbY (ORCPT ); Fri, 15 Jan 2021 07:31:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C80D2389B; Fri, 15 Jan 2021 12:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713810; bh=eLxc/JivcVOfxYy1bCgsF9Ag5XJf1/dejhZPv7KCAeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ivg5ZJ5ro2rO1SH4wjBIqg6BXcycI/F5i/Jzwl75ugRXSuSFMYCQF3PArQRDzVdHP ZaHat4n8UNTczOr3i1fFfYKq4RyIcW5lI/XaBU56eQO78922Nfd4xO+Cu0puTwOIgI Okzdr9zUqApe0DEKoGgXwkZxerPgy8YksDq8ALSY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Andreas Kemnade , Tony Lindgren Subject: [PATCH 4.9 14/25] ARM: OMAP2+: omap_device: fix idling of devices during probe Date: Fri, 15 Jan 2021 13:27:45 +0100 Message-Id: <20210115121957.384405797@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Andreas Kemnade commit ec76c2eea903947202098090bbe07a739b5246e9 upstream. On the GTA04A5 od->_driver_status was not set to BUS_NOTIFY_BIND_DRIVER during probe of the second mmc used for wifi. Therefore omap_device_late_idle idled the device during probing causing oopses when accessing the registers. It was not set because od->_state was set to OMAP_DEVICE_STATE_IDLE in the notifier callback. Therefore set od->_driver_status also in that case. This came apparent after commit 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") causing this oops: omap_hsmmc 480b4000.mmc: omap_device_late_idle: enabled but no driver. Idling 8<--- cut here --- Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0b402c ... (omap_hsmmc_set_bus_width) from [] (omap_hsmmc_set_ios+0x11c/0x258) (omap_hsmmc_set_ios) from [] (mmc_power_up.part.8+0x3c/0xd0) (mmc_power_up.part.8) from [] (mmc_start_host+0x88/0x9c) (mmc_start_host) from [] (mmc_add_host+0x58/0x84) (mmc_add_host) from [] (omap_hsmmc_probe+0x5fc/0x8c0) (omap_hsmmc_probe) from [] (platform_drv_probe+0x48/0x98) (platform_drv_probe) from [] (really_probe+0x1dc/0x3b4) Fixes: 04abaf07f6d5 ("ARM: OMAP2+: omap_device: Sync omap_device and pm_runtime after probe defer") Fixes: 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") Acked-by: Ulf Hansson Signed-off-by: Andreas Kemnade [tony@atomide.com: left out extra parens, trimmed description stack trace] Signed-off-by: Tony Lindgren Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-omap2/omap_device.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -224,10 +224,12 @@ static int _omap_device_notifier_call(st break; case BUS_NOTIFY_BIND_DRIVER: od = to_omap_device(pdev); - if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) && - pm_runtime_status_suspended(dev)) { + if (od) { od->_driver_status = BUS_NOTIFY_BIND_DRIVER; - pm_runtime_set_active(dev); + if (od->_state == OMAP_DEVICE_STATE_ENABLED && + pm_runtime_status_suspended(dev)) { + pm_runtime_set_active(dev); + } } break; case BUS_NOTIFY_ADD_DEVICE: From patchwork Fri Jan 15 12:27:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364527 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 19265C43381 for ; Fri, 15 Jan 2021 13:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E231123888 for ; Fri, 15 Jan 2021 13:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732778AbhAONHk (ORCPT ); Fri, 15 Jan 2021 08:07:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:36414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732353AbhAOMbA (ORCPT ); Fri, 15 Jan 2021 07:31:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A9E5F238A0; Fri, 15 Jan 2021 12:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713813; bh=2lfO5BMhBRCISYYSfisVBIn98GspxvrD9EFkcEhvGtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ftWikzbfvqC6F49ZDp6L8qrAuXaGSvX7Be/3wiT6eLtgNgYmxROQ8WBa6wU8SvNA9 tE+kTmDnc0HBevYUTqxmwsXDtkVZeVtVJyzgB1repGHsbiqjFD3QJr4X98P1ziyP2R Tihch7lLCdDtzxGnThOIgMvgE4aCpl1J+zyfmrjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Viresh Kumar , Colin Ian King , "Rafael J. Wysocki" Subject: [PATCH 4.9 15/25] cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get() Date: Fri, 15 Jan 2021 13:27:46 +0100 Message-Id: <20210115121957.436024681@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Colin Ian King commit 943bdd0cecad06da8392a33093230e30e501eccc upstream. Currently there is an unlikely case where cpufreq_cpu_get() returns a NULL policy and this will cause a NULL pointer dereference later on. Fix this by passing the policy to transition_frequency_fidvid() from the caller and hence eliminating the need for the cpufreq_cpu_get() and cpufreq_cpu_put(). Thanks to Viresh Kumar for suggesting the fix. Addresses-Coverity: ("Dereference null return") Fixes: b43a7ffbf33b ("cpufreq: Notify all policy->cpus in cpufreq_notify_transition()") Suggested-by: Viresh Kumar Signed-off-by: Colin Ian King Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/powernow-k8.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -887,9 +887,9 @@ static int get_transition_latency(struct /* Take a frequency, and issue the fid/vid transition command */ static int transition_frequency_fidvid(struct powernow_k8_data *data, - unsigned int index) + unsigned int index, + struct cpufreq_policy *policy) { - struct cpufreq_policy *policy; u32 fid = 0; u32 vid = 0; int res; @@ -921,9 +921,6 @@ static int transition_frequency_fidvid(s freqs.old = find_khz_freq_from_fid(data->currfid); freqs.new = find_khz_freq_from_fid(fid); - policy = cpufreq_cpu_get(smp_processor_id()); - cpufreq_cpu_put(policy); - cpufreq_freq_transition_begin(policy, &freqs); res = transition_fid_vid(data, fid, vid); cpufreq_freq_transition_end(policy, &freqs, res); @@ -978,7 +975,7 @@ static long powernowk8_target_fn(void *a powernow_k8_acpi_pst_values(data, newstate); - ret = transition_frequency_fidvid(data, newstate); + ret = transition_frequency_fidvid(data, newstate, pol); if (ret) { pr_err("transition frequency failed\n"); From patchwork Fri Jan 15 12:27:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364534 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 1A4E9C433E0 for ; Fri, 15 Jan 2021 13:06:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D56CB2256F for ; Fri, 15 Jan 2021 13:06:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732750AbhAONGO (ORCPT ); Fri, 15 Jan 2021 08:06:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:37372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732600AbhAOMbY (ORCPT ); Fri, 15 Jan 2021 07:31:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D90542388B; Fri, 15 Jan 2021 12:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713815; bh=n761rq/3t9boAak4A1iA/Jpi2B9RN4fWjzunJ+GcDYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ukR/dY8/LTD1BtNQOm414zPyVWHt5YvUShnm/lmyz9BY6eMrZyhkxndlooOJcUgwG jQIMi5IHpc7dFeCd9Hm+ZyIIVRvNv7va+R2sTXZSrFaE0soj+hTCyMRygKJjRXgdnm EweI6TfOgUSfqcAehfxfehwpTM4/gapfD0Ke+SU4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shravya Kumbham , Radhey Shyam Pandey , Vinod Koul Subject: [PATCH 4.9 16/25] dmaengine: xilinx_dma: check dma_async_device_register return value Date: Fri, 15 Jan 2021 13:27:47 +0100 Message-Id: <20210115121957.484683526@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shravya Kumbham commit 99974aedbd73523969afb09f33c6e3047cd0ddae upstream. dma_async_device_register() can return non-zero error code. Add condition to check the return value of dma_async_device_register function and handle the error path. Addresses-Coverity: Event check_return. Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/xilinx/xilinx_dma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2630,7 +2630,11 @@ static int xilinx_dma_probe(struct platf } /* Register the DMA engine with the core */ - dma_async_device_register(&xdev->common); + err = dma_async_device_register(&xdev->common); + if (err) { + dev_err(xdev->dev, "failed to register the dma device\n"); + goto error; + } err = of_dma_controller_register(node, of_dma_xilinx_xlate, xdev); From patchwork Fri Jan 15 12:27:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364528 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 00488C43333 for ; Fri, 15 Jan 2021 13:07:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD0CA221FA for ; Fri, 15 Jan 2021 13:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732380AbhAOMbC (ORCPT ); Fri, 15 Jan 2021 07:31:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:36438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732335AbhAOMbB (ORCPT ); Fri, 15 Jan 2021 07:31:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1845D238A1; Fri, 15 Jan 2021 12:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713817; bh=LaiKbeaxpVHeaWg5MB49PRv5cDA81AaXYmPhwYSVYFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XY2ZkgsJfhxu5Ej+Rvif6A0ojNDIdRSdKgrQjZiFb8SK8wmaUZO1ID6R23gEm/m3N 6nsM1V4kcBaciUzs90d4sJuXXybaC6vr1jp7zYCmg+iQodcMDRMkaFp/NPlXMzbxRz nZGC7kPBqeJI6NFQ2azZygCycBeTHLC4Nn2XUIsg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shravya Kumbham , Radhey Shyam Pandey , Vinod Koul Subject: [PATCH 4.9 17/25] dmaengine: xilinx_dma: fix mixed_enum_type coverity warning Date: Fri, 15 Jan 2021 13:27:48 +0100 Message-Id: <20210115121957.533272012@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shravya Kumbham commit 2d5efea64472469117dc1a9a39530069e95b21e9 upstream. Typecast the fls(width -1) with (enum dmaengine_alignment) in xilinx_dma_chan_probe function to fix the coverity warning. Addresses-Coverity: Event mixed_enum_type. Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1608722462-29519-4-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/xilinx/xilinx_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2357,7 +2357,7 @@ static int xilinx_dma_chan_probe(struct has_dre = false; if (!has_dre) - xdev->common.copy_align = fls(width - 1); + xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1); if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") || of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") || From patchwork Fri Jan 15 12:27:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363612 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp275785jap; Fri, 15 Jan 2021 05:06:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJziujaTLBwTJdeYC7jZZVFnQ9XWWetYhWY8keW36ptN/tCsWYKHhaiWqvcOg2yB5AtXS9yZ X-Received: by 2002:aa7:db85:: with SMTP id u5mr2426433edt.107.1610716017687; Fri, 15 Jan 2021 05:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610716017; cv=none; d=google.com; s=arc-20160816; b=W0k0EuO1A5wQLHkxQJr8j09/AJF34s14DaxtOUGT9MB13Gw/eDyJwectJg3MyGVUHZ X1gOpKwvZXOm1VBx17FhqjSJsmG0arD6S0jjc0A7+5qNWpHAD9Ym8TLzlxhQjdA+x+0n /zhBO2DRNX7b3Tin/gUpN64cDZK0FMmDqGP47/PMAMYsJla/0CT0rw3VP7oaFWIChk3W 9kyz6azMd3NVR30IojdfYvgtvLq0M9V6D1TtxujCq6jpGDtFQ5COSRvRo8COJ6E0LPir +X9EubLJt8CWp2aaWvj+KpFGMa0v/N+9ZFrz9IEZKyZuqki3Z2Tf8q3T8PgACoj2oLQM iY+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K+aLa4Lwtw23nHeiF3ghOlPKPHvOdg5oqR0v3xRwTUA=; b=I9zDq5VXtJfoL91QtnDU0HqF8ASp3Sd61y9weNbEpw27D4EbHrPKiDX4UHI31RKjTX 8CJ3uJmAIOCJ68dCGEws6fe/ZuO8jPZ50sck1YmzgS/JyH1FrwL5ZWHfAuVwaH2C/4Rb oADxCTRyBxQYBVIroRjBQIm3rXeyfIxyYS/FzzVKDcUuecvMmbhU8o0sLPCHB1T4xvxW eB+EuN0q6vzvLm02LDVfExjQoMKJMCbbb+rJZLoyJZEz9tD9yGLBSckF3vKSQOMOAkcF zBZkBoC2Q/xYmtWUNuBLUmjnsws8tm83GW0Q30hCK/ne4XxpdAxW8eROuIIQTLR1e1Sg RsUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SnOIjkL4; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si3543505edw.47.2021.01.15.05.06.57; Fri, 15 Jan 2021 05:06:57 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SnOIjkL4; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732984AbhAONF5 (ORCPT + 13 others); Fri, 15 Jan 2021 08:05:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:37400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732613AbhAOMb0 (ORCPT ); Fri, 15 Jan 2021 07:31:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D407238D6; Fri, 15 Jan 2021 12:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713819; bh=s5rdMnDuSkDqSsdKS3Kfx41GvoHWbEtG2/DA60iC/qQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SnOIjkL46ChIRzjgDCyWIeSR4wwnzbQnf16PJBf2zEW9LePuJkZ9QZpFX6tNXSTLl HJztlLTnfiiol8E3dDrnOoXTdkcBE8q2/p1r6+N9GDOFyoKjuVgciChJcayBvbYVaP m0ki4EYS/Gs3J8rl9Wb8WSfP1at7y87dCOqIhCH0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "David S. Miller" Subject: [PATCH 4.9 18/25] wil6210: select CONFIG_CRC32 Date: Fri, 15 Jan 2021 13:27:49 +0100 Message-Id: <20210115121957.581983317@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit e186620d7bf11b274b985b839c38266d7918cc05 upstream. Without crc32, the driver fails to link: arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o: in function `wil_fw_verify': fw.c:(.text+0x74c): undefined reference to `crc32_le' arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o:fw.c:(.text+0x758): more undefined references to `crc32_le' follow Fixes: 151a9706503f ("wil6210: firmware download") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/wil6210/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wireless/ath/wil6210/Kconfig +++ b/drivers/net/wireless/ath/wil6210/Kconfig @@ -1,6 +1,7 @@ config WIL6210 tristate "Wilocity 60g WiFi card wil6210 support" select WANT_DEV_COREDUMP + select CRC32 depends on CFG80211 depends on PCI default n From patchwork Fri Jan 15 12:27:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363615 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp277447jap; Fri, 15 Jan 2021 05:08:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwk7outI6eQMYCmIssnGxEc2KueQqp9MxOOSERe4DjI53CNRPxWrYir/OKA/9wYOKjoLe1F X-Received: by 2002:a17:906:2746:: with SMTP id a6mr68177ejd.237.1610716130498; Fri, 15 Jan 2021 05:08:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610716130; cv=none; d=google.com; s=arc-20160816; b=dlqC4uV3IeYr9gMg5qPbGuU1krJb6nX4e4mkP0hJFP6MbAYqxUvgEzg2Owku3ulYXw Czqp984ZI+lhAgIgrhHTvCdmWNwfolpANP3+e2tF/UGPLIF7LtFb81Jmuny16hJERVQv GnwP98Fcuvrgiz6jGL/qU6v20GAc4lTyD/kjqY84vwdu8y8RsIzUpbBLSo8KyeahB/ez 5+gp2CEp/9vRrMlygnABMeaTFzG1p+QJkudl9Le2IMeXzQhE32Cmkr6+HfYuEutk5hoe CDX09aD31Rw96SuxxFmukoHFfyWclhHVe9MQFkCGKcdREGU5dhKMeCiZKUvF0fy5FMsR FsXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D52Uqw/nmge54pey2TdC1A+AjzjXiHO10KlcOW6D8Qw=; b=z0B/WSPYkZsdtAbPQZwvpSZ6oWxIjjXHpsZCxBhpmkS7F7EyMtoS4Z7j49cKoVJnky Fa0OM5o2jeApmI+Fb8dLB7fkYc+9bq3ru06hM/pF6iG5moyOvvUPjKVlRRW5SQLAs0v5 p6qDP3o02eEDK+zjva0lvNQ0si+K6bOXlKNTmWMnXUYzS3Pg/m4C4B6JBI0mic9wCX6n YvHGGAPf6qPhnyKos7s0hDyOlEwLqIp0Yat8zj1ZwRL9Ic1iLXSi9UYVftbxYur8GzPZ zw6E/PzSPSpcnM058OOylvhIN/UwKrqxVgctvGgk3HVP+l5RCU/35h1O+i9hFdVy9UUe fsfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f04XYwKH; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp19si3704068ejc.733.2021.01.15.05.08.50; Fri, 15 Jan 2021 05:08:50 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f04XYwKH; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732391AbhAOMbC (ORCPT + 13 others); Fri, 15 Jan 2021 07:31:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:36440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732377AbhAOMbC (ORCPT ); Fri, 15 Jan 2021 07:31:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7FF43238D7; Fri, 15 Jan 2021 12:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713822; bh=c7YoAYFw9/3c0BZbm9F13wPZE3g2L/aPRDghzHqjyf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f04XYwKHV9NcAz9HiL15Lb0/4ItaHAqsIQuelV98ISz96V9L8rjHs5Ca1eRxUZVLY 1Z8TCUUwC55RKwT4hBeX7Yc2Keea5aNxTsGdDaCe+zQjIbpLCZ/6lJTpaOhNT+pu27 fDgjawbXjAXqMN0nxH3nFv0K414UtBek3kZmfqz0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jens Axboe Subject: [PATCH 4.9 19/25] block: rsxx: select CONFIG_CRC32 Date: Fri, 15 Jan 2021 13:27:50 +0100 Message-Id: <20210115121957.630140417@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 36a106a4c1c100d55ba3d32a21ef748cfcd4fa99 upstream. Without crc32, the driver fails to link: arm-linux-gnueabi-ld: drivers/block/rsxx/config.o: in function `rsxx_load_config': config.c:(.text+0x124): undefined reference to `crc32_le' Fixes: 8722ff8cdbfa ("block: IBM RamSan 70/80 device driver") Signed-off-by: Arnd Bergmann Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -530,6 +530,7 @@ config BLK_DEV_RBD config BLK_DEV_RSXX tristate "IBM Flash Adapter 900GB Full Height PCIe Device Driver" depends on PCI + select CRC32 help Device driver for IBM's high speed PCIe SSD storage device: Flash Adapter 900GB Full Height. From patchwork Fri Jan 15 12:27:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364537 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 6B944C4332E for ; Fri, 15 Jan 2021 13:05:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C901221FA for ; Fri, 15 Jan 2021 13:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732625AbhAOMb1 (ORCPT ); Fri, 15 Jan 2021 07:31:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:37412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732618AbhAOMb1 (ORCPT ); Fri, 15 Jan 2021 07:31:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AEA5A238E3; Fri, 15 Jan 2021 12:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713824; bh=7DhH4CeaiM1Ol8TRHyRqIFvNkZi+WpYGPYti91uLLGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iIi6/ky/0FhiKEUftAoszCNhsPjB0Bbmnv6ooO5jiHO7bGcQ9FgW6YTBgZYmOrbRz PrGkNdesvZiOYmcUtcDTMoeSXw991/2+zORT9fjXfgJOvOudLFnogY1eyqpWAtYubY qTYFxE57lspVpwJNryU6irxbzakOPu4eCm3vWK8g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Lu Baolu , Will Deacon Subject: [PATCH 4.9 20/25] iommu/intel: Fix memleak in intel_irq_remapping_alloc Date: Fri, 15 Jan 2021 13:27:51 +0100 Message-Id: <20210115121957.682602102@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu commit ff2b46d7cff80d27d82f7f3252711f4ca1666129 upstream. When irq_domain_get_irq_data() or irqd_cfg() fails at i == 0, data allocated by kzalloc() has not been freed before returning, which leads to memleak. Fixes: b106ee63abcc ("irq_remapping/vt-d: Enhance Intel IR driver to support hierarchical irqdomains") Signed-off-by: Dinghao Liu Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20210105051837.32118-1-dinghao.liu@zju.edu.cn Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/intel_irq_remapping.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c @@ -1350,6 +1350,8 @@ static int intel_irq_remapping_alloc(str irq_data = irq_domain_get_irq_data(domain, virq + i); irq_cfg = irqd_cfg(irq_data); if (!irq_data || !irq_cfg) { + if (!i) + kfree(data); ret = -EINVAL; goto out_free_data; } From patchwork Fri Jan 15 12:27:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364539 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 79840C433DB for ; Fri, 15 Jan 2021 13:05:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FDEA221FA for ; Fri, 15 Jan 2021 13:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732648AbhAOMba (ORCPT ); Fri, 15 Jan 2021 07:31:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:37452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732634AbhAOMb3 (ORCPT ); Fri, 15 Jan 2021 07:31:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1F0E423998; Fri, 15 Jan 2021 12:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713828; bh=1zs3vFrHTDknk5gPcaIjBIaNaKNOFQblPoXkDQ1jOF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XzoCHl/wxHCkEPECUFNhG/WlXW0uPEshg6coRW8bPkM1hMXqN3MFqDitWg51od+n7 oGW23qSJUmRgcyeZ/m487WohXPhICX7Hga7EFMFBHmx5YwIf+yEOIVVRC+CoKHYqcX 5osnZbITixvRGKsHj7nXiHql6wsp3XUGoOWiMAQA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Leon Romanovsky , Saeed Mahameed Subject: [PATCH 4.9 21/25] net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups Date: Fri, 15 Jan 2021 13:27:52 +0100 Message-Id: <20210115121957.735168948@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu commit 5b0bb12c58ac7d22e05b5bfdaa30a116c8c32e32 upstream. When mlx5_create_flow_group() fails, ft->g should be freed just like when kvzalloc() fails. The caller of mlx5e_create_l2_table_groups() does not catch this issue on failure, which leads to memleak. Fixes: 33cfaaa8f36f ("net/mlx5e: Split the main flow steering table") Signed-off-by: Dinghao Liu Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c @@ -930,6 +930,7 @@ err_destroy_groups: ft->g[ft->num_groups] = NULL; mlx5e_destroy_groups(ft); kvfree(in); + kfree(ft->g); return err; } From patchwork Fri Jan 15 12:27:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363614 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp277376jap; Fri, 15 Jan 2021 05:08:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbAAvNODBsYjQ4+1QaJU0+5U7nwX/L27+gcCMNIyoL6wENAc9bBSF+TL8hKKP4WjoF9ADx X-Received: by 2002:aa7:c886:: with SMTP id p6mr9571635eds.207.1610716126033; Fri, 15 Jan 2021 05:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610716126; cv=none; d=google.com; s=arc-20160816; b=A9F+ODpztYNT7ABDoMyuDwgW2ynYJUV1ywLTUCUJiuz3lv8UWUFQeZLZBAgu6jc2CB 9NUWjch/3Ftxe6pSCc33lIu9G4e936aUxOYk+gIOMQoJGfBBtQggeoUfJPvZPHyOOUQi JHoFfzZ+ZohUwO+/YGUND/ax7iyL1UAXnEhFU/qyZDEI74xc4vmjKcGxa2g0nWHsoHEH ZGLi4HHuXftXhXgIbVG4pwUW8EG7iLl4E0Urs+wuCnia/N79Yd+aehT3qnMpIDdt7HOE xCBPtVl4smqb1DAy6ln4Z0qA0SgIto/Bzie6NU5Jkbc5VzpcHNXgiLzcWtQ02mPJIzfg zc8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8V19FoB/3kYTuImn7NMSRUArBF62snp98xo3FAUqQYE=; b=OV3zEtKu7WVjDnlQQ0exJU6vP+PiHHf/BWALmQe8YBYaskUV6A5zeGfS7yB+cDWdj5 GsSGr9ayCcaIVDnCb5tIhCeG2WiDVUeRtp47otoSX8v48w3aCaOuU0aqpT0y5/EWGYfn Zba3HsUqacwjD3rfMQrJ/mcUVtNMFsqctwkHTfSGfCmZTt4em2DENpbeFC0DC6HsraKz wjEBAX4Tc8fDe7CxXtIa+4rFp2gbDmTFNKMowyV4Rra9Uf8922kcdjqVsG4LbHroheO3 2/MoYG3Q2u2wqLpKwH2v9BAa/GtqbwwpgTMpSYJagBbpyzd972fSxuAN/ZEcbfWq7Uhq JSxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XqmweKeL; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp19si3704068ejc.733.2021.01.15.05.08.45; Fri, 15 Jan 2021 05:08:46 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XqmweKeL; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732432AbhAOMbF (ORCPT + 13 others); Fri, 15 Jan 2021 07:31:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:36470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732423AbhAOMbE (ORCPT ); Fri, 15 Jan 2021 07:31:04 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F3FF238E7; Fri, 15 Jan 2021 12:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713830; bh=fA0KTB++A7mRqnSitYulWdbeN4Ebxk5der3k//c7uXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XqmweKeL2liDtik5yJwOt0a/Nx/RIyANMSvkmlezDLeUlXrq+PF7qlZOR06XzdEff 3p5b3ySwh0lXEHHZwoAKjiRx5CO4KIceaskDSMvlUBpmmAj+bU+EvcrakVzmbx2n80 oe67e+0iptssJahnrOBmK8hELjYKLuw8oKpIi2jg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "David S. Miller" Subject: [PATCH 4.9 22/25] wan: ds26522: select CONFIG_BITREVERSE Date: Fri, 15 Jan 2021 13:27:53 +0100 Message-Id: <20210115121957.783492596@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 69931e11288520c250152180ecf9b6ac5e6e40ed upstream. Without this, the driver runs into a link failure arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_ds26522_probe': slic_ds26522.c:(.text+0x100c): undefined reference to `byte_rev_table' arm-linux-gnueabi-ld: slic_ds26522.c:(.text+0x1cdc): undefined reference to `byte_rev_table' arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_write': slic_ds26522.c:(.text+0x1e4c): undefined reference to `byte_rev_table' Fixes: c37d4a0085c5 ("Maxim/driver: Add driver for maxim ds26522") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wan/Kconfig +++ b/drivers/net/wan/Kconfig @@ -295,6 +295,7 @@ config SLIC_DS26522 tristate "Slic Maxim ds26522 card support" depends on SPI depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE || COMPILE_TEST + select BITREVERSE help This module initializes and configures the slic maxim card in T1 or E1 mode. From patchwork Fri Jan 15 12:27:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364530 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 3D2BBC433E9 for ; Fri, 15 Jan 2021 13:07:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7188221FA for ; Fri, 15 Jan 2021 13:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732114AbhAOMbL (ORCPT ); Fri, 15 Jan 2021 07:31:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:36246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732466AbhAOMbL (ORCPT ); Fri, 15 Jan 2021 07:31:11 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8AA82396D; Fri, 15 Jan 2021 12:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713837; bh=/MzmxlQsAfkJBQwXT4HMkPiUiPYJaPi5ZR1ay9LYSSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzufzsekvyBvkhA+W68g3KthBR4TgFvOEwFscH90NPcICrNTcmW5dUfkf5QzjadCk 2YW1DkwAMgtIXx1aCx3Q/Fd7dW9ULZokCoXNshXzbqJqyw87mkNJH86tm3a3dVH7EN vpCDeloSUunnBFDSW9M+pNLLMh8Us4QWecx2bC3U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+7010af67ced6105e5ab6@syzkaller.appspotmail.com, Vasily Averin , Willem de Bruijn , Jakub Kicinski Subject: [PATCH 4.9 25/25] net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet Date: Fri, 15 Jan 2021 13:27:56 +0100 Message-Id: <20210115121957.929556660@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.679956165@linuxfoundation.org> References: <20210115121956.679956165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vasily Averin commit 54970a2fbb673f090b7f02d7f57b10b2e0707155 upstream. syzbot reproduces BUG_ON in skb_checksum_help(): tun creates (bogus) skb with huge partial-checksummed area and small ip packet inside. Then ip_rcv trims the skb based on size of internal ip packet, after that csum offset points beyond of trimmed skb. Then checksum_tg() called via netfilter hook triggers BUG_ON: offset = skb_checksum_start_offset(skb); BUG_ON(offset >= skb_headlen(skb)); To work around the problem this patch forces pskb_trim_rcsum_slow() to return -EINVAL in described scenario. It allows its callers to drop such kind of packets. Link: https://syzkaller.appspot.com/bug?id=b419a5ca95062664fe1a60b764621eb4526e2cd0 Reported-by: syzbot+7010af67ced6105e5ab6@syzkaller.appspotmail.com Signed-off-by: Vasily Averin Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/1b2494af-2c56-8ee2-7bc0-923fcad1cdf8@virtuozzo.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/core/skbuff.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1592,6 +1592,12 @@ int pskb_trim_rcsum_slow(struct sk_buff skb->csum = csum_block_sub(skb->csum, skb_checksum(skb, len, delta, 0), len); + } else if (skb->ip_summed == CHECKSUM_PARTIAL) { + int hdlen = (len > skb_headlen(skb)) ? skb_headlen(skb) : len; + int offset = skb_checksum_start_offset(skb) + skb->csum_offset; + + if (offset + sizeof(__sum16) > hdlen) + return -EINVAL; } return __pskb_trim(skb, len); }