From patchwork Mon Mar 11 07:36:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1054194 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44HqgJ058bz9s5c; Mon, 11 Mar 2019 18:36:58 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1h3FUP-00034l-KL; Mon, 11 Mar 2019 07:36:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1h3FUN-00034S-Dk for kernel-team@lists.ubuntu.com; Mon, 11 Mar 2019 07:36:47 +0000 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1h3FUN-00016x-3U for kernel-team@lists.ubuntu.com; Mon, 11 Mar 2019 07:36:47 +0000 Received: by mail-ed1-f71.google.com with SMTP id m25so1639218edd.6 for ; Mon, 11 Mar 2019 00:36:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rCzk1GR45ZWW7t1YfsZjG4p/8uV8urfAS4x0TfIpgzs=; b=sIXEUnXTRr/IAhT3zPMQrRkYdoueEiZbBZoVuhAOsHX113V4T8//eipyeMqaR+cl8U ZrRgaIYgh5rcGJpIIc4cydbWt5yyRM75jwEx4zkrY/WMMjhcF+OvpFPwQKws9taE/x4p XjKq00GxBUdBoWQtjJI/Ogm09x/NT5y8vMem2DXzd2wlUJ6ZOcEbHIycXyU1z7G4mveJ K76M7PeWWYZs6nuiH4Nk7Hh6F4qITNzzD1L+uQZcmYNgi4flYrKXFPKKPkgxJlUq1OeA /FTyJstbrlR6/l+g8uuaXSR86Rm5du0atvydAeH+rj1fTFGTVJkxv+AGLiYfXDNKanX6 A2jg== X-Gm-Message-State: APjAAAVE80hLy9RSJ7sKYDoJ1G+qNqBGE9hieYLsWyli+r+1ch1K4nnv GKe4UWKw6mPOiAv4AgK/fugRi5DsWfnn9BC9fVi0pBLevjeMjmRa3RVIde6bYE0sRBFER/L/KzB iOsAgaybnecE6vi9QI4fsZgxG4Hd83CSLkvBnBbM4PA== X-Received: by 2002:a17:906:48c:: with SMTP id f12mr20895299eja.244.1552289806482; Mon, 11 Mar 2019 00:36:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUsZIlXcpgoqbPj1vW14xqOKKn/l/J8J82itLObeQdreypdrmHpFmRA7JCbooj+yCYA60G8w== X-Received: by 2002:a17:906:48c:: with SMTP id f12mr20895281eja.244.1552289806130; Mon, 11 Mar 2019 00:36:46 -0700 (PDT) Received: from gollum.fritz.box ([81.221.192.120]) by smtp.gmail.com with ESMTPSA id l5sm1055353edr.75.2019.03.11.00.36.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 00:36:45 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Bionic/Cosmic/Disco/Unstable][SRU][PATCH 1/1] UBUNTU: SAUCE: openvswitch: Disable eventmask support on 32-bit Date: Mon, 11 Mar 2019 08:36:43 +0100 Message-Id: <20190311073643.11829-2-juergh@canonical.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190311073643.11829-1-juergh@canonical.com> References: <20190311073643.11829-1-juergh@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1736390 Openvswitch eventmask support for CT actions was introduced with commit 120645513f55 ("openvswitch: Add eventmask support to CT action."). This commit introduces a regression on i386 which results in a kernel crash. Fix that by disabling eventmask support on i386. Per upstream, the result of *not* having this "will cause additional CPU use and potential buffering issues for CT event monitors in userspace." https://lore.kernel.org/lkml/E891AED6-8406-4914-BDC3-92248F77C63B@ovn.org/ Fixes: 120645513f55 ("openvswitch: Add eventmask support to CT action.") Signed-off-by: Juerg Haefliger --- include/uapi/linux/openvswitch.h | 2 ++ net/openvswitch/conntrack.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index dcfab5e3b55c..9da2942d7f7e 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h @@ -744,7 +744,9 @@ enum ovs_ct_attr { related connections. */ OVS_CT_ATTR_NAT, /* Nested OVS_NAT_ATTR_* */ OVS_CT_ATTR_FORCE_COMMIT, /* No argument */ +#ifndef CONFIG_X86_32 OVS_CT_ATTR_EVENTMASK, /* u32 mask of IPCT_* events. */ +#endif __OVS_CT_ATTR_MAX }; diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 8f04bd6e44bb..0c44fb56317e 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -66,9 +66,13 @@ struct ovs_conntrack_info { u8 commit : 1; u8 nat : 3; /* enum ovs_ct_nat */ u8 force : 1; +#ifndef CONFIG_X86_32 u8 have_eventmask : 1; +#endif u16 family; +#ifndef CONFIG_X86_32 u32 eventmask; /* Mask of 1 << IPCT_*. */ +#endif struct md_mark mark; struct md_labels labels; #ifdef CONFIG_NF_NAT_NEEDED @@ -1054,6 +1058,7 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, if (!ct) return 0; +#ifndef CONFIG_X86_32 /* Set the conntrack event mask if given. NEW and DELETE events have * their own groups, but the NFNLGRP_CONNTRACK_UPDATE group listener * typically would receive many kinds of updates. Setting the event @@ -1067,6 +1072,7 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, if (cache) cache->ctmask = info->eventmask; } +#endif /* Apply changes before confirming the connection so that the initial * conntrack NEW netlink event carries the values given in the CT @@ -1340,8 +1346,10 @@ static const struct ovs_ct_len_tbl ovs_ct_attr_lens[OVS_CT_ATTR_MAX + 1] = { /* NAT length is checked when parsing the nested attributes. */ [OVS_CT_ATTR_NAT] = { .minlen = 0, .maxlen = INT_MAX }, #endif +#ifndef CONFIG_X86_32 [OVS_CT_ATTR_EVENTMASK] = { .minlen = sizeof(u32), .maxlen = sizeof(u32) }, +#endif }; static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info, @@ -1423,10 +1431,12 @@ static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info, break; } #endif +#ifndef CONFIG_X86_32 case OVS_CT_ATTR_EVENTMASK: info->have_eventmask = true; info->eventmask = nla_get_u32(a); break; +#endif default: OVS_NLERR(log, "Unknown conntrack attr (%d)", @@ -1627,9 +1637,11 @@ int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info, ct_info->helper->name)) return -EMSGSIZE; } +#ifndef CONFIG_X86_32 if (ct_info->have_eventmask && nla_put_u32(skb, OVS_CT_ATTR_EVENTMASK, ct_info->eventmask)) return -EMSGSIZE; +#endif #ifdef CONFIG_NF_NAT_NEEDED if (ct_info->nat && !ovs_ct_nat_to_attr(ct_info, skb))