summaryrefslogtreecommitdiff
path: root/net/smc/af_smc.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-02-21 09:26:22 -0800
committerJakub Kicinski <kuba@kernel.org>2023-02-21 09:29:25 -0800
commitd1fabc68f8e0541d41657096dc713cb01775652d (patch)
treea1c98028683fb61feafedf7c9b2b6fad7c13db5f /net/smc/af_smc.c
parent4d4266e3fd321fadb628ce02de641b129522c39c (diff)
parentf922c7b1c1c45740d329bf248936fdb78c0cff6e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Per-next-PR merge. net/smc/af_smc.c b5dd4d698171 ("net/smc: llc_conf_mutex refactor, replace it with rw_semaphore") e40b801b3603 ("net/smc: fix potential panic dues to unprotected smc_llc_srv_add_link()") https://lore.kernel.org/all/20230221124008.6303c330@canb.auug.org.au/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/smc/af_smc.c')
-rw-r--r--net/smc/af_smc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index d7a7420e81ec..a4cccdfdc00a 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1839,8 +1839,10 @@ static int smcr_serv_conf_first_link(struct smc_sock *smc)
smc_llc_link_active(link);
smcr_lgr_set_type(link->lgr, SMC_LGR_SINGLE);
+ down_write(&link->lgr->llc_conf_mutex);
/* initial contact - try to establish second link */
smc_llc_srv_add_link(link, NULL);
+ up_write(&link->lgr->llc_conf_mutex);
return 0;
}