From patchwork Thu Jan 12 17:42:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 3931 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4031274wrt; Thu, 12 Jan 2023 10:15:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNrFFM9aHiI4VhzzCR+Ch8f0rydumKBOEYxJMsVNwmNGit1EL7hv5wW1QkAK+Lmc0n9qJV X-Received: by 2002:aa7:90d4:0:b0:582:b8e0:bc54 with SMTP id k20-20020aa790d4000000b00582b8e0bc54mr31761776pfk.21.1673547311217; Thu, 12 Jan 2023 10:15:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673547311; cv=none; d=google.com; s=arc-20160816; b=mhhBMgD1Skq/Ga7i0nGBOv07RDSUzrT0RAz+l7kx3k357i4x3JhTCiUDqjbaCEzks1 1VzV/nAeKIU9g737ZMbPRXOMNpXjobFu4T/VKBwid3H86AIgXI2ZbvUbOnp3ng8jBLxq rCBaAx0aB+5FLeeeQXXVPRhJ6sU/B1hI2m4CV6uhDHi3hIfZdFII+XWjQY/cKwZrYZmO rmaJgrzEueGiej52swoVtaDEI5ECfPytDmpA5Xpnd7HbW5cL5kqvmk2d+Hx7HP+Bzw8m ybq/GTh/0Bx3bhJrk3ggvAwas9J5aQigwkpYiS2/WUUDxVQued/Xj6Rx00Y2Uf09wkCA jL4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=1UJtseQcGwMVKi/xxv0N3WAnrUksBlvoIFHzshgB/So=; b=sLNM5smDUCaJ8/VGWMua125HF4fsY6TuXlgvhJUSNiialsaTsNd697THbtOML+3kDC 9wGQFI3/mKPImkhN4g1LV0Qt29kJSN4DFo+EsMOqjPj6hSmxnfjJLvgDc2xYv16vZPT3 d6+14flq4MkC0KlTGwWOw6BwNfL6hBtZ3nfDwMSKZfJBwwPvteW4Y4hKxqs8dnANSJri uSB9jiJLnY1QYqUCUPRry/XJlEETLa3IEPBSX0VJyOPm35YVDDWifNC+EixtDMYHK/zw E0xnXR9KHeglFSaZZeptAX3al1CCB2qAWpMjt4es6iMU6Sjcc5yhrR6qxRharVfDEB33 mEEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=GGHisRe9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z27-20020aa7991b000000b0056bb0103ea4si17881674pff.246.2023.01.12.10.14.58; Thu, 12 Jan 2023 10:15:11 -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=@tessares.net header.s=google header.b=GGHisRe9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240271AbjALSOd (ORCPT + 99 others); Thu, 12 Jan 2023 13:14:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240513AbjALSNr (ORCPT ); Thu, 12 Jan 2023 13:13:47 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39ED66DBA6 for ; Thu, 12 Jan 2023 09:43:17 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so15716871wms.2 for ; Thu, 12 Jan 2023 09:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=1UJtseQcGwMVKi/xxv0N3WAnrUksBlvoIFHzshgB/So=; b=GGHisRe9FQZw2Pt87kLichAs0+AZaBGl/bcSl7S1ecHup0b0wTxFzsTeG1mg/vWMHh TVNKPuucTLJ1P4hSpz51ghW5gCmtkNwmyMBE+q+1JBMlJOzdjZik9b+E11x3JBYl5VSv Ql7qqItwPoR0cu9wGvRJBat8sghiGWVt4633bc/j6zF+kgF1LvCX+qtJ8HzQjBrEHwPM diEMirpaTbgks5tF+vZvmcsRRfjs21so6iZHcDf+ErOkwIMIRDp2v/rEmKEYezwdMUQY ztY7PT//kFMZvpK4rrH0FRAZg4hcJ8zBL1KT4PC3e6E60jCHgsl6q6XH59kfJfUAOrJU UGtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1UJtseQcGwMVKi/xxv0N3WAnrUksBlvoIFHzshgB/So=; b=fLTkYiPhS7sk/UETbbGEKecp7khIncw7zHpp7HItBVhVP+Km+chqNFsNn069xH4QD9 BcT4DSx3FcEqDbbn30QdXB7aUP8b6KHaEXFlCwl6gYSWeJQh76kEmnmc8kLzOkpxIPe6 J77d4DQeHBVMbPaPTOlP/gV5eTEz+d3ZEhIzPg4+48Vk4qqwAPVbCw3U2B5q4UfYPbn0 M7plJ1xPOL1zbHIgSA3JBfAXb4100JFgZ7ikkwMoWVLK6A22KzNiZOjgPsa9rJW44aSG IUYB7/GqSjkJB+m6qS9Iucdq9aU4qyohGYiVc+m9j7LOIRxC3BiH8U5H+NYF4UHaiXh7 qJug== X-Gm-Message-State: AFqh2kp5vDeRKE5pcD3+Vts4WlxsdXVL+6ncBBtsgyPEkm5Lzv4eJqpf NaVqI5ImXY4oWxqpdufIHJPALg== X-Received: by 2002:a05:600c:34d1:b0:3d7:72e3:f437 with SMTP id d17-20020a05600c34d100b003d772e3f437mr56706371wmq.21.1673545395768; Thu, 12 Jan 2023 09:43:15 -0800 (PST) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id hg9-20020a05600c538900b003cfa622a18asm26448769wmb.3.2023.01.12.09.43.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 09:43:15 -0800 (PST) From: Matthieu Baerts Subject: [PATCH net 0/3] mptcp: userspace pm: create sockets for the right family Date: Thu, 12 Jan 2023 18:42:51 +0100 Message-Id: <20230112-upstream-net-20230112-netlink-v4-v6-v1-0-6a8363a221d2@tessares.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJtGwGMC/z2NQQ6CQAxFr0K6tsnMIES8inExA1UatZIpTkwId 7ewcPleft5fQCkzKZyrBTIVVn6LgT9U0I9R7oQ8GENwoXbeB/xMOmeKLxSa8W8NniwPLEcsLaY2 dc3J1R2RAyulqIQpR+nHrWXjzU6Zbvzdvy+7u67rD9e3iq2QAAAA To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Kishen Maloor , Florian Westphal , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Paolo Abeni , Mat Martineau , Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2305; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=zm0A5mWdQk3xBGQ5u/VEO3txMGrQk2HzQqNZk2n/aw0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjwEayhLoK9HDeUD022Cd4xPH++QoWrbyoVTXRoFIt v30tzeCJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCY8BGsgAKCRD2t4JPQmmgc1SpEA CgioDccxnNIFQBbXTXuqbhabB/mTV0Wu4qLPrs4ga5lEmvbJB2jSNTXmEtScC9Pf6t3idr0PviTicf fSunIYxSTg+KX7vnmifmvmFc9fTJoKG44jxCCrfsXkV1qBn184BXjWiEoC+svh3CkWFVD+4obQbG89 6HZEQMdNOV45QP8kqYBhRHGnB1YSvktiivQz1/LbrfWxL8f7tiiuIoCg2gV+NuksfHL2bFrmv2dftr EGjBo+WfQGHV08EMYZhS1Q15buHmZsp6saUBC82xVg+L/IX7uf0RrkF6xdhjsTSWnBdLAsIv9iErgL qQ0fal8pNf0LoUlf4nud5+14msSkFPNAz8ZoYOuUNKZo3tIR4Qkbkhkpt1Ld4/HPIVAgo/R7HHfDij yxf2ShdizmRoXgzrRSP8jGoF8QwcDMA1Rx32PtXF7mtHPPNQ9Ya+UXJbhBq16GTwjNX4VZYKWj1TFF xDijT3R54uwNFUjSYasicZz+q+0YgiQ/YAi/mS/SEM/hpEh39InAxuZMGBNmOtOn6h8i7CbuznI3wq msm8hhQGnwGwagt1Ma66GVTdcNCH/Vkpg8EmAMFnUm+hLrAMSCiLCTSb1tTRcsTg0yhKI34HK99Yx9 Q1TVX0hd7JzAFCPFaiabfutjU/VQ/2Cb1ep+6bov1v/0lIMNAW+io0Ka5PSA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754841545640280500?= X-GMAIL-MSGID: =?utf-8?q?1754841545640280500?= Before these patches, the Userspace Path Manager would allow the creation of subflows with wrong families: taking the one of the MPTCP socket instead of the provided ones and resulting in the creation of subflows with likely not the right source and/or destination IPs. It would also allow the creation of subflows between different families or not respecting v4/v6-only socket attributes. Patch 1 lets the userspace PM select the proper family to avoid creating subflows with the wrong source and/or destination addresses because the family is not the expected one. Patch 2 makes sure the userspace PM doesn't allow the userspace to create subflows for a family that is not allowed. Patch 3 validates scenarios with a mix of v4 and v6 subflows for the same MPTCP connection. These patches fix issues introduced in v5.19 when the userspace path manager has been introduced. To: "David S. Miller" To: Eric Dumazet To: Jakub Kicinski To: Kishen Maloor To: Florian Westphal To: Shuah Khan Cc: netdev@vger.kernel.org Cc: mptcp@lists.linux.dev Cc: linux-kernel@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: Paolo Abeni Cc: Mat Martineau Signed-off-by: Matthieu Baerts --- Matthieu Baerts (2): mptcp: netlink: respect v4/v6-only sockets selftests: mptcp: userspace: validate v4-v6 subflows mix Paolo Abeni (1): mptcp: explicitly specify sock family at subflow creation time net/mptcp/pm.c | 25 ++++++++++++ net/mptcp/pm_userspace.c | 7 ++++ net/mptcp/protocol.c | 2 +- net/mptcp/protocol.h | 6 ++- net/mptcp/subflow.c | 9 +++-- tools/testing/selftests/net/mptcp/userspace_pm.sh | 47 +++++++++++++++++++++++ 6 files changed, 90 insertions(+), 6 deletions(-) --- base-commit: be53771c87f4e322a9835d3faa9cd73a4ecdec5b change-id: 20230112-upstream-net-20230112-netlink-v4-v6-b6b958039ee0 Best regards,