All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mptcp: fix possible integer overflow in mptcp_reset_tout_timer
@ 2024-11-07 10:36 Dmitry Kandybka
  2024-11-07 11:51 ` MPTCP CI
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Dmitry Kandybka @ 2024-11-07 10:36 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: mptcp, netdev, lvc-project, Dmitry Antipov, Dmitry Kandybka

In 'mptcp_reset_tout_timer', promote 'probe_timestamp' to unsigned long
to avoid possible integer overflow. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com>
---
 net/mptcp/protocol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index e978e05ec8d1..ff2b8a2bfe18 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2722,8 +2722,8 @@ void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout)
 	if (!fail_tout && !inet_csk(sk)->icsk_mtup.probe_timestamp)
 		return;
 
-	close_timeout = inet_csk(sk)->icsk_mtup.probe_timestamp - tcp_jiffies32 + jiffies +
-			mptcp_close_timeout(sk);
+	close_timeout = (unsigned long)inet_csk(sk)->icsk_mtup.probe_timestamp -
+			tcp_jiffies32 + jiffies + mptcp_close_timeout(sk);
 
 	/* the close timeout takes precedence on the fail one, and here at least one of
 	 * them is active
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-13  5:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 10:36 [PATCH] mptcp: fix possible integer overflow in mptcp_reset_tout_timer Dmitry Kandybka
2024-11-07 11:51 ` MPTCP CI
2024-11-08 11:43 ` Matthieu Baerts
2024-11-08 21:42   ` Fedor Pchelkin
2024-11-12 11:55 ` Paolo Abeni
2024-11-13  5:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.