From patchwork Thu Mar 9 14:49:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 6366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp343369wrd; Thu, 9 Mar 2023 07:10:49 -0800 (PST) X-Google-Smtp-Source: AK7set/SKbYHh0tFvVgT3e672Iwa/Majr7NItcs1xpl7GiiNoIjiA7ub0ed9k2kK+PJyOoY9L4wC X-Received: by 2002:a05:6e02:1c4d:b0:313:c32b:de26 with SMTP id d13-20020a056e021c4d00b00313c32bde26mr22625814ilg.9.1678374649032; Thu, 09 Mar 2023 07:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678374649; cv=none; d=google.com; s=arc-20160816; b=jqJUZB+8gdXn3T8s3yUvbvy1uhVSz9YP4mjezOgY9IkO/nVpwhlBbuMfMiLm3Ghss5 j3ss48bbwLKvq1RBNK59VwQDAMOL9nFwvLBdBnK6/Hvgqsip0ct6qCXrwd/Wu79iLauD iWP1veyP+kafXXxAkj/n0YPhwauBHGpCPma05lrPXM3W2pPY1cB0AJXWao75ec6A7hlY 1O3K+cK9gktFcpy6+EMm0d42iU5KmtZHLYi/woinDExahN0AYJWZDW0GSLPd/rcfxH+Z 83gLcMBiyvrxwmfgb8s8csiadxfYb36dF4BPh/tFZKVroqRcxyTGUPAcR73p7fj8sEy8 oRLw== 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=pd3Lkot3b9xUlf3dAcLlAT6oagcWYg/ttZtHlyeFJuA=; b=FbZEEnwi33gk0kv/n2Cl7+JVU4I3HT1vfrn85zs2qp7X590NH7LVF7x1twuI2MLf7T 4bvqZ4+JWH/IvJyyOWo8cFpIsipongA3bW8VvDtJB3yzKa1LFpVhdt7l2ZzjqZACFJ0p sFGVvUY4om7b4nsntJ+DW8/WuczfIONpEUs0QuhzLsW7niQBe7PRhXcnk67kQSjpyT1X PsJa9zCle5S5+WcrWAiIw+6ZlhY7WPg5xiWrJZXWhLdxQgc2rpw48Uwrquc1pOPLcKon I0uxgBMLQjgObxZ+D+nqtt7SCwplz1SU2Rx9cPlS7nlf92SDkOuC+MphQLtpP6XoaT2y ri8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=XguBoN4c; 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=REJECT sp=REJECT 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 u20-20020a02aa94000000b003b05af2c108si17797705jai.86.2023.03.09.07.10.35; Thu, 09 Mar 2023 07:10:49 -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=XguBoN4c; 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=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232143AbjCIOwp (ORCPT + 99 others); Thu, 9 Mar 2023 09:52:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232005AbjCIOwF (ORCPT ); Thu, 9 Mar 2023 09:52:05 -0500 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 831BC65C5B for ; Thu, 9 Mar 2023 06:50:21 -0800 (PST) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-17638494edbso2507476fac.10 for ; Thu, 09 Mar 2023 06:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1678373420; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=pd3Lkot3b9xUlf3dAcLlAT6oagcWYg/ttZtHlyeFJuA=; b=XguBoN4c3w1EVz2TKdJNXfaRnsWcFj+3h7Sri2mnrra4n1lMANrVVw5hQhqNyHynK1 k2/wgRUCHAqSMlsI/fbWbg1wtroyhlH9ClfpzwRtU3lJ+RJkaoyRIBZ8hADXb40oWnP0 Fuevm9l6l6zuukDFqZRNy5M0st17lcjINX8PNXE71QpU7+NJH13kAEjGoS2yF9DAaeVy hMhujEqq56L6Etm+CY7U4bGM3meZ3VZQDibsQR7XyCG0zcJCX/l/7SyQCakia0zqAJv8 Il9lvmy9IwnQ+F79LBx9YUbYxGIWwjXs9RlckvlAWnfDEI9CaVayn0V1k6Bdho9koQl2 svmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678373420; 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=pd3Lkot3b9xUlf3dAcLlAT6oagcWYg/ttZtHlyeFJuA=; b=Nwj7Vm9MLJvTZc5sgXdf4xbPyzofrsx9rw983+EpJwO3r1l475ezmn7e9lNT1VksbY 1kefBQK/2NwdiLnkL3wxcgfZIMuSbYttCCAhNgWzxJl+C7sFFMVXM/yWSclmXFQoKhbO iOsth3s5xonSFfRSY1gfm8t/o2zIVcjXlio3sTjfmnudrQTJ+jcxvoDev37PX/FXidXT LqC//MsYcNPtOmoyLw9Ew8zAeNxyMQKP9JbFMF1aKdFWoDt0pxP7cjI2UXlIVKzzT3P+ 2d92ZOnzAxC4ysGoA8DxkmF+VbEOzM9kz9ooT12r/5ThmimNX7EF1YLRBet/tq9eqzTU Nnqg== X-Gm-Message-State: AO0yUKWayXfSCgWqpJCPO0p0+KGlbHrQB3+5+nkm4jhWB7YVVrDZEJpJ Q/mftcbNsxue7I3+T5pyDvicxQ== X-Received: by 2002:a05:687c:19c:b0:172:4240:f224 with SMTP id yo28-20020a05687c019c00b001724240f224mr572178oab.18.1678373418243; Thu, 09 Mar 2023 06:50:18 -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 ax39-20020a05687c022700b0016b0369f08fsm7351116oac.15.2023.03.09.06.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 06:50:17 -0800 (PST) From: Matthieu Baerts Subject: [PATCH net v2 0/8] mptcp: fixes for 6.3 Date: Thu, 09 Mar 2023 15:49:56 +0100 Message-Id: <20230227-upstream-net-20230227-mptcp-fixes-v2-0-47c2e95eada9@tessares.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIABTyCWQC/5WOwQ7CIBBEf6Xh7Cqlmjae/A/jYUu3lkMpYZFoG v5d4ODd48zbmZ1dMHlDLK7NLjxFw2azWahDI/SC9klgpqyFkqqTSvXwchw84QqWAvzc1QXtYDZ vYtC6H+YO1XwZlcg9IzLB6NHqpTTl3ESxxE8rGlsunKcazfheuHhkczEcNv+py2Jb0R8jYgsSZ C+pk0hnHOgWiBk98bE+SCl9AbE4x8X8AAAA To: mptcp@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mat Martineau , Jiang Biao , Menglong Dong , Mengen Sun , Shuah Khan , Florian Westphal Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Matthieu Baerts , Christoph Paasch , stable@vger.kernel.org, Geliang Tang X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2908; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=eJfqegXakEakPpXnWf87SdzqEbYoKrFI19FY/itAd28=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkCfIhXcnZ5ZKt/o/UUyrdQcd85f2M6UnxDt9d2 ec5EeELVvuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZAnyIQAKCRD2t4JPQmmg c72nEACeRBMVD2sAi3192xUCYkclJkbIcz0MIm3veGwJgdYvodHnBs9LAn5x29IGjvnvY8ZRJz3 dlmDwMDMwvLVvt4LsS3sU/ZC5Il1EJIx/w4QZFaOO3f5DCKviEX5b4yjtcYFsYUSpkf/1B9fKvV Two7LCfQMGlOK0QjBgFDCtPf+GgPe8jkoc83mP9a69Ab2E2eKkn6gzOUfUGFjYmeT7/BKdocUfn yiVMGR5X3YBbnBNIMoT0peQ+TmHbi/ZfonqC4XtpQTMHIHMZ+ITUuW6k6T420dTDOKysHhpfZgv 8mTpk0+UqIy2zeqtSEd/8c46i7nPASDd9Uhapk3avT7LMkndSn4o32fpvh5oOTRAA3YI+1P7szO 5oLUctP7XCBxMAzVgtLM7uAp35NQOx9IFYPg3Kk2LrqG8oypW3NWSyfMLxLAdB2B75yBluZ373A ncGvPs4V1Yg9EtbW3r7vHWeyfvT6jZO9Srvl3rABBvVm+7xqjg0UOOm3NhZAcwf7pAgDy/MtW5L ej9BiWeZY/FdRapKR80iFVZCJoJUZeWmJL51OvhvQa6r0lGPc2ow+ueuxU53lC1GrDOPB9C/W81 QAd3AyUY13rAfSeQMare7cUXGn4rnWdAJlrNuTLhqB5yQyMHDM0rcO0gzadzXPu8+dYLyp8kKM+ cEKi5S4c+KluQJA== 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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759903376050065526?= X-GMAIL-MSGID: =?utf-8?q?1759903376050065526?= Patch 1 fixes a possible deadlock in subflow_error_report() reported by lockdep. The report was in fact a false positive but the modification makes sense and silences lockdep to allow syzkaller to find real issues. The regression has been introduced in v5.12. Patch 2 is a refactoring needed to be able to fix the two next issues. It improves the situation and can be backported up to v6.0. Patches 3 and 4 fix UaF reported by KASAN. It fixes issues potentially visible since v5.7 and v5.19 but only reproducible until recently (v6.0). These two patches depend on patch 2/7. Patch 5 fixes the order of the printed values: expected vs seen values. The regression has been introduced recently: v6.3-rc1. Patch 6 adds missing ro_after_init flags. A previous patch added them for other functions but these two have been missed. This previous patch has been backported to stable versions (up to v5.12) so probably better to do the same here. Patch 7 fixes tcp_set_state() being called twice in a row since v5.10. Patch 8 fixes another lockdep false positive issue but this time in MPTCP PM code. Same here, some modifications in the code has been made to silence this issue and help finding real ones later. This issue can be seen since v6.2. Note that checkpatch.pl is now complaining about the "Closes" tag but discussions are ongoing to add an exception: https://lore.kernel.org/all/a27480c5-c3d4-b302-285e-323df0349b8f@tessares.net/ Signed-off-by: Matthieu Baerts --- Changes in v2: - Patches 3 and 4 have been modified to fix the issue reported on netdev - Patch 8 has been added - Rebased - Link to v1: https://lore.kernel.org/r/20230227-upstream-net-20230227-mptcp-fixes-v1-0-070e30ae4a8e@tessares.net --- Geliang Tang (1): mptcp: add ro_after_init for tcp{,v6}_prot_override Matthieu Baerts (2): selftests: mptcp: userspace pm: fix printed values mptcp: avoid setting TCP_CLOSE state twice Paolo Abeni (5): mptcp: fix possible deadlock in subflow_error_report mptcp: refactor passive socket initialization mptcp: use the workqueue to destroy unaccepted sockets mptcp: fix UaF in listener shutdown mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket() net/mptcp/pm_netlink.c | 16 +++ net/mptcp/protocol.c | 64 +++++------ net/mptcp/protocol.h | 6 +- net/mptcp/subflow.c | 128 +++++++--------------- tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 +- 5 files changed, 95 insertions(+), 121 deletions(-) --- base-commit: 67eeadf2f95326f6344adacb70c880bf2ccff57b change-id: 20230227-upstream-net-20230227-mptcp-fixes-cc78f3a2f5b2 Best regards,