stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] strparser: Fix signed/unsigned mismatch bug
@ 2025-11-04 17:42 Nate Karstens
  2025-11-04 23:28 ` Sabrina Dubroca
  2025-11-05 17:34 ` Nate Karstens
  0 siblings, 2 replies; 10+ messages in thread
From: Nate Karstens @ 2025-11-04 17:42 UTC (permalink / raw)
  To: netdev
  Cc: Nate Karstens, Nate Karstens, Tom Herbert, stable,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, John Fastabend, Dr. David Alan Gilbert,
	Jiayuan Chen, linux-kernel

The `len` member of the sk_buff is an unsigned int. This is cast to
`ssize_t` (a signed type) for the first sk_buff in the comparison,
but not the second sk_buff. This change ensures both len values are
cast to `ssize_t`.

This appears to cause an issue with ktls when multiple TLS PDUs are
included in a single TCP segment.

Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
Cc: stable@vger.kernel.org
---
 net/strparser/strparser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index 43b1f558b33d..e659fea2da70 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -238,7 +238,7 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
 				strp_parser_err(strp, -EMSGSIZE, desc);
 				break;
 			} else if (len <= (ssize_t)head->len -
-					  skb->len - stm->strp.offset) {
+					  (ssize_t)skb->len - stm->strp.offset) {
 				/* Length must be into new skb (and also
 				 * greater than zero)
 				 */
-- 
2.34.1


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

end of thread, other threads:[~2025-11-06 22:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-04 17:42 [PATCH] strparser: Fix signed/unsigned mismatch bug Nate Karstens
2025-11-04 23:28 ` Sabrina Dubroca
2025-11-05 17:34 ` Nate Karstens
2025-11-05 22:29   ` Jacob Keller
2025-11-05 23:12     ` Nate Karstens
2025-11-05 23:47       ` Jacob Keller
2025-11-06 15:22         ` Sabrina Dubroca
2025-11-06 16:36           ` Nate Karstens
2025-11-06 16:51             ` [PATCH net v2] " Nate Karstens
2025-11-06 22:22               ` Jakub Kicinski

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).