{"id":830157,"url":"http://patchwork.ozlabs.org/api/1.2/patches/830157/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20171025092734.51299-1-mika.westerberg@linux.intel.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20171025092734.51299-1-mika.westerberg@linux.intel.com>","list_archive_url":null,"date":"2017-10-25T09:27:34","name":"thunderbolt: Drop sequence number check from tb_xdomain_match()","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"215eaf863eec0a7b385bb4a7dc90a5c4f21b142c","submitter":{"id":14534,"url":"http://patchwork.ozlabs.org/api/1.2/people/14534/?format=json","name":"Mika Westerberg","email":"mika.westerberg@linux.intel.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20171025092734.51299-1-mika.westerberg@linux.intel.com/mbox/","series":[{"id":10118,"url":"http://patchwork.ozlabs.org/api/1.2/series/10118/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=10118","date":"2017-10-25T09:27:34","name":"thunderbolt: Drop sequence number check from tb_xdomain_match()","version":1,"mbox":"http://patchwork.ozlabs.org/series/10118/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/830157/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/830157/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yMPtl6yxFz9sNx\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 25 Oct 2017 20:27:43 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932409AbdJYJ1l (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 25 Oct 2017 05:27:41 -0400","from mga14.intel.com ([192.55.52.115]:20736 \"EHLO mga14.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S932253AbdJYJ1j (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 25 Oct 2017 05:27:39 -0400","from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Oct 2017 02:27:38 -0700","from black.fi.intel.com ([10.237.72.28])\n\tby fmsmga004.fm.intel.com with ESMTP; 25 Oct 2017 02:27:35 -0700","by black.fi.intel.com (Postfix, from userid 1001)\n\tid 12E67195; Wed, 25 Oct 2017 12:27:34 +0300 (EEST)"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.43,431,1503385200\"; d=\"scan'208\";a=\"327451544\"","From":"Mika Westerberg <mika.westerberg@linux.intel.com>","To":"David Miller <davem@davemloft.net>","Cc":"Andreas Noever <andreas.noever@gmail.com>,\n\tMichael Jamet <michael.jamet@intel.com>,\n\tYehezkel Bernat <yehezkel.bernat@intel.com>,\n\tDan Carpenter <dan.carpenter@oracle.com>,\n\tAmir Levy <amir.jer.levy@intel.com>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org","Subject":"[PATCH] thunderbolt: Drop sequence number check from\n\ttb_xdomain_match()","Date":"Wed, 25 Oct 2017 12:27:34 +0300","Message-Id":"<20171025092734.51299-1-mika.westerberg@linux.intel.com>","X-Mailer":"git-send-email 2.14.2","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"Commit 9a03c3d398c1 (\"thunderbolt: Fix a couple right shifting to zero\nbugs\") revealed an issue that was previously hidden because we never\nactually compared received XDomain message sequence numbers properly.\nThe idea with these sequence numbers is that the responding host uses\nthe same sequence number that was in the request packet which we can\nthen check at the requesting host.\n\nHowever, testing against macOS it looks like it does not follow this but\ninstead uses some other logic. Windows driver on the other hand handles\nit the same way than Linux.\n\nIn order to be able to talk to macOS again, fix this so that we drop the\nwhole sequence number check. This effectively works exactly the same\nthan it worked before the aforementioned commit. This also follows the\nlogic the original P2P networking code used.\n\nSigned-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>\n---\nThis applies on top of net-next.git/master.\n\n drivers/thunderbolt/xdomain.c | 9 ---------\n 1 file changed, 9 deletions(-)","diff":"diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c\nindex ff8d91189e99..f25d88d4552b 100644\n--- a/drivers/thunderbolt/xdomain.c\n+++ b/drivers/thunderbolt/xdomain.c\n@@ -56,7 +56,6 @@ static bool tb_xdomain_match(const struct tb_cfg_request *req,\n \tcase TB_CFG_PKG_XDOMAIN_RESP: {\n \t\tconst struct tb_xdp_header *res_hdr = pkg->buffer;\n \t\tconst struct tb_xdp_header *req_hdr = req->request;\n-\t\tu32 req_seq, res_seq;\n \n \t\tif (pkg->frame.size < req->response_size / 4)\n \t\t\treturn false;\n@@ -68,14 +67,6 @@ static bool tb_xdomain_match(const struct tb_cfg_request *req,\n \t\tif ((res_hdr->xd_hdr.route_lo) != req_hdr->xd_hdr.route_lo)\n \t\t\treturn false;\n \n-\t\t/* Then check that the sequence number matches */\n-\t\tres_seq = res_hdr->xd_hdr.length_sn & TB_XDOMAIN_SN_MASK;\n-\t\tres_seq >>= TB_XDOMAIN_SN_SHIFT;\n-\t\treq_seq = req_hdr->xd_hdr.length_sn & TB_XDOMAIN_SN_MASK;\n-\t\treq_seq >>= TB_XDOMAIN_SN_SHIFT;\n-\t\tif (res_seq != req_seq)\n-\t\t\treturn false;\n-\n \t\t/* Check that the XDomain protocol matches */\n \t\tif (!uuid_equal(&res_hdr->uuid, &req_hdr->uuid))\n \t\t\treturn false;\n","prefixes":[]}