stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Paolo Abeni <pabeni@redhat.com>,
	"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 6.6 42/72] mptcp: fix spurious wake-up on under memory pressure
Date: Tue, 21 Jan 2025 18:52:08 +0100	[thread overview]
Message-ID: <20250121174525.044117629@linuxfoundation.org> (raw)
In-Reply-To: <20250121174523.429119852@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paolo Abeni <pabeni@redhat.com>

commit e226d9259dc4f5d2c19e6682ad1356fa97cf38f4 upstream.

The wake-up condition currently implemented by mptcp_epollin_ready()
is wrong, as it could mark the MPTCP socket as readable even when
no data are present and the system is under memory pressure.

Explicitly check for some data being available in the receive queue.

Fixes: 5684ab1a0eff ("mptcp: give rcvlowat some love")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250113-net-mptcp-connect-st-flakes-v1-2-0d986ee7b1b6@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/mptcp/protocol.h |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -685,10 +685,15 @@ static inline u64 mptcp_data_avail(const
 
 static inline bool mptcp_epollin_ready(const struct sock *sk)
 {
+	u64 data_avail = mptcp_data_avail(mptcp_sk(sk));
+
+	if (!data_avail)
+		return false;
+
 	/* mptcp doesn't have to deal with small skbs in the receive queue,
-	 * at it can always coalesce them
+	 * as it can always coalesce them
 	 */
-	return (mptcp_data_avail(mptcp_sk(sk)) >= sk->sk_rcvlowat) ||
+	return (data_avail >= sk->sk_rcvlowat) ||
 	       (mem_cgroup_sockets_enabled && sk->sk_memcg &&
 		mem_cgroup_under_socket_pressure(sk->sk_memcg)) ||
 	       READ_ONCE(tcp_memory_pressure);



  parent reply	other threads:[~2025-01-21 17:55 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 17:51 [PATCH 6.6 00/72] 6.6.74-rc1 review Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 01/72] net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field() Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 02/72] bpf: Fix bpf_sk_select_reuseport() memory leak Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 03/72] openvswitch: fix lockup on tx to unregistering netdev with carrier Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 04/72] pktgen: Avoid out-of-bounds access in get_imix_entries Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 05/72] net: add exit_batch_rtnl() method Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 06/72] gtp: use " Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 07/72] gtp: Use for_each_netdev_rcu() in gtp_genl_dump_pdp() Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 08/72] gtp: Destroy device along with udp sockets netns dismantle Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 09/72] nfp: bpf: prevent integer overflow in nfp_bpf_event_output() Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 10/72] net: xilinx: axienet: Fix IRQ coalescing packet count overflow Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 11/72] net: fec: handle page_pool_dev_alloc_pages error Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 12/72] net/mlx5: Fix RDMA TX steering prio Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 13/72] net/mlx5: Clear port select structure when fail to create Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 14/72] net/mlx5e: Fix inversion dependency warning while enabling IPsec tunnel Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 15/72] net/mlx5e: Rely on reqid in IPsec tunnel mode Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 16/72] net/mlx5e: Always start IPsec sequence number from 1 Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 17/72] drm/vmwgfx: Add new keep_resv BO param Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 18/72] drm/v3d: Ensure job pointer is set to NULL after job completion Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 19/72] soc: ti: pruss: Fix pruss APIs Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 20/72] hwmon: (tmp513) Fix division of negative numbers Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 21/72] Revert "mtd: spi-nor: core: replace dummy buswidth from addr to data" Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 22/72] i2c: mux: demux-pinctrl: check initial mux selection, too Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 23/72] i2c: rcar: fix NACK handling when being a target Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 24/72] smb: client: fix double free of TCP_Server_Info::hostname Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 25/72] mac802154: check local interfaces before deleting sdata list Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 26/72] hfs: Sanity check the root record Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 27/72] fs: fix missing declaration of init_files Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 28/72] kheaders: Ignore silly-rename files Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 29/72] cachefiles: Parse the "secctx" immediately Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 30/72] scsi: ufs: core: Honor runtime/system PM levels if set by host controller drivers Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 31/72] selftests: tc-testing: reduce rshift value Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 32/72] ACPI: resource: acpi_dev_irq_override(): Check DMI match last Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 33/72] iomap: avoid avoid truncating 64-bit offset to 32 bits Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 34/72] poll_wait: add mb() to fix theoretical race between waitqueue_active() and .poll() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 35/72] RDMA/bnxt_re: Fix to export port num to ib_query_qp Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 36/72] nvmet: propagate npwg topology Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 37/72] x86/asm: Make serialize() always_inline Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 38/72] ALSA: hda/realtek: Add support for Ayaneo System using CS35L41 HDA Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 39/72] zram: fix potential UAF of zram table Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 40/72] i2c: atr: Fix client detach Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 41/72] mptcp: be sure to send ack when mptcp-level window re-opens Greg Kroah-Hartman
2025-01-21 17:52 ` Greg Kroah-Hartman [this message]
2025-01-21 17:52 ` [PATCH 6.6 43/72] selftests: mptcp: avoid spurious errors on disconnect Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 44/72] net: ethernet: xgbe: re-add aneg to supported features in PHY quirks Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 45/72] vsock/bpf: return early if transport is not assigned Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 46/72] vsock/virtio: discard packets if the transport changes Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 47/72] vsock/virtio: cancel close work in the destructor Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 48/72] vsock: reset socket state when de-assigning the transport Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 49/72] vsock: prevent null-ptr-deref in vsock_*[has_data|has_space] Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 50/72] nouveau/fence: handle cross device fences properly Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 51/72] filemap: avoid truncating 64-bit offset to 32 bits Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 52/72] fs/proc: fix softlockup in __read_vmcore (part 2) Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 53/72] gpio: xilinx: Convert gpio_lock to raw spinlock Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 54/72] pmdomain: imx8mp-blk-ctrl: add missing loop break condition Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 55/72] irqchip: Plug a OF node reference leak in platform_irqchip_probe() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 56/72] irqchip/gic-v3: Handle CPU_PM_ENTER_FAILED correctly Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 57/72] irqchip/gic-v3-its: Dont enable interrupts in its_irq_set_vcpu_affinity() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 58/72] hrtimers: Handle CPU state correctly on hotplug Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 59/72] drm/i915/fb: Relax clear color alignment to 64 bytes Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 60/72] drm/amdgpu: always sync the GFX pipe on ctx switch Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 61/72] Revert "PCI: Use preserve_config in place of pci_flags" Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 62/72] iio: imu: inv_icm42600: fix spi burst write not supported Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 63/72] drm/amd/display: Fix out-of-bounds access in dcn21_link_encoder_create Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 64/72] block: fix uaf for flush rq while iterating tags Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 65/72] ocfs2: fix deadlock in ocfs2_get_system_file_inode Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 66/72] ovl: pass realinode to ovl_encode_real_fh() instead of realdentry Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 67/72] ovl: support encoding fid from inode with no alias Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 68/72] fs: relax assertions on failure to encode file handles Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 69/72] Revert "drm/amdgpu: rework resume handling for display (v2)" Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 70/72] nfsd: add list_head nf_gc to struct nfsd_file Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 71/72] x86/xen: fix SLS mitigation in xen_hypercall_iret() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 72/72] net: fix data-races around sk->sk_forward_alloc Greg Kroah-Hartman
2025-01-21 18:57 ` [PATCH 6.6 00/72] 6.6.74-rc1 review Florian Fainelli
2025-01-21 20:41 ` Peter Schneider
2025-01-21 23:35 ` Shuah Khan
2025-01-21 23:47 ` SeongJae Park
2025-01-22  9:25 ` Ron Economos
2025-01-22 12:06 ` Naresh Kamboju
2025-01-22 13:23 ` Jon Hunter
2025-01-22 14:41 ` Muhammad Usama Anjum
2025-01-22 17:04 ` Mark Brown
2025-01-22 20:18 ` [PATCH 6.6] " Hardik Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250121174525.044117629@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).