diff options
| author | Jakub Kicinski <[email protected]> | 2022-08-16 00:23:58 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-08-17 09:24:00 +0000 |
| commit | 849f16bbfb686cf75e67c536d196027fa8bfc803 (patch) | |
| tree | 98212abda746a9872c28fea516c0c8c3b85bccb9 | |
| parent | net: sched: fix misuse of qcpu->backlog in gnet_stats_add_queue_cpu (diff) | |
| download | kernel-849f16bbfb686cf75e67c536d196027fa8bfc803.tar.gz kernel-849f16bbfb686cf75e67c536d196027fa8bfc803.zip | |
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: 84c61fe1a75b ("tls: rx: do not use the standard strparser")
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
| -rw-r--r-- | net/tls/tls_sw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index f76119f62f1b..fe27241cd13f 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2702,7 +2702,9 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) crypto_info->version != TLS_1_3_VERSION && !!(tfm->__crt_alg->cra_flags & CRYPTO_ALG_ASYNC); - tls_strp_init(&sw_ctx_rx->strp, sk); + rc = tls_strp_init(&sw_ctx_rx->strp, sk); + if (rc) + goto free_aead; } goto out; |
