From patchwork Mon Feb 27 17:29:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 5899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2550826wrd; Mon, 27 Feb 2023 09:36:41 -0800 (PST) X-Google-Smtp-Source: AK7set/YbCrkdreCdcbRmw1cpJA5EfgfApW1OkTCGvJ410F9k0MVzwo76vfJ+OG5CnCI41BlZuzs X-Received: by 2002:a17:907:1c8c:b0:8e6:d08d:f5e8 with SMTP id nb12-20020a1709071c8c00b008e6d08df5e8mr26901552ejc.11.1677519400938; Mon, 27 Feb 2023 09:36:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677519400; cv=none; d=google.com; s=arc-20160816; b=tCrCvZ6DHfar46Wsn+M/QZpjl59cp6yRTxcVyL6w73vyDzn6xqxoAlX2bIIXWFdnek J8xW5hHt/HlifgZdLxmMobd4k3p7haRdQ1qexHFoxpk3mNKrApjblAbQj7o11m33S9ZG YMnJY7776DocS6fj/Cb6cReL79EqpYEe5rW/M5sYKA/eLN/LnJN1BzJMnm5lHNhBoMrG OIyzdRYgw/TjS8GcLlfQO00ht++nLIekcdrRy2XkFacda1K1JSdX4rLb6wYwzCqG4xan IhES2w8pGrAGSdQrEAEjGPdSWCpRuUckSvJYIvHu6tF8nZLOcsY+Bm+kPWtiiJqqxYVw FQ9g== 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=lMbMZcHUrrYgIjxQ3ommUoIZSbNpJdzQ8dTTJi4pkT0=; b=rDdjevG5AbzZKrd4Yj7IMi652+puaK6/68y60arD2OFFMjx1aJs8aSr9Q0eAKpmTDE G0Txb+6npde49mePwfrwFXAzJSWdIPjNx3EJ4L7q/Zc18vxf2gxpvDNkoLN0pcZTHXlD j6rj2sOV0p8sXhCOo5WtnLQGSmOEjrofZYuFIUSm6VqvwJ0VhWK/+PmuVXGukrpEOOU6 jJ4bt3owKjzSRnsHu3AAdBaWpOWRw49XyylQp5V+ZOizKRatNScUFO/nOUebJ6355vxn aSTeq2ivHf006JHhbGWV9QgIOpROyoNe+UDqKx2yD7bfj/u0vAsn9d4fQiUDHacB6v2i dAXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=jiiraGod; 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 gy12-20020a170906f24c00b008cf02438e0dsi7804895ejb.683.2023.02.27.09.36.18; Mon, 27 Feb 2023 09:36:40 -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=jiiraGod; 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 S229951AbjB0RaB (ORCPT + 99 others); Mon, 27 Feb 2023 12:30:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbjB0R37 (ORCPT ); Mon, 27 Feb 2023 12:29:59 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B281CF4C for ; Mon, 27 Feb 2023 09:29:56 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id q16so7075582wrw.2 for ; Mon, 27 Feb 2023 09:29:56 -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=lMbMZcHUrrYgIjxQ3ommUoIZSbNpJdzQ8dTTJi4pkT0=; b=jiiraGod+mfy/gSH21dqocUcdQ9K+XriznRtZj/Yp8iFBMLEpvs8qu8NIFdlXRXi9/ Xxd5PTKNIq9x3PlxEHqn63yxlrWm2YgviOTkbH2LmUOhFlfXdqBIH3ad7M0uViIjlTwJ 1uvKoaLYTjb/h53j5WJ1Wtr+r6zI+Az/OC1HfCjns7iBMNoxWr0JX/0+5uaXMXVyXX6O 1smTgZpggDCkCVm1/rJb5IwdnevsqL16jJcQxn5PCe3bSUONJM3h/VEmFisrrlWx8E3N Qrn5siz951ot0Ku+aCJmlPSPc4PBbC+ImtqD6G5BF0yOsBLNc328C/wC1M6nRYbkhZ7K wVZA== 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=lMbMZcHUrrYgIjxQ3ommUoIZSbNpJdzQ8dTTJi4pkT0=; b=Qu7fGgMz0pB8KaiA06To1YDwj8jqOWoOVkbo3qbKSd4/+z36zUWLaSljnciKOxmQKw iq5elUfgNhDawO0omR3pVl9sfJC6vaD1747xhyTVfubcnTlPBZNpDcClzs61bqE9JXME wY5LUYIS0bQD0RACU6OxYWsTderkq6Bgkc3VB789nNNvhaeWhtqnf5YuFItsaJWPxHut mPrPH+Ghg67DJvw5YzubuSBRCtGcISymt9LcEDYId9gl+lx39XvtBqmZgwgP86qenv3d Upz6P5q2uYbh7chiPEt81lSKA+w2wVTBp61eiLUcN39X4QRXNAeVUF7K8L/V+dP+4uZz gkFA== X-Gm-Message-State: AO0yUKUtdy8K2pTeJa/60xiTBQ6LqjTJ0qqGp6FcsSds3z6yeevI8fip IPaOJBCo2HF354lxX0v9uYhHXg== X-Received: by 2002:adf:fb8f:0:b0:2c5:6182:5f6b with SMTP id a15-20020adffb8f000000b002c561825f6bmr21630310wrr.18.1677518995376; Mon, 27 Feb 2023 09:29:55 -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 t1-20020a5d6a41000000b002c70a68111asm7763689wrw.83.2023.02.27.09.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 09:29:54 -0800 (PST) From: Matthieu Baerts Subject: [PATCH net 0/7] mptcp: fixes for 6.3 Date: Mon, 27 Feb 2023 18:29:23 +0100 Message-Id: <20230227-upstream-net-20230227-mptcp-fixes-v1-0-070e30ae4a8e@tessares.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHPo/GMC/z2MQQ7CMAwEv1L5jEVxhYr4CuLgpA71ISGK2wqp6 t9JOHCc3Z3dwaSoGNy7HYpsavpOFS6nDvzM6SWoU2WgnoaeaMQ121KEIyZZ8J/GvPiMQT9i6P1 4CwNTuDqC+uPYBF3h5Of2VL1JtqafI2tqi1zkp9b60Xp4HscXOIU5L5oAAAA= To: mptcp@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Menglong Dong , Mengen Sun , Shuah Khan , Florian Westphal , Jiang Biao Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org, Christoph Paasch , Geliang Tang X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2123; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=Bt1cusZoNgmgHT2JSLsa0gsxCy4BA3wwvkYRFU/ply4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBj/OiR/VSGNNE1zEgw63i7JHZ0WBzAWg/eVk+C2 euxS097MPOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCY/zokQAKCRD2t4JPQmmg c0ZXD/9ci9xPaOkpjJruTQZp3P0oJR9Q2ZHrODLyjX83LIqXB5okUaWTyQ77XBNtghYxrcImBkC K0oQ6kY0eLlKlC732AM5vKczlA/vUgYvCHAI7rU7YXHwJGN24gIBm0hWQSqmFb0cm+Ft9/tT+aE yj8koskniQKSIql95wXX5o0yD3XVkMknt44vf/rwZUX7SyEoKGhwzsm8lq1QfgVX8zSku+zczmw XM+KtHRw8jqk/K2MhXYJ9LRvmcmv+N68wqaY1e0tBKRhf6D/9zTmXDeN9sszFK8t7ygk/xLtJTm S0Ms5Kh6y7OaEZd2BsQRRUqQgEeX+U0yq716EP7URHIHA+QSX9OqrUml6BLa40Zk8bDaYj0mdMa gxPe9XkJ0MaJ3CUwLlNfL8giGfvX0kludEcGyi0r31WnpOyyRpR6QQSUTlcwTBORv3Z3KTR/elC Vb2/dKXV35cUcKYDN8Jj4Wb52tL3HJMmvke+QWgXETiqLucbVJoJYhCeQ5a8QtgH/528TgeRZMm keiyutzuEQvdNRWptr3T9Fm5C7kQzsTVKk+dutflMn8NWLnleznPWG7H8GRTWHKuryST6/EcMEr CuHvwDboc4tufiPleLrCz2JFH8nS56QEOYWlaJ8eoNo7nW6jzL3RP3Uvg9b+RiCa2mZIhomWmcP DHHINGid4/5xENA== 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?1759006583259952362?= X-GMAIL-MSGID: =?utf-8?q?1759006583259952362?= 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: present in Linus' tree but not in a tagged version yet. 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. Signed-off-by: Matthieu Baerts --- 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 (4): 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 net/mptcp/protocol.c | 44 +++----- net/mptcp/protocol.h | 4 +- net/mptcp/subflow.c | 122 +++++++--------------- tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 +- 4 files changed, 59 insertions(+), 113 deletions(-) --- base-commit: aaa3c08ee0653beaa649d4adfb27ad562641cfd8 change-id: 20230227-upstream-net-20230227-mptcp-fixes-cc78f3a2f5b2 Best regards,