Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp394119pxp; Fri, 11 Mar 2022 06:27:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzt2JeFNq4/PCXYDe/4WOFwj9pe2dS3HtAyqqM6SyK4mkjWEq572A9GBun4XsIkAy7QHIuo X-Received: by 2002:a17:906:b7d2:b0:6db:385:dafd with SMTP id fy18-20020a170906b7d200b006db0385dafdmr9047085ejb.139.1647008854182; Fri, 11 Mar 2022 06:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647008854; cv=none; d=google.com; s=arc-20160816; b=V7tsKB5lGqfOORATinmcDM56vPbouwHRC/qi0TzXJYliq3Q5591us9ZniYAkwNRelJ RSYEoTpn5Fsvd9B4ji9d00743vnKEcmIYt+IdahdHVmwSO13rtYJvnbftz1mSYA/nqzZ m6pYE4SzJib69LIAvkuCiSwDWLAFfYwX9rwpCRftgaqZDos100O/3yFkGyBu4knjoqZG zGyTZd/ZCUVjgjW1XacX2ahkXWG23I9UQOWZe9y3wll/hjTwqLAwbCyiNleBo+XPhJUO W9oqYqCRjAake8MzLtbstuHjpRdiSW5qbfjagoOwjN9EdRTba5om36OV+JPSRaWpOB59 9tVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=C26Xd5SFA51JD8n7O4vVJ7Y+klB3lT6XQZ97SKJ4BDw=; b=AQJWv52P5zwVCuaxlLhYdPs+0dv3dIyUUoxh4KxBx0j7ybkoq1AJS+hTgoTKNNYGYj s2FMdnQ1cC5lRyL6OtseishsKIIXeCo3Eb5Qymmdq9zfp4q0CMBuLHynr2zvUbrKbc2f 7c5Qwrb4dxBsVSgsWKsz9aUtCIBNZauZr9LGlFMuakVm76uOUVagO5swD/pXWfzoZ721 1170RAfgJjqobJEZzlmKwGXS0F0gKPkv1Uy3EwuylRaZiSfl+QJCUGdGM4T6v5w4vJ7G 1dv/uz73PmOKPmSI4jyzKbNvhZxoZSgCXQJAH23BXaa00fFx1hNutNfXfaRjoIzkshei tuWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T96twDB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r26-20020a05640216da00b0041613e9744csi5239939edx.294.2022.03.11.06.27.11; Fri, 11 Mar 2022 06:27:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T96twDB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245541AbiCJSpZ (ORCPT + 99 others); Thu, 10 Mar 2022 13:45:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236161AbiCJSpY (ORCPT ); Thu, 10 Mar 2022 13:45:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6DEC410BBE4 for ; Thu, 10 Mar 2022 10:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646937862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=C26Xd5SFA51JD8n7O4vVJ7Y+klB3lT6XQZ97SKJ4BDw=; b=T96twDB1RFOdqJ/zsVsRWlp9kly05C160klIxtMr2eXTzE6NCCmQ8gGZvkmK8EWVHgXNnQ pS/S5VNmEbQSj+dWRiYrCjKXjEACvEYElHwZGC4pnUvgz4sARbnDjCMBbt3+n1DuE3WagG HeYFtyOqAT/bYsQq3OeBYGL2Geck020= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-252-unP1m22ZMr6noMVdO7thwA-1; Thu, 10 Mar 2022 13:44:16 -0500 X-MC-Unique: unP1m22ZMr6noMVdO7thwA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E85F31854E21; Thu, 10 Mar 2022 18:44:14 +0000 (UTC) Received: from RHTPC1VM0NT (unknown [10.22.17.112]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C930841CF; Thu, 10 Mar 2022 18:44:12 +0000 (UTC) From: Aaron Conole To: Ilya Maximets Cc: Jakub Kicinski , Roi Dayan , "David S. Miller" , Pravin B Shelar , Toms Atteka , netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org, Johannes Berg Subject: Re: [PATCH net-next v2] net: openvswitch: fix uAPI incompatibility with existing user space References: <20220309222033.3018976-1-i.maximets@ovn.org> Date: Thu, 10 Mar 2022 13:44:12 -0500 In-Reply-To: <20220309222033.3018976-1-i.maximets@ovn.org> (Ilya Maximets's message of "Wed, 9 Mar 2022 23:20:33 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ilya Maximets writes: > Few years ago OVS user space made a strange choice in the commit [1] > to define types only valid for the user space inside the copy of a > kernel uAPI header. '#ifndef __KERNEL__' and another attribute was > added later. > > This leads to the inevitable clash between user space and kernel types > when the kernel uAPI is extended. The issue was unveiled with the > addition of a new type for IPv6 extension header in kernel uAPI. > > When kernel provides the OVS_KEY_ATTR_IPV6_EXTHDRS attribute to the > older user space application, application tries to parse it as > OVS_KEY_ATTR_PACKET_TYPE and discards the whole netlink message as > malformed. Since OVS_KEY_ATTR_IPV6_EXTHDRS is supplied along with > every IPv6 packet that goes to the user space, IPv6 support is fully > broken. > > Fixing that by bringing these user space attributes to the kernel > uAPI to avoid the clash. Strictly speaking this is not the problem > of the kernel uAPI, but changing it is the only way to avoid breakage > of the older user space applications at this point. > > These 2 types are explicitly rejected now since they should not be > passed to the kernel. Additionally, OVS_KEY_ATTR_TUNNEL_INFO moved > out from the '#ifdef __KERNEL__' as there is no good reason to hide > it from the userspace. And it's also explicitly rejected now, because > it's for in-kernel use only. > > Comments with warnings were added to avoid the problem coming back. > > (1 << type) converted to (1ULL << type) to avoid integer overflow on > OVS_KEY_ATTR_IPV6_EXTHDRS, since it equals 32 now. > > [1] beb75a40fdc2 ("userspace: Switching of L3 packets in L2 pipeline") > > Fixes: 28a3f0601727 ("net: openvswitch: IPv6: Add IPv6 extension header support") > Link: https://lore.kernel.org/netdev/3adf00c7-fe65-3ef4-b6d7-6d8a0cad8a5f@nvidia.com > Link: https://github.com/openvswitch/ovs/commit/beb75a40fdc295bfd6521b0068b4cd12f6de507c > Reported-by: Roi Dayan > Signed-off-by: Ilya Maximets > --- Acked-by: Aaron Conole