From: Paolo Abeni <pabeni@xxxxxxxxxx> commit 0a567c2a10033bf04ed618368d179bce6977984b upstream. Since its introduction, the mentioned MIB accounted for the wrong event: wake-up being skipped as not-needed on some edge condition instead of incoming skb being dropped after landing in the (subflow) receive queue. Move the increment in the correct location. Fixes: ce599c516386 ("mptcp: properly account bulk freed memory") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx> Reviewed-by: Mat Martineau <martineau@xxxxxxxxxx> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx> Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/mptcp/protocol.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -363,8 +363,10 @@ static bool __mptcp_move_skb(struct mptc skb_orphan(skb); /* try to fetch required memory from subflow */ - if (!mptcp_rmem_schedule(sk, ssk, skb->truesize)) + if (!mptcp_rmem_schedule(sk, ssk, skb->truesize)) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED); goto drop; + } has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp; @@ -851,10 +853,8 @@ void mptcp_data_ready(struct sock *sk, s sk_rbuf = ssk_rbuf; /* over limit? can't append more skbs to msk, Also, no need to wake-up*/ - if (__mptcp_rmem(sk) > sk_rbuf) { - MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED); + if (__mptcp_rmem(sk) > sk_rbuf) return; - } /* Wake-up the reader only for in-sequence data */ mptcp_data_lock(sk); Patches currently in stable-queue which might be from pabeni@xxxxxxxxxx are queue-6.1/ipv6-fix-ndisc_is_useropt-handling-for-pio.patch queue-6.1/mptcp-pm-only-set-request_bkup-flag-when-sending-mp_prio.patch queue-6.1/mptcp-fix-duplicate-data-handling.patch queue-6.1/mptcp-distinguish-rcv-vs-sent-backup-flag-in-requests.patch queue-6.1/mptcp-fix-user-space-pm-announced-address-accounting.patch queue-6.1/mptcp-sched-check-both-directions-for-backup.patch queue-6.1/mptcp-fix-bad-rcvpruned-mib-accounting.patch queue-6.1/net-iucv-fix-use-after-free-in-iucv_sock_close.patch queue-6.1/mptcp-fix-nl-pm-announced-address-accounting.patch