Skip to content

Commit 849f16b

Browse files
kuba-moodavem330
authored andcommitted
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]>
1 parent de64b6b commit 849f16b

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
@@ -2702,7 +2702,9 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx)
27022702
crypto_info->version != TLS_1_3_VERSION &&
27032703
!!(tfm->__crt_alg->cra_flags & CRYPTO_ALG_ASYNC);
27042704

2705-
tls_strp_init(&sw_ctx_rx->strp, sk);
2705+
rc = tls_strp_init(&sw_ctx_rx->strp, sk);
2706+
if (rc)
2707+
goto free_aead;
27062708
}
27072709

27082710
goto out;

0 commit comments

Comments
 (0)