From patchwork Tue Sep 6 20:55:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 12968175 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1623EECAAA1 for ; Tue, 6 Sep 2022 20:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiIFU4m (ORCPT ); Tue, 6 Sep 2022 16:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbiIFU4i (ORCPT ); Tue, 6 Sep 2022 16:56:38 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5CDA92F69 for ; Tue, 6 Sep 2022 13:56:35 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id az27so17248311wrb.6 for ; Tue, 06 Sep 2022 13:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Bzx+cD7xk0ffAd/x0upRKnsqyh6CtsmmDF1m6ENUxaM=; b=IpNFDVABVsbGTVL4O05HzyVsipCk56tBqMmYN3RVWBY3xdRsLjzWYVOwhOfY9EnSZT 2u6617ukv5IOnBEqJWzwq3qWtdkSd/UefYW5LT7pf8Pb9FnttIfbc7hN+l2hJTFbTxsi MzeVctChyR3S7W4U8ap5yYKknGIlYYCBVwPpXmEU6Dxg76CZYZCe3rzUiimvmpVdRAt5 F0OOfxq11cQbdnydVLNpF/LHbdKu0RFzlfyNoZgxyJEnGen843AmYW70oKP3raLZQuWX x4Tuog8sPIgh2DtJpdk/YIwCNRnD32OGNUierc4TXMqmmnTAJ8xT4/Zmrwlh80pH71j8 46nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Bzx+cD7xk0ffAd/x0upRKnsqyh6CtsmmDF1m6ENUxaM=; b=a3TXwRqts2b3YeE86c5vjO4BkK21CpZTnfqc92d+bZ/EjNHcG06ymCePqowSIfwi0Z ObSeBrO9nY6nNPSjgTu9Am0MrBMMWNo55GbOylfvmvAJ/SbUrqMuqNBnt+nKjTAFqBH+ 106d7b1vCN8eIpEq0JAsLnxftJAIdQht6TBg2yqwklhAZcIJbCi2EV9sn+jWajG3ocqd LtS9CnLXOpsNNwNXsAY2yubOOJ77QFaMsE7dQiU0AVDSfIQ9NCiKG/oGrpNtO4hKI5zO +snCJuoRs+ZmqIo7FiGCE2sK01UjvvinouZG37T4g1MBx188wNeeUp+HS2bgt6+l10Jv Te0w== X-Gm-Message-State: ACgBeo3z/4F/aEX/MdpQlbuDhrtL38gklNlTLqQAIrpymlydd4P/tpir 6hreM9zZgBy07eQvwLsdXoRSiw== X-Google-Smtp-Source: AA6agR4csVvGLH1IsqcOSvdAYqNYq9G3fSXUikGRnM1gpJqqiCWMN5qC13x9mChWks06jED8eDrCYA== X-Received: by 2002:adf:f4cc:0:b0:228:ab76:fa13 with SMTP id h12-20020adff4cc000000b00228ab76fa13mr176515wrp.110.1662497794138; Tue, 06 Sep 2022 13:56:34 -0700 (PDT) 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 n24-20020a1c7218000000b003a317ee3036sm15735887wmc.2.2022.09.06.13.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 13:56:32 -0700 (PDT) From: Matthieu Baerts To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/5] mptcp: add mptcp_for_each_subflow_safe helper Date: Tue, 6 Sep 2022 22:55:39 +0200 Message-Id: <20220906205545.1623193-2-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906205545.1623193-1-matthieu.baerts@tessares.net> References: <20220906205545.1623193-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2778; i=matthieu.baerts@tessares.net; h=from:subject; bh=FzIWMWFonpoxcP1L4R9vUfT0ariFVPfRrgBWzxMq3A4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjF7O5M9GDs9tE3T0u9pD8nPu9iCoCtaH4vovheHBF 6ifLOcqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCYxezuQAKCRD2t4JPQmmgc0PGEA Cuipi8+Slnngy8VjGZnlG7dgxNZ+n1VE6WdfroG8gP/pqr5CVioCmHKwKK2n3nJPcAnE9QYxjRYPoT 0a9K/XAJCqFm59av5uXcrYab0mgVvl6SgSXB+tDXGoQb9mRYhAdHrzdd/n+O/jqfMZgHYANCtKr2Mp UMf751iAQvZAFC1cpsNrb1i9ZsQKatBdAaV6plI+lY+j71zsCURB+T9gk6rRK8znxndk27+49n9tfR 9j8cbZmDXH0StxbDzyH63j3drLOD0+g3z9gCUJyicE4bXLI24QzpRsvOZ+yGThXVodkVLkyqCd+fTT WADc8jbnAr/C9MlGDB1u951ZsZK7A9PkU2br47vXIAif5DJYMHlug+EpVFubBJGwQqOQNbxyD4kdvF EZhE5ehr5flBZztz0+w2tGI/oDoQ+PAd5XZo3Gi04GkZprbrxEPNj/mLRsa0/M2qRBEG+6ZO72bLra FrK6KLtLgoHKR2KqJWlw2j8M8xOIFNtRca4XNYjtYtTLt8LSj4AM0+gdsljC3fQAiNOMi2HB2MIOAS OukMMjwwYjO9YUW6hZxnP03n/sRsrTSUTQa41PCh5TztOxh+7wZ2ArR+XKUubBc3gsOUR2IIHXN8be nAqEEWQALEwYLirGj7hvv9q/PKSVGnC/Rk9D6uGmRhNJrZQUl58e+RpeKU+w== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Similar to mptcp_for_each_subflow(): this is clearer now that the _safe version is used in multiple places. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts --- net/mptcp/pm_netlink.c | 2 +- net/mptcp/protocol.c | 6 +++--- net/mptcp/protocol.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index a3e4ee7af0ee..5e142c0c597a 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -796,7 +796,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk, u8 rm_id = rm_list->ids[i]; bool removed = false; - list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) { + mptcp_for_each_subflow_safe(msk, subflow, tmp) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); int how = RCV_SHUTDOWN | SEND_SHUTDOWN; u8 id = subflow->local_id; diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index d398f3810662..fc782d693eaf 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2357,7 +2357,7 @@ static void __mptcp_close_subflow(struct mptcp_sock *msk) might_sleep(); - list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) { + mptcp_for_each_subflow_safe(msk, subflow, tmp) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); if (inet_sk_state_load(ssk) != TCP_CLOSE) @@ -2400,7 +2400,7 @@ static void mptcp_check_fastclose(struct mptcp_sock *msk) mptcp_token_destroy(msk); - list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) { + mptcp_for_each_subflow_safe(msk, subflow, tmp) { struct sock *tcp_sk = mptcp_subflow_tcp_sock(subflow); bool slow; @@ -3047,7 +3047,7 @@ void mptcp_destroy_common(struct mptcp_sock *msk, unsigned int flags) __mptcp_clear_xmit(sk); /* join list will be eventually flushed (with rst) at sock lock release time */ - list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) + mptcp_for_each_subflow_safe(msk, subflow, tmp) __mptcp_close_ssk(sk, mptcp_subflow_tcp_sock(subflow), subflow, flags); /* move to sk_receive_queue, sk_stream_kill_queues will purge it */ diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 132d50833df1..c1b12318535d 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -314,6 +314,8 @@ struct mptcp_sock { #define mptcp_for_each_subflow(__msk, __subflow) \ list_for_each_entry(__subflow, &((__msk)->conn_list), node) +#define mptcp_for_each_subflow_safe(__msk, __subflow, __tmp) \ + list_for_each_entry_safe(__subflow, __tmp, &((__msk)->conn_list), node) static inline void msk_owned_by_me(const struct mptcp_sock *msk) { From patchwork Tue Sep 6 20:55:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 12968176 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF1ECC6FA86 for ; Tue, 6 Sep 2022 20:56:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231363AbiIFU4p (ORCPT ); Tue, 6 Sep 2022 16:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbiIFU4k (ORCPT ); Tue, 6 Sep 2022 16:56:40 -0400 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 15E3590831 for ; Tue, 6 Sep 2022 13:56:39 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id d2so160771wrn.1 for ; Tue, 06 Sep 2022 13:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=uWCP10+KdM1mM0Umgl1CW1tpnCShY3VRv2KhK/s50Pc=; b=hA0aVCFd6I916GvNfIBOiPT70SlSP/gKustpzyybixkWURvyjrKTmq6eVMPCH14/fc H0bbFN1BzpqTyiFaiU6KRqcAEDSiUuBDEUIq6q4hRuYD8SgrlH5pfhn5TIUOO3h3u0kQ 0N8vEq5S3qpKVzCwXaBJpLgjsPineUBdGmDRjTOmtS/D9rW0VTf5JR/6GeN0UyA9XT+R SqNG70Nvxe9rSZw+BFmszsL/1XhVh5OvkmbGBY/sBk0okhFoVxY1fy0RYqdsdl3lTVot JRpRfM/CdLZtyoFcJUKWx2Rgqch1n5Z60hSkS3YN8l3Bh93KxIpuDGnzi/TF/VL5uUj/ mmQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=uWCP10+KdM1mM0Umgl1CW1tpnCShY3VRv2KhK/s50Pc=; b=YtNtV3ipBuosiy9srTJ32o6x+RS4BiEKZnOZLXmECfQMC5VcYqGfKXbEqMBDvxQc1a NENIXfNdX4Q9sS8A81hRuEd7yqFMotie8ooa1G5fVJ2P12c4h5i7NoiHfs6KGetKmq79 Yo/kFl1GPwQCrpw4CdODfVxeMIXpu2b78OBSBJil9PhO0gTKPV6OHYCvpe936Ri2c76x /F5HYxPhFnuwZ4gUAkkdYk2xmAAURJoj/BXU/NcVxJ+TmKgZUuCCiSUyI+uaJVWZXRHL LsvfUlj/Jo5atmB6WAU8raLvpm3EVQq0bh8QiYQzxw3fazxmwUjqw178yMWVVHuL/TFt ZdYA== X-Gm-Message-State: ACgBeo3NCTCaNo01OIOtGdTTATN4LHRayfyj34ge8HdtvCfE1UaN0KK+ uEhxkT/+VJe5L+l8uQyqzrM1hw== X-Google-Smtp-Source: AA6agR6Lfe6OBXP3Eps5pfPITiEd+qNhxZ6EK0SqcI3KEQv6VlAWlrpqoXbHVugNSGgqRY4080WywQ== X-Received: by 2002:a5d:5312:0:b0:228:cc9e:b70f with SMTP id e18-20020a5d5312000000b00228cc9eb70fmr163892wrv.11.1662497797565; Tue, 06 Sep 2022 13:56:37 -0700 (PDT) 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 n24-20020a1c7218000000b003a317ee3036sm15735887wmc.2.2022.09.06.13.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 13:56:35 -0700 (PDT) From: Matthieu Baerts To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/5] selftests: mptcp: move prefix tests of addr_nr_ns2 together Date: Tue, 6 Sep 2022 22:55:40 +0200 Message-Id: <20220906205545.1623193-3-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906205545.1623193-1-matthieu.baerts@tessares.net> References: <20220906205545.1623193-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1553; i=matthieu.baerts@tessares.net; h=from:subject; bh=yUhUy0ygZaIKGg/DCAYpwAsfqZXiS1Iioh7QiRlCzI8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjF7O5XYAZvCDzDsZTKMXAqDaby25FIJ6aR+JYa7Jc Ihvfp4WJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCYxezuQAKCRD2t4JPQmmgc4fYD/ 9tVps4gMGcGcuZq6GiLT1IUNS3czrpayKljF1dvYaofmEc8O45T+Ovey42AGosrXSta3l/hghtQue/ 3c56h0DdEJAX9wtcAqbiZF9vuLSst2af0aKAZO/0nxMq9y6D6eNTl0vbT3VG04Pm2W45+wo0S2dr3+ B2O6qpteWsu0lca2BF2SrVVUMXGcLvvaVEWxxnTDFbjnuNXqZCoBVfcQeeycR80BlFW1b7n4Jba4FN 35qaba07wM1L1zAKRPitFr/6/FNyF/4AoK7vvFsGIMwOl9MnKrVtnwvX2WyrWgD7eu7bjyXmsGwVbJ zWE3keai1HrMpJOBSnJe6MzAZOO+R8r9Tz+93kdPlJkNnumGcKfdnpUY358rsWn9UBeTZ7I2SWBLXS +7kmlA0NNmzLjWSaB1bGEay88It/5LO0dPAsXApReACPNjgPs7RnhfLWzAz/9LlrgUlszBFhGpFr8X 8vhePUDTbYfBhB41MSB41oBumCpG0WezKZMcOx2zSA2TKyDChwEfkNj3UbKTVpu8DfKtug9/3hyqho bYHnByPY+gbawDib80omMF+8CineZtAsSE7IBQ2ZKjz1H6EUTkaG4Z03gnD3qwrQSxK9j2S0FlCD2m wSh/CesmSQ1xh9Pq2xhmAwGtH04Cp+VUJGpoJZTc1K3iYQ7B74eRJcWGRuBA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Geliang Tang Move the fullmesh prefix test of addr_nr_ns2 together with its other prefix tests. Signed-off-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index ff83ef426df5..2957fe414639 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -706,6 +706,7 @@ do_transfer() addr_nr_ns1=${addr_nr_ns1:10} fi + local flags="subflow" if [[ "${addr_nr_ns2}" = "fastclose_"* ]]; then # disconnect extra_args="$extra_args -I ${addr_nr_ns2:10}" @@ -713,6 +714,9 @@ do_transfer() elif [[ "${addr_nr_ns2}" = "userspace_"* ]]; then userspace_pm=1 addr_nr_ns2=${addr_nr_ns2:10} + elif [[ "${addr_nr_ns2}" = "fullmesh_"* ]]; then + flags="${flags},fullmesh" + addr_nr_ns2=${addr_nr_ns2:9} fi if [ $userspace_pm -eq 1 ]; then @@ -832,12 +836,6 @@ do_transfer() fi fi - local flags="subflow" - if [[ "${addr_nr_ns2}" = "fullmesh_"* ]]; then - flags="${flags},fullmesh" - addr_nr_ns2=${addr_nr_ns2:9} - fi - # if newly added endpoints must be deleted, give the background msk # some time to created them [ $addr_nr_ns1 -gt 0 ] && [ $addr_nr_ns2 -lt 0 ] && sleep 1 From patchwork Tue Sep 6 20:55:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 12968179 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52D01C54EE9 for ; Tue, 6 Sep 2022 20:57:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbiIFU5D (ORCPT ); Tue, 6 Sep 2022 16:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbiIFU4s (ORCPT ); Tue, 6 Sep 2022 16:56:48 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789B19D12F for ; Tue, 6 Sep 2022 13:56:46 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id t7so12223834wrm.10 for ; Tue, 06 Sep 2022 13:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Yl6+l6Tz5nZm4wkgL71pM9KuNzn5abHVXtmHe0YrRrQ=; b=Wsk6eP+iYpej7PR3Z12QkHrVvOqdtkrqUS6r1jIHv/1OI454NV/w11aRkiYkHpjUpv 5cXZNQzHi8s5nAf2hTWOCxXkhLon7O514CL7Ea0+H01Z75AFt1mP7REKi9jQ/DCZ2ujn EufF9s7tb32bAqsfjRTmrtkiiZA9WQUKrK1PVmZ9MdkfAlsl6R2Hwr+3WR/nVCgGwKbI cUZTd7NNJe3vcog5Z3kPZuVr7wR+ImCV4B+ffjm7k0H1MLR4GCGezLeHzRdZ2pAIXxyG fnaBElVLxDMswzMVLxg6jlDtBR5d7RtM3LolxuFmP1dSpYzCPxb6Euwjt20o1ZhdPyyt w2tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Yl6+l6Tz5nZm4wkgL71pM9KuNzn5abHVXtmHe0YrRrQ=; b=edh4zCbYq6MLpHciRj+oxwtUP6JkmP2KUygpi7I14pqxTYaDYA0PIgEyiIL5WFvp+9 hrEAGwDyMLuMiS6c+44jDIxBninPWtwYH0HEiZkP4LN9L5iDHd7Z0hPK4nGHpWXs/NOO k0LL4+yJ88tLlNByQzeYpaTghH9oZCeMeyKK2YElBd5e+HXn2yVQNn8xkFdNwc+VpWXm 2MpTS5L6dT95ZyaYicR7bzfNibGvQdD/Mw2W7Ok20pJKm2xbHI+a7JGt9Qb1tJDkF/41 uZ4mQbpzWSiwifh7UcyHjmHLXAGYEDZKFQFRp0ZC8dAwcJ2c6tgA/bM1BuA2NkRluhjw 0rOg== X-Gm-Message-State: ACgBeo0RajC7KXTbJ3m9/6A0Umai9tIsn+Jk6AZ/A/m1dcXrptkEPTA3 A9qjoT2h5QDplO55C5ZqsWyvLA== X-Google-Smtp-Source: AA6agR7LTLX3wgoHBFaV7ErHYXMPV9YX5SW8wvdr1829P4zN8rNW2KOMHvcuTfaq2SE8KDy56sT/9g== X-Received: by 2002:adf:e508:0:b0:228:62fd:932b with SMTP id j8-20020adfe508000000b0022862fd932bmr172063wrm.410.1662497804186; Tue, 06 Sep 2022 13:56:44 -0700 (PDT) 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 n24-20020a1c7218000000b003a317ee3036sm15735887wmc.2.2022.09.06.13.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 13:56:38 -0700 (PDT) From: Matthieu Baerts To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/5] mptcp: add do_check_data_fin to replace copied Date: Tue, 6 Sep 2022 22:55:41 +0200 Message-Id: <20220906205545.1623193-4-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906205545.1623193-1-matthieu.baerts@tessares.net> References: <20220906205545.1623193-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1570; i=matthieu.baerts@tessares.net; h=from:subject; bh=+g38Y+mWkUnFq5R25N4kk6AO7g0tjZvhLM1UE5s88uo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjF7O526/+GZWT9lBKJnLQ/VE3wnDNU3rQklnMFTjr Pa+rFmCJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCYxezuQAKCRD2t4JPQmmgc7aJD/ 493eZXF51bN99DL4y0aof8awj3f9U0k03ET0iUc+u6kQKiM+7RqelfEaugu4JnTcUIRiHf3IqCPGyT crKMnxwJpe37U0CfKX3AqRpdnCDHcxuj6T1Dj3Z6/n/pUwK3n5vQ2GAiIDNhs+5tLyBfPiEFXxlDX/ Sr+wQxmD/lfS8LI4LhW6pdXp8ZhZ7x5Dq8kA3hFzzAbkKN3bTPIs2lh3JfZmmB8czOt3rXx1LOOnBi woF4vcdJPOlI74D5Vi8yLeTehH9i0nrneyvvgIiCkUi0rLc+mslEmf2re/mrrtV8duIrObcg16hr8O c4WEUSTCNO0E0Icvm7B+EjDgQB2oGWjz78c7VgondZnqt4EpG/y6+fA4Q+b33gfL/9Zon/ANJU8XTU 1gd0Ohrgl5GFlE8MJ9UOyfB8XcaMdLoWmgWZu8haUmYpmxHHH/Qv7QrXjvcHYhyE6SLmQxBxsiy5T1 P/9bh6CRk6AA/W2obIm7JyzqB7WLdL/Czq3B/7crOhenilNM0v9VWfZWhOB5dbCH9Md3wLg34uBOlm LEYAubzcel7PUx60+yXNiU1pUZI0LkpPja4/5vwxfbOTuf8V0sel0L19jlkCSmc/GArmsUyXOfCpA8 K4pULk5mS9c/IRGmonP8qGTiyM2o5Zn3KshQQPEbphLfGQ1NDUbV9qTfdh4g== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Geliang Tang This patch adds a new bool variable 'do_check_data_fin' to replace the original int variable 'copied' in __mptcp_push_pending(), check it to determine whether to call __mptcp_check_send_data_fin(). Suggested-by: Mat Martineau Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts --- net/mptcp/protocol.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index fc782d693eaf..47931f6cf387 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1538,8 +1538,9 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags) struct mptcp_sendmsg_info info = { .flags = flags, }; + bool do_check_data_fin = false; struct mptcp_data_frag *dfrag; - int len, copied = 0; + int len; while ((dfrag = mptcp_send_head(sk))) { info.sent = dfrag->already_sent; @@ -1574,8 +1575,8 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags) goto out; } + do_check_data_fin = true; info.sent += ret; - copied += ret; len -= ret; mptcp_update_post_push(msk, dfrag, ret); @@ -1591,7 +1592,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags) /* ensure the rtx timer is running */ if (!mptcp_timer_pending(sk)) mptcp_reset_timer(sk); - if (copied) + if (do_check_data_fin) __mptcp_check_send_data_fin(sk); } From patchwork Tue Sep 6 20:55:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 12968180 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EA2DECAAA1 for ; Tue, 6 Sep 2022 20:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231393AbiIFU5T (ORCPT ); Tue, 6 Sep 2022 16:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiIFU5D (ORCPT ); Tue, 6 Sep 2022 16:57:03 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685E89350D for ; Tue, 6 Sep 2022 13:56:51 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id t7so12224167wrm.10 for ; Tue, 06 Sep 2022 13:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=PRqsWYZZH0s3GHQzsnOmHr+CxH/u15ul/CIYu9EYojs=; b=Vc9QaQE8ZfUf7ItbFMvQYVkMnX0f6ekQuvgXGvdF+seJxFAmGhZU4/sZzM4XxEMjKp Bw4VDC2zn+lHjwmmG+ga0OBUM9JHJjbAyQB7SRIgwBk4bFfGlXBe+AQwr0m2ooiMB1E6 g0cjqP/MqzHpMFPaGU3LVjHNXSUv8yvec13xLxDaL4Ovjt8BeNHEQDmJoonssHWgvx/X PB4zHTc8Scb4UxDj9J0GCFqWPzYUCnllyPh1nxFrqwEA0J5vIX6zHkudspLS2HrA8us/ fBZ7/Fno7MCwVrTyw0FSjccMQ+pSLZ9FfgMhHHnDfRVLwSZ6O4lKKGPPFkGRrUXvP93B MuyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=PRqsWYZZH0s3GHQzsnOmHr+CxH/u15ul/CIYu9EYojs=; b=XzN6lDHvvoyacVoZoGFXii1mXd4CutFn4lkhck0lV1Gp1hjpUO8kv8yH4IEKK9pkkA Q5kVHxVirmyl21GSow30zFGWq6Wvf+9PBsR6FtfkwtYgUf/MC+oTPF4u1ODdiO1zQOsV YjVrkDXGEfh7rKBOEbwGNqBgOkvzKKyp0kHsHYn2P/hJMq+y4aUUg1vKheG4JvBcoYtc C9KSV5sDhxHah7xiKdwu1jc1vpJS61W778x+GSWEdRsvE2E1v2uvm29zXjrx1/Usuh2k a4Xf2wj3ii6soFtjGXWtCvziSXOUkzr77oXJ2SfzVzZz6iaOhITDuFJHiGVIx0W5btMo zg6Q== X-Gm-Message-State: ACgBeo2Y6rMqzzJ8R3EFImO0tpuYWhUeenVQbhooi4J8oXk+kHmwKpMi Nhmw5+GTTWT/pQR7hBJRxTucEw== X-Google-Smtp-Source: AA6agR4pLdGZnGlAAJLaZh+M/E+8JiAP3AsAe0Vaci1KDqpNnMmIz2UttpItjJ4787L+hrDUmYj7Ig== X-Received: by 2002:adf:fb10:0:b0:228:9072:72e1 with SMTP id c16-20020adffb10000000b00228907272e1mr150723wrr.459.1662497810733; Tue, 06 Sep 2022 13:56:50 -0700 (PDT) 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 n24-20020a1c7218000000b003a317ee3036sm15735887wmc.2.2022.09.06.13.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 13:56:48 -0700 (PDT) From: Matthieu Baerts To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Thomas Haller , netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/5] mptcp: allow privileged operations from user namespaces Date: Tue, 6 Sep 2022 22:55:42 +0200 Message-Id: <20220906205545.1623193-5-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906205545.1623193-1-matthieu.baerts@tessares.net> References: <20220906205545.1623193-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2701; i=matthieu.baerts@tessares.net; h=from:subject; bh=3W6+TJOTAo68xHMXohFmObHMW6ruenZqCo5JEcs+SRE=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjF7O5PKfhLXp46IKTuhbxFJRXEMBLqpmcSLP2ZsMV idUjSFuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCYxezuQAKCRD2t4JPQmmgc+q3D/ 9tWNzntGdWV3cJtFlqYZ74eleNBcqTmo/FFcgACrAoZRGXRSMygfyVd7RcWw6pxTrlCqCLxwTQcn7I K7eq5EmHyB0CIYg8ZMiEFR8s3joxLddN3xLmRELV3Sob8pAKc0lRF/FEGkHz0pMGb3cIzaLTezAXas pJkx0ufs0rPG6T2oZ0oxWuohbp26Hrd2EjWTdDb/gpwnhJT9aLhD6OmhwpVEKAiN6OJ+faxMRyoooG 6lM1nifQobB0aO+3ZOLU/DmhZzVtx1d/Vn/i+EO5jBuk9TmLFHo5UVG0V61wGjKbXrqE1V88Lj8Z0k 5RzVJcD8ekYq2EKBJm5MhIifxIudDkDFV62mgYfSg9v8Qlv2fBEr1HnQUIEhyr7E2ryYt+0sIpSazD sJfzTXXqEEaPXRZTV5dvCsoO4uw0GfIiNaDybuqTWUApeKdb/xNGJOkZp+Ta9WDq2Wcnwl454wEME2 /q/x78qdSX3RPmKuDKcEr5VnZGwDd8qraCNbysp1c2N2+G0E7FvHBYqmaM4koDoR7d6SrLqmGxyXc3 nz0537mhcNanyF0YOZdZot8GxiW9gh1SWld8y53nL2Iv/kYulTzM5VHX9Oju3ObpCJfn+CczCzYWB9 5NYFg2Zzc4rhc5PtgXHmAhFQycp4WyOiFYiWsvG/HnIi77b/qUzRwuI+kEjA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Thomas Haller GENL_ADMIN_PERM checks that the user has CAP_NET_ADMIN in the initial namespace by calling netlink_capable(). Instead, use GENL_UNS_ADMIN_PERM which uses netlink_ns_capable(). This checks that the caller has CAP_NET_ADMIN in the current user namespace. See also commit 4a92602aa1cd ("openvswitch: allow management from inside user namespaces") which introduced this mechanism. See also commit 5617c6cd6f84 ("nl80211: Allow privileged operations from user namespaces") which introduced this for nl80211. Signed-off-by: Thomas Haller Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts --- net/mptcp/pm_netlink.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 5e142c0c597a..afc98adf2746 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -2218,17 +2218,17 @@ static const struct genl_small_ops mptcp_pm_ops[] = { { .cmd = MPTCP_PM_CMD_ADD_ADDR, .doit = mptcp_nl_cmd_add_addr, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_DEL_ADDR, .doit = mptcp_nl_cmd_del_addr, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_FLUSH_ADDRS, .doit = mptcp_nl_cmd_flush_addrs, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_GET_ADDR, @@ -2238,7 +2238,7 @@ static const struct genl_small_ops mptcp_pm_ops[] = { { .cmd = MPTCP_PM_CMD_SET_LIMITS, .doit = mptcp_nl_cmd_set_limits, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_GET_LIMITS, @@ -2247,27 +2247,27 @@ static const struct genl_small_ops mptcp_pm_ops[] = { { .cmd = MPTCP_PM_CMD_SET_FLAGS, .doit = mptcp_nl_cmd_set_flags, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_ANNOUNCE, .doit = mptcp_nl_cmd_announce, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_REMOVE, .doit = mptcp_nl_cmd_remove, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_SUBFLOW_CREATE, .doit = mptcp_nl_cmd_sf_create, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, { .cmd = MPTCP_PM_CMD_SUBFLOW_DESTROY, .doit = mptcp_nl_cmd_sf_destroy, - .flags = GENL_ADMIN_PERM, + .flags = GENL_UNS_ADMIN_PERM, }, }; From patchwork Tue Sep 6 20:55:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 12968181 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E403C38145 for ; Tue, 6 Sep 2022 20:57:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231245AbiIFU5f (ORCPT ); Tue, 6 Sep 2022 16:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbiIFU5T (ORCPT ); Tue, 6 Sep 2022 16:57:19 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC387A2850 for ; Tue, 6 Sep 2022 13:56:57 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id az27so17249574wrb.6 for ; Tue, 06 Sep 2022 13:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=yMM2FY3IJOc8ZIC+YBU+PmCr88InYvCeIt5RFR0M8Pk=; b=X+Trjh9rPGbs7UPhbuvHibypqjrCN55jfWvRbMk2FxxXv9XSvr/JCZRxehh4P2rxRd enCv/OBAErOTA7xi9ki3iIRmvPIOI8cz0o5C5rq1Z2JsqZD7UNTWLFmoFXoVr1GXKI+J AbnYCgmGnf7kyzoqWsUUclps9Y1474jh7R99y/LoGyAwkE2EJbdxwNAEk+y87+GkrTIF ihIua75zQcntpzpVXAXrObMGh9GMCdWd3PqKSCRBnvoexrt6knZbXMQpd4aJm4UoGg4E kIgGf9+y9hPYHOp83DsKRyoiDVxLtdckdjjt+4TqvyiE1Bq+/x4QL4GnrD41xJZjoV2S ZgLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=yMM2FY3IJOc8ZIC+YBU+PmCr88InYvCeIt5RFR0M8Pk=; b=jd0hFHynx7ALOP2i1QIUYvw8f4Zo9fnbPnl6+awQUmlaspMp2G9n/67ZI245rGTlQ5 1kWYXCnXi0KuqJasPUKwO378c2hz/ty9CpNXOrKNzk8UqHrpgEqaLtg0PcXehm/5E4+b mDH69IQiPfRBOUcgDk8UfotkmgzDpaytoSfEXKOrCxe88gxDIo8bJcByKSWVrXbbrRCb EazA2KvmdH0EuyN+FfmiutbyMhAKHt8WaOD+VerajRIriqxLL01eSwoqQU1tY4MxBEeM 1qO7pZdTVgjZQUwa8oQEL/bc7zvplFB5YIuiCV1CaE4msQtf9qq/DumvV1ckmKk0Gj5k soSg== X-Gm-Message-State: ACgBeo2EPxquWwA7YVw+/sQOY9b1lgaVaZBInewgq8JJ3xk/Yp/stTEY qLE+Eq3WYpxNHwV02Rs9Xn5+yw== X-Google-Smtp-Source: AA6agR6i36nnqPOqjfG5LL42pPJrr20SYSi1MC6hX0LjqRAWLHRtnZIDE+SUfSn3GO/M8GzyX12qSg== X-Received: by 2002:a5d:4534:0:b0:228:a411:1145 with SMTP id j20-20020a5d4534000000b00228a4111145mr165002wra.222.1662497815748; Tue, 06 Sep 2022 13:56:55 -0700 (PDT) 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 n24-20020a1c7218000000b003a317ee3036sm15735887wmc.2.2022.09.06.13.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 13:56:52 -0700 (PDT) From: Matthieu Baerts To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Thomas Haller , netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/5] mptcp: account memory allocation in mptcp_nl_cmd_add_addr() to user Date: Tue, 6 Sep 2022 22:55:43 +0200 Message-Id: <20220906205545.1623193-6-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906205545.1623193-1-matthieu.baerts@tessares.net> References: <20220906205545.1623193-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=865; i=matthieu.baerts@tessares.net; h=from:subject; bh=hqQtNGfqEcSdigDLJiA3QmJUymEPTwMdYwGqPXFlNhA=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjF7O5vhEtOWQ/pfczdwco8rjLVXWSgmW0J1lYVXuy Z/n7UFCJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCYxezuQAKCRD2t4JPQmmgcyagEA COkVtEkFDeK16sX1ShQiSuLqXI8eeLGbzuEd6GSJ2TQS2vOlYP9aw6gYwraBV+mCCzQx6TicRsWC6p bMjqzjwROu98J7e4ZG0/eWDeqTUVPE8FG2kNbMhOPIopWDr0mRG4kUP5ixQuDixOXSLXY9/0wVcAcQ Y6VJlG6f0dxRSitFjOCUN57qxiA4qC/o/y1D0JN7LDBIAbEty4Q0FKMzux+9kSI2bdF4O2LjCYt/XE oClVp6vFG5VdbSFZVrDamFsRdXOS66w8VYYchqogE6MRzEYUvAAy1gBA5dHJWaZKXq4aHtXY6dbZJ8 eY32rg159zmUy3dPquMmnMRJckEXBpABx4QYeqEcj80b2Ihvq15nxxS8C+lyZ3AJI/O8ielu8wmR45 X0kq/DXWmwPH8fq7TGVKvJVSh2LGHRxqWskmSOGsraHhR2CE5Sf/BKBTF0cfDIYgsB1waN2fw4aaDG Ue2Ea/UDJ3N2LoLG7jQ2dw44+vHuJGaW9RGtxVmjE09ECrF+3Wzq/0BoCx/YxDNw/n42/E6G2FrBtQ NtsRmjkKjir8JSZNnqiJ6VgX+X/P2QWhtMDkUcog49bmeexNm0kUXFqn/8L55EucUvgQXzNPCYIjIZ fuG5TolplUBupmQg6iH5BuSPRn+LnBOwvdcJIXbQqKDJp2uMw7Z2NtzTLG9A== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Thomas Haller Now that non-root users can configure MPTCP endpoints, account the memory allocation to the user. Signed-off-by: Thomas Haller Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts --- net/mptcp/pm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index afc98adf2746..9813ed0fde9b 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1327,7 +1327,7 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - entry = kmalloc(sizeof(*entry), GFP_KERNEL); + entry = kmalloc(sizeof(*entry), GFP_KERNEL_ACCOUNT); if (!entry) { GENL_SET_ERR_MSG(info, "can't allocate addr"); return -ENOMEM;