From nobody Wed Dec 4 19:01:33 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DF5D1494B4; Sun, 8 Sep 2024 12:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725800175; cv=none; b=I+ioU+IZiWlig1HIEoOGL3HLVt/ALLjpc40IvDIRntItCVmWAiZIEWyZajtsIwS14T6MLsALUSqqlvVTKQ4wLzG4jzA29esWiuACf/vE2u05PZuAaqgSIn3MTqhdIdfbPJJKw8tcsVKZLIedFJwb6HBlBVMTOfybN3GS1d3FMos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725800175; c=relaxed/simple; bh=PkuEokL6FZ25WCO+YFeb/VOPsNsgzpeb3r1kYsccQnk=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=Wa8s/IM/nUU4eNOPh1pNtHHnB3JP5tXGj6Cdg0izrNebo+GHq93TQ8wSG9LrXT6DxUaE1VFE8zh7YyBk0ykXciHdBWOI58bY1apSXypPtv1XfM/+mx1jKFZ9yYVzs+KDUD2g77P4RnC2S2S1DtVSjGhmUZGN5JdEqE0jTe+DQ6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=01QwClhz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="01QwClhz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68702C4CEC3; Sun, 8 Sep 2024 12:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725800174; bh=PkuEokL6FZ25WCO+YFeb/VOPsNsgzpeb3r1kYsccQnk=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=01QwClhzfhF40L4YKUaqvBEZTma9Ismc+Y0zwPokRxFVrpeuMB3vlVbug580y8YQS uykajIugzRW0OZsZJGKZzLShaM9XNcfyoY2Fv1tFp5K3/ZTDhusINU6eJEGLmi5Dxf iEABO2lZY18JSVMsRe++qvDF4IdIFer0GUmkt6Io= Subject: Patch "mptcp: pr_debug: add missing \n at the end" has been added to the 5.10-stable tree To: geliang@kernel.org,gregkh@linuxfoundation.org,kuba@kernel.org,matttbe@kernel.org,mptcp@lists.linux.dev Cc: From: Date: Sun, 08 Sep 2024 14:56:09 +0200 In-Reply-To: <20240906092255.1931435-2-matttbe@kernel.org> Message-ID: <2024090807-rover-headed-b2d9@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-stable: commit X-Patchwork-Hint: ignore Content-Type: text/plain; charset="utf-8" This is a note to let you know that I've just added the patch titled mptcp: pr_debug: add missing \n at the end to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.git= ;a=3Dsummary The filename of the patch is: mptcp-pr_debug-add-missing-n-at-the-end.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From stable+bounces-73753-greg=3Dkroah.com@vger.kernel.org Fri Sep 6 11:23= :29 2024 From: "Matthieu Baerts (NGI0)" Date: Fri, 6 Sep 2024 11:22:56 +0200 Subject: mptcp: pr_debug: add missing \n at the end To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: MPTCP Upstream , "Matthieu Baerts (NGI0)" , Geliang Tang , Jakub Kicinski Message-ID: <20240906092255.1931435-2-matttbe@kernel.org> From: "Matthieu Baerts (NGI0)" commit cb41b195e634d3f1ecfcd845314e64fd4bb3c7aa upstream. pr_debug() have been added in various places in MPTCP code to help developers to debug some situations. With the dynamic debug feature, it is easy to enable all or some of them, and asks users to reproduce issues with extra debug. Many of these pr_debug() don't end with a new line, while no 'pr_cont()' are used in MPTCP code. So the goal was not to display multiple debug messages on one line: they were then not missing the '\n' on purpose. Not having the new line at the end causes these messages to be printed with a delay, when something else needs to be printed. This issue is not visible when many messages need to be printed, but it is annoying and confusing when only specific messages are expected, e.g. # echo "func mptcp_pm_add_addr_echoed +fmp" \ > /sys/kernel/debug/dynamic_debug/control # ./mptcp_join.sh "signal address"; \ echo "$(awk '{print $1}' /proc/uptime) - end"; \ sleep 5s; \ echo "$(awk '{print $1}' /proc/uptime) - restart"; \ ./mptcp_join.sh "signal address" 013 signal address (...) 10.75 - end 15.76 - restart 013 signal address [ 10.367935] mptcp:mptcp_pm_add_addr_echoed: MPTCP: msk=3D(...) (...) =3D> a delay of 5 seconds: printed with a 10.36 ts, but after 'restart' which was printed at the 15.76 ts. The 'Fixes' tag here below points to the first pr_debug() used without '\n' in net/mptcp. This patch could be split in many small ones, with different Fixes tag, but it doesn't seem worth it, because it is easy to re-generate this patch with this simple 'sed' command: git grep -l pr_debug -- net/mptcp | xargs sed -i "s/\(pr_debug(\".*[^n]\)\(\"[,)]\)/\1\\\n\2/g" So in case of conflicts, simply drop the modifications, and launch this command. Fixes: f870fa0b5768 ("mptcp: Add MPTCP socket stubs") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20240826-net-mptcp-close-extra-sf-fin-v1-4-9= 05199fe1172@kernel.org Signed-off-by: Jakub Kicinski [ As mentioned above, conflicts were expected, and resolved by using the 'sed' command which is visible above. ] Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Greg Kroah-Hartman --- net/mptcp/options.c | 34 +++++++++++++++--------------- net/mptcp/pm.c | 24 ++++++++++----------- net/mptcp/pm_netlink.c | 14 ++++++------ net/mptcp/protocol.c | 54 ++++++++++++++++++++++++--------------------= ----- net/mptcp/protocol.h | 4 +-- net/mptcp/subflow.c | 50 ++++++++++++++++++++++----------------------- 6 files changed, 90 insertions(+), 90 deletions(-) --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -96,7 +96,7 @@ static void mptcp_parse_option(const str mp_opt->data_len =3D get_unaligned_be16(ptr); ptr +=3D 2; } - pr_debug("MP_CAPABLE version=3D%x, flags=3D%x, optlen=3D%d sndr=3D%llu, = rcvr=3D%llu len=3D%d", + pr_debug("MP_CAPABLE version=3D%x, flags=3D%x, optlen=3D%d sndr=3D%llu, = rcvr=3D%llu len=3D%d\n", version, flags, opsize, mp_opt->sndr_key, mp_opt->rcvr_key, mp_opt->data_len); break; @@ -110,7 +110,7 @@ static void mptcp_parse_option(const str ptr +=3D 4; mp_opt->nonce =3D get_unaligned_be32(ptr); ptr +=3D 4; - pr_debug("MP_JOIN bkup=3D%u, id=3D%u, token=3D%u, nonce=3D%u", + pr_debug("MP_JOIN bkup=3D%u, id=3D%u, token=3D%u, nonce=3D%u\n", mp_opt->backup, mp_opt->join_id, mp_opt->token, mp_opt->nonce); } else if (opsize =3D=3D TCPOLEN_MPTCP_MPJ_SYNACK) { @@ -120,20 +120,20 @@ static void mptcp_parse_option(const str ptr +=3D 8; mp_opt->nonce =3D get_unaligned_be32(ptr); ptr +=3D 4; - pr_debug("MP_JOIN bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u", + pr_debug("MP_JOIN bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u\n", mp_opt->backup, mp_opt->join_id, mp_opt->thmac, mp_opt->nonce); } else if (opsize =3D=3D TCPOLEN_MPTCP_MPJ_ACK) { ptr +=3D 2; memcpy(mp_opt->hmac, ptr, MPTCPOPT_HMAC_LEN); - pr_debug("MP_JOIN hmac"); + pr_debug("MP_JOIN hmac\n"); } else { mp_opt->mp_join =3D 0; } break; =20 case MPTCPOPT_DSS: - pr_debug("DSS"); + pr_debug("DSS\n"); ptr++; =20 /* we must clear 'mpc_map' be able to detect MP_CAPABLE @@ -148,7 +148,7 @@ static void mptcp_parse_option(const str mp_opt->ack64 =3D (flags & MPTCP_DSS_ACK64) !=3D 0; mp_opt->use_ack =3D (flags & MPTCP_DSS_HAS_ACK); =20 - pr_debug("data_fin=3D%d dsn64=3D%d use_map=3D%d ack64=3D%d use_ack=3D%d", + pr_debug("data_fin=3D%d dsn64=3D%d use_map=3D%d ack64=3D%d use_ack=3D%d\= n", mp_opt->data_fin, mp_opt->dsn64, mp_opt->use_map, mp_opt->ack64, mp_opt->use_ack); @@ -189,7 +189,7 @@ static void mptcp_parse_option(const str ptr +=3D 4; } =20 - pr_debug("data_ack=3D%llu", mp_opt->data_ack); + pr_debug("data_ack=3D%llu\n", mp_opt->data_ack); } =20 if (mp_opt->use_map) { @@ -207,7 +207,7 @@ static void mptcp_parse_option(const str mp_opt->data_len =3D get_unaligned_be16(ptr); ptr +=3D 2; =20 - pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u", + pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u\n", mp_opt->data_seq, mp_opt->subflow_seq, mp_opt->data_len); } @@ -242,7 +242,7 @@ static void mptcp_parse_option(const str =20 mp_opt->add_addr =3D 1; mp_opt->addr_id =3D *ptr++; - pr_debug("ADD_ADDR: id=3D%d, echo=3D%d", mp_opt->addr_id, mp_opt->echo); + pr_debug("ADD_ADDR: id=3D%d, echo=3D%d\n", mp_opt->addr_id, mp_opt->echo= ); if (mp_opt->family =3D=3D MPTCP_ADDR_IPVERSION_4) { memcpy((u8 *)&mp_opt->addr.s_addr, (u8 *)ptr, 4); ptr +=3D 4; @@ -277,7 +277,7 @@ static void mptcp_parse_option(const str =20 mp_opt->rm_addr =3D 1; mp_opt->rm_id =3D *ptr++; - pr_debug("RM_ADDR: id=3D%d", mp_opt->rm_id); + pr_debug("RM_ADDR: id=3D%d\n", mp_opt->rm_id); break; =20 default: @@ -344,7 +344,7 @@ bool mptcp_syn_options(struct sock *sk, *size =3D TCPOLEN_MPTCP_MPC_SYN; return true; } else if (subflow->request_join) { - pr_debug("remote_token=3D%u, nonce=3D%u", subflow->remote_token, + pr_debug("remote_token=3D%u, nonce=3D%u\n", subflow->remote_token, subflow->local_nonce); opts->suboptions =3D OPTION_MPTCP_MPJ_SYN; opts->join_id =3D subflow->local_id; @@ -436,7 +436,7 @@ static bool mptcp_established_options_mp else *size =3D TCPOLEN_MPTCP_MPC_ACK; =20 - pr_debug("subflow=3D%p, local_key=3D%llu, remote_key=3D%llu map_len=3D%d= ", + pr_debug("subflow=3D%p, local_key=3D%llu, remote_key=3D%llu map_len=3D%d= \n", subflow, subflow->local_key, subflow->remote_key, data_len); =20 @@ -445,7 +445,7 @@ static bool mptcp_established_options_mp opts->suboptions =3D OPTION_MPTCP_MPJ_ACK; memcpy(opts->hmac, subflow->hmac, MPTCPOPT_HMAC_LEN); *size =3D TCPOLEN_MPTCP_MPJ_ACK; - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 schedule_3rdack_retransmission(sk); return true; @@ -619,7 +619,7 @@ static bool mptcp_established_options_ad } } #endif - pr_debug("addr_id=3D%d, ahmac=3D%llu, echo=3D%d", opts->addr_id, opts->ah= mac, echo); + pr_debug("addr_id=3D%d, ahmac=3D%llu, echo=3D%d\n", opts->addr_id, opts->= ahmac, echo); =20 return true; } @@ -644,7 +644,7 @@ static bool mptcp_established_options_rm opts->suboptions |=3D OPTION_MPTCP_RM_ADDR; opts->rm_id =3D rm_id; =20 - pr_debug("rm_id=3D%d", opts->rm_id); + pr_debug("rm_id=3D%d\n", opts->rm_id); =20 return true; } @@ -703,7 +703,7 @@ bool mptcp_synack_options(const struct r opts->suboptions =3D OPTION_MPTCP_MPC_SYNACK; opts->sndr_key =3D subflow_req->local_key; *size =3D TCPOLEN_MPTCP_MPC_SYNACK; - pr_debug("subflow_req=3D%p, local_key=3D%llu", + pr_debug("subflow_req=3D%p, local_key=3D%llu\n", subflow_req, subflow_req->local_key); return true; } else if (subflow_req->mp_join) { @@ -712,7 +712,7 @@ bool mptcp_synack_options(const struct r opts->join_id =3D subflow_req->local_id; opts->thmac =3D subflow_req->thmac; opts->nonce =3D subflow_req->local_nonce; - pr_debug("req=3D%p, bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u", + pr_debug("req=3D%p, bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u\n", subflow_req, opts->backup, opts->join_id, opts->thmac, opts->nonce); *size =3D TCPOLEN_MPTCP_MPJ_SYNACK; --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -16,7 +16,7 @@ int mptcp_pm_announce_addr(struct mptcp_ const struct mptcp_addr_info *addr, bool echo) { - pr_debug("msk=3D%p, local_id=3D%d", msk, addr->id); + pr_debug("msk=3D%p, local_id=3D%d\n", msk, addr->id); =20 msk->pm.local =3D *addr; WRITE_ONCE(msk->pm.add_addr_echo, echo); @@ -26,7 +26,7 @@ int mptcp_pm_announce_addr(struct mptcp_ =20 int mptcp_pm_remove_addr(struct mptcp_sock *msk, u8 local_id) { - pr_debug("msk=3D%p, local_id=3D%d", msk, local_id); + pr_debug("msk=3D%p, local_id=3D%d\n", msk, local_id); =20 msk->pm.rm_id =3D local_id; WRITE_ONCE(msk->pm.rm_addr_signal, true); @@ -35,7 +35,7 @@ int mptcp_pm_remove_addr(struct mptcp_so =20 int mptcp_pm_remove_subflow(struct mptcp_sock *msk, u8 local_id) { - pr_debug("msk=3D%p, local_id=3D%d", msk, local_id); + pr_debug("msk=3D%p, local_id=3D%d\n", msk, local_id); =20 spin_lock_bh(&msk->pm.lock); mptcp_pm_nl_rm_subflow_received(msk, local_id); @@ -49,7 +49,7 @@ void mptcp_pm_new_connection(struct mptc { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p, token=3D%u side=3D%d", msk, msk->token, server_side); + pr_debug("msk=3D%p, token=3D%u side=3D%d\n", msk, msk->token, server_side= ); =20 WRITE_ONCE(pm->server_side, server_side); } @@ -59,7 +59,7 @@ bool mptcp_pm_allow_new_subflow(struct m struct mptcp_pm_data *pm =3D &msk->pm; int ret =3D 0; =20 - pr_debug("msk=3D%p subflows=3D%d max=3D%d allow=3D%d", msk, pm->subflows, + pr_debug("msk=3D%p subflows=3D%d max=3D%d allow=3D%d\n", msk, pm->subflow= s, pm->subflows_max, READ_ONCE(pm->accept_subflow)); =20 /* try to avoid acquiring the lock below */ @@ -83,7 +83,7 @@ bool mptcp_pm_allow_new_subflow(struct m static bool mptcp_pm_schedule_work(struct mptcp_sock *msk, enum mptcp_pm_status new_status) { - pr_debug("msk=3D%p status=3D%x new=3D%lx", msk, msk->pm.status, + pr_debug("msk=3D%p status=3D%x new=3D%lx\n", msk, msk->pm.status, BIT(new_status)); if (msk->pm.status & BIT(new_status)) return false; @@ -98,7 +98,7 @@ void mptcp_pm_fully_established(struct m { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 /* try to avoid acquiring the lock below */ if (!READ_ONCE(pm->work_pending)) @@ -114,7 +114,7 @@ void mptcp_pm_fully_established(struct m =20 void mptcp_pm_connection_closed(struct mptcp_sock *msk) { - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); } =20 void mptcp_pm_subflow_established(struct mptcp_sock *msk, @@ -122,7 +122,7 @@ void mptcp_pm_subflow_established(struct { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 if (!READ_ONCE(pm->work_pending)) return; @@ -137,7 +137,7 @@ void mptcp_pm_subflow_established(struct =20 void mptcp_pm_subflow_closed(struct mptcp_sock *msk, u8 id) { - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); } =20 void mptcp_pm_add_addr_received(struct mptcp_sock *msk, @@ -145,7 +145,7 @@ void mptcp_pm_add_addr_received(struct m { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p remote_id=3D%d accept=3D%d", msk, addr->id, + pr_debug("msk=3D%p remote_id=3D%d accept=3D%d\n", msk, addr->id, READ_ONCE(pm->accept_addr)); =20 spin_lock_bh(&pm->lock); @@ -162,7 +162,7 @@ void mptcp_pm_rm_addr_received(struct mp { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p remote_id=3D%d", msk, rm_id); + pr_debug("msk=3D%p remote_id=3D%d\n", msk, rm_id); =20 spin_lock_bh(&pm->lock); mptcp_pm_schedule_work(msk, MPTCP_PM_RM_ADDR_RECEIVED); --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -206,7 +206,7 @@ static void mptcp_pm_add_timer(struct ti struct mptcp_sock *msk =3D entry->sock; struct sock *sk =3D (struct sock *)msk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 if (!msk) return; @@ -225,7 +225,7 @@ static void mptcp_pm_add_timer(struct ti spin_lock_bh(&msk->pm.lock); =20 if (!mptcp_pm_should_add_signal(msk)) { - pr_debug("retransmit ADD_ADDR id=3D%d", entry->addr.id); + pr_debug("retransmit ADD_ADDR id=3D%d\n", entry->addr.id); mptcp_pm_announce_addr(msk, &entry->addr, false); entry->retrans_times++; } @@ -289,7 +289,7 @@ void mptcp_pm_free_anno_list(struct mptc struct sock *sk =3D (struct sock *)msk; LIST_HEAD(free_list); =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 spin_lock_bh(&msk->pm.lock); list_splice_init(&msk->pm.anno_list, &free_list); @@ -372,7 +372,7 @@ void mptcp_pm_nl_add_addr_received(struc struct mptcp_addr_info local; int err; =20 - pr_debug("accepted %d:%d remote family %d", + pr_debug("accepted %d:%d remote family %d\n", msk->pm.add_addr_accepted, msk->pm.add_addr_accept_max, msk->pm.remote.family); msk->pm.subflows++; @@ -405,7 +405,7 @@ void mptcp_pm_nl_rm_addr_received(struct struct mptcp_subflow_context *subflow, *tmp; struct sock *sk =3D (struct sock *)msk; =20 - pr_debug("address rm_id %d", msk->pm.rm_id); + pr_debug("address rm_id %d\n", msk->pm.rm_id); =20 if (!msk->pm.rm_id) return; @@ -441,7 +441,7 @@ void mptcp_pm_nl_rm_subflow_received(str struct mptcp_subflow_context *subflow, *tmp; struct sock *sk =3D (struct sock *)msk; =20 - pr_debug("subflow rm_id %d", rm_id); + pr_debug("subflow rm_id %d\n", rm_id); =20 if (!rm_id) return; @@ -791,7 +791,7 @@ static int mptcp_nl_remove_subflow_and_s struct mptcp_sock *msk; long s_slot =3D 0, s_num =3D 0; =20 - pr_debug("remove_id=3D%d", addr->id); + pr_debug("remove_id=3D%d\n", addr->id); =20 while ((msk =3D mptcp_token_iter_next(net, &s_slot, &s_num)) !=3D NULL) { struct sock *sk =3D (struct sock *)msk; --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -128,7 +128,7 @@ static bool mptcp_try_coalesce(struct so !skb_try_coalesce(to, from, &fragstolen, &delta)) return false; =20 - pr_debug("colesced seq %llx into %llx new len %d new end seq %llx", + pr_debug("colesced seq %llx into %llx new len %d new end seq %llx\n", MPTCP_SKB_CB(from)->map_seq, MPTCP_SKB_CB(to)->map_seq, to->len, MPTCP_SKB_CB(from)->end_seq); MPTCP_SKB_CB(to)->end_seq =3D MPTCP_SKB_CB(from)->end_seq; @@ -164,7 +164,7 @@ static void mptcp_data_queue_ofo(struct space =3D tcp_space(sk); max_seq =3D space > 0 ? space + msk->ack_seq : msk->ack_seq; =20 - pr_debug("msk=3D%p seq=3D%llx limit=3D%llx empty=3D%d", msk, seq, max_seq, + pr_debug("msk=3D%p seq=3D%llx limit=3D%llx empty=3D%d\n", msk, seq, max_s= eq, RB_EMPTY_ROOT(&msk->out_of_order_queue)); if (after64(seq, max_seq)) { /* out of window */ @@ -469,7 +469,7 @@ static bool __mptcp_move_skbs_from_subfl u32 old_copied_seq; bool done =3D false; =20 - pr_debug("msk=3D%p ssk=3D%p", msk, ssk); + pr_debug("msk=3D%p ssk=3D%p\n", msk, ssk); tp =3D tcp_sk(ssk); old_copied_seq =3D tp->copied_seq; do { @@ -552,7 +552,7 @@ static bool mptcp_ofo_queue(struct mptcp u64 end_seq; =20 p =3D rb_first(&msk->out_of_order_queue); - pr_debug("msk=3D%p empty=3D%d", msk, RB_EMPTY_ROOT(&msk->out_of_order_que= ue)); + pr_debug("msk=3D%p empty=3D%d\n", msk, RB_EMPTY_ROOT(&msk->out_of_order_q= ueue)); while (p) { skb =3D rb_to_skb(p); if (after64(MPTCP_SKB_CB(skb)->map_seq, msk->ack_seq)) @@ -574,7 +574,7 @@ static bool mptcp_ofo_queue(struct mptcp int delta =3D msk->ack_seq - MPTCP_SKB_CB(skb)->map_seq; =20 /* skip overlapping data, if any */ - pr_debug("uncoalesced seq=3D%llx ack seq=3D%llx delta=3D%d", + pr_debug("uncoalesced seq=3D%llx ack seq=3D%llx delta=3D%d\n", MPTCP_SKB_CB(skb)->map_seq, msk->ack_seq, delta); MPTCP_SKB_CB(skb)->offset +=3D delta; @@ -956,12 +956,12 @@ static int mptcp_sendmsg_frag(struct soc psize =3D min_t(size_t, pfrag->size - offset, avail_size); =20 /* Copy to page */ - pr_debug("left=3D%zu", msg_data_left(msg)); + pr_debug("left=3D%zu\n", msg_data_left(msg)); psize =3D copy_page_from_iter(pfrag->page, offset, min_t(size_t, msg_data_left(msg), psize), &msg->msg_iter); - pr_debug("left=3D%zu", msg_data_left(msg)); + pr_debug("left=3D%zu\n", msg_data_left(msg)); if (!psize) return -EINVAL; =20 @@ -1031,7 +1031,7 @@ static int mptcp_sendmsg_frag(struct soc mpext->use_map =3D 1; mpext->dsn64 =3D 1; =20 - pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u dsn64=3D%d", + pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u dsn64=3D%d\n", mpext->data_seq, mpext->subflow_seq, mpext->data_len, mpext->dsn64); =20 @@ -1147,7 +1147,7 @@ static struct sock *mptcp_subflow_get_se } } =20 - pr_debug("msk=3D%p nr_active=3D%d ssk=3D%p:%lld backup=3D%p:%lld", + pr_debug("msk=3D%p nr_active=3D%d ssk=3D%p:%lld backup=3D%p:%lld\n", msk, nr_active, send_info[0].ssk, send_info[0].ratio, send_info[1].ssk, send_info[1].ratio); =20 @@ -1240,7 +1240,7 @@ restart: sndbuf > READ_ONCE(sk->sk_sndbuf)) WRITE_ONCE(sk->sk_sndbuf, sndbuf); =20 - pr_debug("conn_list->subflow=3D%p", ssk); + pr_debug("conn_list->subflow=3D%p\n", ssk); =20 lock_sock(ssk); tx_ok =3D msg_data_left(msg); @@ -1577,7 +1577,7 @@ static int mptcp_recvmsg(struct sock *sk } } =20 - pr_debug("block timeout %ld", timeo); + pr_debug("block timeout %ld\n", timeo); mptcp_wait_data(sk, &timeo); } =20 @@ -1595,7 +1595,7 @@ static int mptcp_recvmsg(struct sock *sk set_bit(MPTCP_DATA_READY, &msk->flags); } out_err: - pr_debug("msk=3D%p data_ready=3D%d rx queue empty=3D%d copied=3D%d", + pr_debug("msk=3D%p data_ready=3D%d rx queue empty=3D%d copied=3D%d\n", msk, test_bit(MPTCP_DATA_READY, &msk->flags), skb_queue_empty(&sk->sk_receive_queue), copied); mptcp_rcv_space_adjust(msk, copied); @@ -1712,7 +1712,7 @@ static void pm_work(struct mptcp_sock *m =20 spin_lock_bh(&msk->pm.lock); =20 - pr_debug("msk=3D%p status=3D%x", msk, pm->status); + pr_debug("msk=3D%p status=3D%x\n", msk, pm->status); if (pm->status & BIT(MPTCP_PM_ADD_ADDR_RECEIVED)) { pm->status &=3D ~BIT(MPTCP_PM_ADD_ADDR_RECEIVED); mptcp_pm_nl_add_addr_received(msk); @@ -1913,11 +1913,11 @@ void mptcp_subflow_shutdown(struct sock break; default: if (__mptcp_check_fallback(mptcp_sk(sk))) { - pr_debug("Fallback"); + pr_debug("Fallback\n"); ssk->sk_shutdown |=3D how; tcp_shutdown(ssk, how); } else { - pr_debug("Sending DATA_FIN on subflow %p", ssk); + pr_debug("Sending DATA_FIN on subflow %p\n", ssk); mptcp_set_timeout(sk, ssk); tcp_send_ack(ssk); } @@ -1973,7 +1973,7 @@ static void mptcp_close(struct sock *sk, if (__mptcp_check_fallback(msk)) { goto update_state; } else if (mptcp_close_state(sk)) { - pr_debug("Sending DATA_FIN sk=3D%p", sk); + pr_debug("Sending DATA_FIN sk=3D%p\n", sk); WRITE_ONCE(msk->write_seq, msk->write_seq + 1); WRITE_ONCE(msk->snd_data_fin_enable, 1); =20 @@ -2181,12 +2181,12 @@ static struct sock *mptcp_accept(struct return NULL; } =20 - pr_debug("msk=3D%p, listener=3D%p", msk, mptcp_subflow_ctx(listener->sk)); + pr_debug("msk=3D%p, listener=3D%p\n", msk, mptcp_subflow_ctx(listener->sk= )); newsk =3D inet_csk_accept(listener->sk, flags, err, kern); if (!newsk) return NULL; =20 - pr_debug("msk=3D%p, subflow is mptcp=3D%d", msk, sk_is_mptcp(newsk)); + pr_debug("msk=3D%p, subflow is mptcp=3D%d\n", msk, sk_is_mptcp(newsk)); if (sk_is_mptcp(newsk)) { struct mptcp_subflow_context *subflow; struct sock *new_mptcp_sock; @@ -2351,7 +2351,7 @@ static int mptcp_setsockopt(struct sock struct mptcp_sock *msk =3D mptcp_sk(sk); struct sock *ssk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 if (mptcp_unsupported(level, optname)) return -ENOPROTOOPT; @@ -2383,7 +2383,7 @@ static int mptcp_getsockopt(struct sock struct mptcp_sock *msk =3D mptcp_sk(sk); struct sock *ssk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 /* @@ the meaning of setsockopt() when the socket is connected and * there are multiple subflows is not yet defined. It is up to the @@ -2454,7 +2454,7 @@ static int mptcp_get_port(struct sock *s struct socket *ssock; =20 ssock =3D __mptcp_nmpc_socket(msk); - pr_debug("msk=3D%p, subflow=3D%p", msk, ssock); + pr_debug("msk=3D%p, subflow=3D%p\n", msk, ssock); if (WARN_ON_ONCE(!ssock)) return -EINVAL; =20 @@ -2472,7 +2472,7 @@ void mptcp_finish_connect(struct sock *s sk =3D subflow->conn; msk =3D mptcp_sk(sk); =20 - pr_debug("msk=3D%p, token=3D%u", sk, subflow->token); + pr_debug("msk=3D%p, token=3D%u\n", sk, subflow->token); =20 mptcp_crypto_key_sha(subflow->remote_key, NULL, &ack_seq); ack_seq++; @@ -2511,7 +2511,7 @@ bool mptcp_finish_join(struct sock *sk) struct socket *parent_sock; bool ret; =20 - pr_debug("msk=3D%p, subflow=3D%p", msk, subflow); + pr_debug("msk=3D%p, subflow=3D%p\n", msk, subflow); =20 /* mptcp socket already closing? */ if (!mptcp_is_fully_established(parent)) @@ -2673,7 +2673,7 @@ static int mptcp_listen(struct socket *s struct socket *ssock; int err; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 lock_sock(sock->sk); ssock =3D __mptcp_nmpc_socket(msk); @@ -2703,7 +2703,7 @@ static int mptcp_stream_accept(struct so struct socket *ssock; int err; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 lock_sock(sock->sk); if (sock->sk->sk_state !=3D TCP_LISTEN) @@ -2762,7 +2762,7 @@ static __poll_t mptcp_poll(struct file * sock_poll_wait(file, sock, wait); =20 state =3D inet_sk_state_load(sk); - pr_debug("msk=3D%p state=3D%d flags=3D%lx", msk, state, msk->flags); + pr_debug("msk=3D%p state=3D%d flags=3D%lx\n", msk, state, msk->flags); if (state =3D=3D TCP_LISTEN) return mptcp_check_readable(msk); =20 @@ -2783,7 +2783,7 @@ static int mptcp_shutdown(struct socket struct mptcp_subflow_context *subflow; int ret =3D 0; =20 - pr_debug("sk=3D%p, how=3D%d", msk, how); + pr_debug("sk=3D%p, how=3D%d\n", msk, how); =20 lock_sock(sock->sk); =20 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -523,7 +523,7 @@ static inline bool mptcp_check_fallback( static inline void __mptcp_do_fallback(struct mptcp_sock *msk) { if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) { - pr_debug("TCP fallback already done (msk=3D%p)", msk); + pr_debug("TCP fallback already done (msk=3D%p)\n", msk); return; } set_bit(MPTCP_FALLBACK_DONE, &msk->flags); @@ -537,7 +537,7 @@ static inline void mptcp_do_fallback(str __mptcp_do_fallback(msk); } =20 -#define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)", __func__,= a) +#define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)\n", __func_= _, a) =20 static inline bool subflow_simultaneous_connect(struct sock *sk) { --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -34,7 +34,7 @@ static void subflow_req_destructor(struc { struct mptcp_subflow_request_sock *subflow_req =3D mptcp_subflow_rsk(req); =20 - pr_debug("subflow_req=3D%p", subflow_req); + pr_debug("subflow_req=3D%p\n", subflow_req); =20 if (subflow_req->msk) sock_put((struct sock *)subflow_req->msk); @@ -121,7 +121,7 @@ static void subflow_init_req(struct requ struct mptcp_options_received mp_opt; int ret; =20 - pr_debug("subflow_req=3D%p, listener=3D%p", subflow_req, listener); + pr_debug("subflow_req=3D%p, listener=3D%p\n", subflow_req, listener); =20 ret =3D __subflow_init_req(req, sk_listener); if (ret) @@ -183,7 +183,7 @@ again: subflow_init_req_cookie_join_save(subflow_req, skb); } =20 - pr_debug("token=3D%u, remote_nonce=3D%u msk=3D%p", subflow_req->token, + pr_debug("token=3D%u, remote_nonce=3D%u msk=3D%p\n", subflow_req->token, subflow_req->remote_nonce, subflow_req->msk); } } @@ -306,7 +306,7 @@ static void subflow_finish_connect(struc subflow->rel_write_seq =3D 1; subflow->conn_finished =3D 1; subflow->ssn_offset =3D TCP_SKB_CB(skb)->seq; - pr_debug("subflow=3D%p synack seq=3D%x", subflow, subflow->ssn_offset); + pr_debug("subflow=3D%p synack seq=3D%x\n", subflow, subflow->ssn_offset); =20 mptcp_get_options(skb, &mp_opt); if (subflow->request_mptcp) { @@ -321,7 +321,7 @@ static void subflow_finish_connect(struc subflow->mp_capable =3D 1; subflow->can_ack =3D 1; subflow->remote_key =3D mp_opt.sndr_key; - pr_debug("subflow=3D%p, remote_key=3D%llu", subflow, + pr_debug("subflow=3D%p, remote_key=3D%llu\n", subflow, subflow->remote_key); mptcp_finish_connect(sk); } else if (subflow->request_join) { @@ -332,7 +332,7 @@ static void subflow_finish_connect(struc =20 subflow->thmac =3D mp_opt.thmac; subflow->remote_nonce =3D mp_opt.nonce; - pr_debug("subflow=3D%p, thmac=3D%llu, remote_nonce=3D%u", subflow, + pr_debug("subflow=3D%p, thmac=3D%llu, remote_nonce=3D%u\n", subflow, subflow->thmac, subflow->remote_nonce); =20 if (!subflow_thmac_valid(subflow)) { @@ -371,7 +371,7 @@ static int subflow_v4_conn_request(struc { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); =20 - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 /* Never answer to SYNs sent to broadcast or multicast */ if (skb_rtable(skb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) @@ -401,7 +401,7 @@ static int subflow_v6_conn_request(struc { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); =20 - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 if (skb->protocol =3D=3D htons(ETH_P_IP)) return subflow_v4_conn_request(sk, skb); @@ -543,7 +543,7 @@ static struct sock *subflow_syn_recv_soc struct sock *new_msk =3D NULL; struct sock *child; =20 - pr_debug("listener=3D%p, req=3D%p, conn=3D%p", listener, req, listener->c= onn); + pr_debug("listener=3D%p, req=3D%p, conn=3D%p\n", listener, req, listener-= >conn); =20 /* After child creation we must look for 'mp_capable' even when options * are not parsed @@ -692,7 +692,7 @@ static u64 expand_seq(u64 old_seq, u16 o =20 static void dbg_bad_map(struct mptcp_subflow_context *subflow, u32 ssn) { - pr_debug("Bad mapping: ssn=3D%d map_seq=3D%d map_data_len=3D%d", + pr_debug("Bad mapping: ssn=3D%d map_seq=3D%d map_data_len=3D%d\n", ssn, subflow->map_subflow_seq, subflow->map_data_len); } =20 @@ -768,7 +768,7 @@ static enum mapping_status get_mapping_s goto validate_seq; } =20 - pr_debug("seq=3D%llu is64=3D%d ssn=3D%u data_len=3D%u data_fin=3D%d", + pr_debug("seq=3D%llu is64=3D%d ssn=3D%u data_len=3D%u data_fin=3D%d\n", mpext->data_seq, mpext->dsn64, mpext->subflow_seq, mpext->data_len, mpext->data_fin); =20 @@ -782,7 +782,7 @@ static enum mapping_status get_mapping_s if (data_len =3D=3D 1) { bool updated =3D mptcp_update_rcv_data_fin(msk, mpext->data_seq, mpext->dsn64); - pr_debug("DATA_FIN with no payload seq=3D%llu", mpext->data_seq); + pr_debug("DATA_FIN with no payload seq=3D%llu\n", mpext->data_seq); if (subflow->map_valid) { /* A DATA_FIN might arrive in a DSS * option before the previous mapping @@ -807,7 +807,7 @@ static enum mapping_status get_mapping_s data_fin_seq &=3D GENMASK_ULL(31, 0); =20 mptcp_update_rcv_data_fin(msk, data_fin_seq, mpext->dsn64); - pr_debug("DATA_FIN with mapping seq=3D%llu dsn64=3D%d", + pr_debug("DATA_FIN with mapping seq=3D%llu dsn64=3D%d\n", data_fin_seq, mpext->dsn64); } =20 @@ -818,7 +818,7 @@ static enum mapping_status get_mapping_s if (!mpext->dsn64) { map_seq =3D expand_seq(subflow->map_seq, subflow->map_data_len, mpext->data_seq); - pr_debug("expanded seq=3D%llu", subflow->map_seq); + pr_debug("expanded seq=3D%llu\n", subflow->map_seq); } else { map_seq =3D mpext->data_seq; } @@ -850,7 +850,7 @@ static enum mapping_status get_mapping_s subflow->map_data_len =3D data_len; subflow->map_valid =3D 1; subflow->mpc_map =3D mpext->mpc_map; - pr_debug("new map seq=3D%llu subflow_seq=3D%u data_len=3D%u", + pr_debug("new map seq=3D%llu subflow_seq=3D%u data_len=3D%u\n", subflow->map_seq, subflow->map_subflow_seq, subflow->map_data_len); =20 @@ -880,7 +880,7 @@ static void mptcp_subflow_discard_data(s avail_len =3D skb->len - offset; incr =3D limit >=3D avail_len ? avail_len + fin : limit; =20 - pr_debug("discarding=3D%d len=3D%d offset=3D%d seq=3D%d", incr, skb->len, + pr_debug("discarding=3D%d len=3D%d offset=3D%d seq=3D%d\n", incr, skb->le= n, offset, subflow->map_subflow_seq); MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DUPDATA); tcp_sk(ssk)->copied_seq +=3D incr; @@ -901,7 +901,7 @@ static bool subflow_check_data_avail(str struct mptcp_sock *msk; struct sk_buff *skb; =20 - pr_debug("msk=3D%p ssk=3D%p data_avail=3D%d skb=3D%p", subflow->conn, ssk, + pr_debug("msk=3D%p ssk=3D%p data_avail=3D%d skb=3D%p\n", subflow->conn, s= sk, subflow->data_avail, skb_peek(&ssk->sk_receive_queue)); if (!skb_peek(&ssk->sk_receive_queue)) subflow->data_avail =3D 0; @@ -914,7 +914,7 @@ static bool subflow_check_data_avail(str u64 old_ack; =20 status =3D get_mapping_status(ssk, msk); - pr_debug("msk=3D%p ssk=3D%p status=3D%d", msk, ssk, status); + pr_debug("msk=3D%p ssk=3D%p status=3D%d\n", msk, ssk, status); if (status =3D=3D MAPPING_INVALID) { ssk->sk_err =3D EBADMSG; goto fatal; @@ -953,7 +953,7 @@ static bool subflow_check_data_avail(str =20 old_ack =3D READ_ONCE(msk->ack_seq); ack_seq =3D mptcp_subflow_get_mapped_dsn(subflow); - pr_debug("msk ack_seq=3D%llx subflow ack_seq=3D%llx", old_ack, + pr_debug("msk ack_seq=3D%llx subflow ack_seq=3D%llx\n", old_ack, ack_seq); if (ack_seq =3D=3D old_ack) { subflow->data_avail =3D MPTCP_SUBFLOW_DATA_AVAIL; @@ -991,7 +991,7 @@ bool mptcp_subflow_data_available(struct subflow->map_valid =3D 0; subflow->data_avail =3D 0; =20 - pr_debug("Done with mapping: seq=3D%u data_len=3D%u", + pr_debug("Done with mapping: seq=3D%u data_len=3D%u\n", subflow->map_subflow_seq, subflow->map_data_len); } @@ -1079,7 +1079,7 @@ void mptcpv6_handle_mapped(struct sock * =20 target =3D mapped ? &subflow_v6m_specific : subflow_default_af_ops(sk); =20 - pr_debug("subflow=3D%p family=3D%d ops=3D%p target=3D%p mapped=3D%d", + pr_debug("subflow=3D%p family=3D%d ops=3D%p target=3D%p mapped=3D%d\n", subflow, sk->sk_family, icsk->icsk_af_ops, target, mapped); =20 if (likely(icsk->icsk_af_ops =3D=3D target)) @@ -1162,7 +1162,7 @@ int __mptcp_subflow_connect(struct sock goto failed; =20 mptcp_crypto_key_sha(subflow->remote_key, &remote_token, NULL); - pr_debug("msk=3D%p remote_token=3D%u local_id=3D%d remote_id=3D%d", msk, + pr_debug("msk=3D%p remote_token=3D%u local_id=3D%d remote_id=3D%d\n", msk, remote_token, local_id, remote_id); subflow->remote_token =3D remote_token; subflow->local_id =3D local_id; @@ -1233,7 +1233,7 @@ int mptcp_subflow_create_socket(struct s SOCK_INODE(sf)->i_gid =3D SOCK_INODE(sk->sk_socket)->i_gid; =20 subflow =3D mptcp_subflow_ctx(sf->sk); - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 *new_sock =3D sf; sock_hold(sk); @@ -1255,7 +1255,7 @@ static struct mptcp_subflow_context *sub rcu_assign_pointer(icsk->icsk_ulp_data, ctx); INIT_LIST_HEAD(&ctx->node); =20 - pr_debug("subflow=3D%p", ctx); + pr_debug("subflow=3D%p\n", ctx); =20 ctx->tcp_sock =3D sk; =20 @@ -1332,7 +1332,7 @@ static int subflow_ulp_init(struct sock goto out; } =20 - pr_debug("subflow=3D%p, family=3D%d", ctx, sk->sk_family); + pr_debug("subflow=3D%p, family=3D%d\n", ctx, sk->sk_family); =20 tp->is_mptcp =3D 1; ctx->icsk_af_ops =3D icsk->icsk_af_ops; Patches currently in stable-queue which might be from matttbe@kernel.org are queue-5.10/mptcp-pm-avoid-possible-uaf-when-selecting-endp.patch queue-5.10/mptcp-pr_debug-add-missing-n-at-the-end.patch