diff options
| author | Nate Karstens <nate.karstens@garmin.com> | 2025-11-06 16:28:33 -0600 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-11-07 18:17:16 -0800 |
| commit | 4da4e4bde1c453ac5cc2dce5def81d504ae257ee (patch) | |
| tree | 408de9f34e505667efa9b40d377c3b8779ef27b7 /net/unix/af_unix.c | |
| parent | 74d4432421a3e2669fbccc08c0f4fc2980bf0e39 (diff) | |
strparser: Fix signed/unsigned mismatch bug
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. On 32-bit systems, this can result in
an integer underflow for certain values because unsigned arithmetic
is being used.
This appears to be an oversight: if the intention was to use unsigned
arithmetic, then the first cast would have been omitted. The change
ensures both len values are cast to `ssize_t`.
The underflow causes an issue with ktls when multiple TLS PDUs are
included in a single TCP segment. The mainline kernel does not use
strparser for ktls anymore, but this is still useful for other
features that still use strparser, and for backporting.
Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
Cc: stable@vger.kernel.org
Fixes: 43a0c6751a32 ("strparser: Stream parser for messages")
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20251106222835.1871628-1-nate.karstens@garmin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
