Skip to content

Commit dbe0e18

Browse files
author
Sabrina Dubroca
committed
tls: rx: react to strparser initialization errors
Tested: selftests Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2143700 commit 849f16b Author: Jakub Kicinski <[email protected]> Date: Mon Aug 15 17:23:58 2022 -0700 tls: rx: react to strparser initialization errors Even though the normal strparser's init function has a return value we got away with ignoring errors until now, as it only validates the parameters and we were passing correct parameters. tls_strp can fail to init on memory allocation errors, which syzbot duly induced and reported. Reported-by: [email protected] Fixes: 84c61fe ("tls: rx: do not use the standard strparser") Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sabrina Dubroca <[email protected]>
1 parent aeb26d9 commit dbe0e18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/tls/tls_sw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,9 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx)
27072707
crypto_info->version != TLS_1_3_VERSION &&
27082708
!!(tfm->__crt_alg->cra_flags & CRYPTO_ALG_ASYNC);
27092709

2710-
tls_strp_init(&sw_ctx_rx->strp, sk);
2710+
rc = tls_strp_init(&sw_ctx_rx->strp, sk);
2711+
if (rc)
2712+
goto free_aead;
27112713
}
27122714

27132715
goto out;

0 commit comments

Comments
 (0)