* [PATCH net 0/3] net/smc: fixes 2020-10-23
@ 2020-10-23 18:48 Karsten Graul
2020-10-23 18:48 ` [PATCH net 1/3] net/smc: fix null pointer dereference in smc_listen_decline() Karsten Graul
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Karsten Graul @ 2020-10-23 18:48 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
Please apply the following patch series for smc to netdev's net tree.
Patch 1 fixes a potential null pointer dereference. Patch 2 takes care
of a suppressed return code and patch 3 corrects the system EID in the
ISM driver.
Karsten Graul (3):
net/smc: fix null pointer dereference in smc_listen_decline()
net/smc: fix suppressed return code
s390/ism: fix incorrect system EID
drivers/s390/net/ism_drv.c | 2 +-
net/smc/af_smc.c | 7 ++++---
net/smc/smc_core.c | 7 +++++--
3 files changed, 10 insertions(+), 6 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net 1/3] net/smc: fix null pointer dereference in smc_listen_decline()
2020-10-23 18:48 [PATCH net 0/3] net/smc: fixes 2020-10-23 Karsten Graul
@ 2020-10-23 18:48 ` Karsten Graul
2020-10-23 18:48 ` [PATCH net 2/3] net/smc: fix suppressed return code Karsten Graul
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Karsten Graul @ 2020-10-23 18:48 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
smc_listen_work() calls smc_listen_decline() on label out_decl,
providing the ini pointer variable. But this pointer can still be null
when the label out_decl is reached.
Fix this by checking the ini variable in smc_listen_work() and call
smc_listen_decline() with the result directly.
Fixes: a7c9c5f4af7f ("net/smc: CLC accept / confirm V2")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
net/smc/af_smc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 82be0bd0f6e8..e9f487c8c6d5 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1317,10 +1317,10 @@ static void smc_listen_out_err(struct smc_sock *new_smc)
/* listen worker: decline and fall back if possible */
static void smc_listen_decline(struct smc_sock *new_smc, int reason_code,
- struct smc_init_info *ini, u8 version)
+ int local_first, u8 version)
{
/* RDMA setup failed, switch back to TCP */
- if (ini->first_contact_local)
+ if (local_first)
smc_lgr_cleanup_early(&new_smc->conn);
else
smc_conn_free(&new_smc->conn);
@@ -1768,7 +1768,8 @@ static void smc_listen_work(struct work_struct *work)
out_unlock:
mutex_unlock(&smc_server_lgr_pending);
out_decl:
- smc_listen_decline(new_smc, rc, ini, version);
+ smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0,
+ version);
out_free:
kfree(ini);
kfree(buf);
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/3] net/smc: fix suppressed return code
2020-10-23 18:48 [PATCH net 0/3] net/smc: fixes 2020-10-23 Karsten Graul
2020-10-23 18:48 ` [PATCH net 1/3] net/smc: fix null pointer dereference in smc_listen_decline() Karsten Graul
@ 2020-10-23 18:48 ` Karsten Graul
2020-10-23 18:48 ` [PATCH net 3/3] s390/ism: fix incorrect system EID Karsten Graul
2020-10-26 23:39 ` [PATCH net 0/3] net/smc: fixes 2020-10-23 Jakub Kicinski
3 siblings, 0 replies; 5+ messages in thread
From: Karsten Graul @ 2020-10-23 18:48 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
The patch that repaired the invalid return code in smcd_new_buf_create()
missed to take care of errno ENOSPC which has a special meaning that no
more DMBEs can be registered on the device. Fix that by keeping this
errno value during the translation of the return code.
Fixes: 6b1bbf94ab36 ("net/smc: fix invalid return code in smcd_new_buf_create()")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
net/smc/smc_core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index d790c43c473f..2b19863f7171 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1615,8 +1615,11 @@ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr,
rc = smc_ism_register_dmb(lgr, bufsize, buf_desc);
if (rc) {
kfree(buf_desc);
- return (rc == -ENOMEM) ? ERR_PTR(-EAGAIN) :
- ERR_PTR(-EIO);
+ if (rc == -ENOMEM)
+ return ERR_PTR(-EAGAIN);
+ if (rc == -ENOSPC)
+ return ERR_PTR(-ENOSPC);
+ return ERR_PTR(-EIO);
}
buf_desc->pages = virt_to_page(buf_desc->cpu_addr);
/* CDC header stored in buf. So, pretend it was smaller */
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 3/3] s390/ism: fix incorrect system EID
2020-10-23 18:48 [PATCH net 0/3] net/smc: fixes 2020-10-23 Karsten Graul
2020-10-23 18:48 ` [PATCH net 1/3] net/smc: fix null pointer dereference in smc_listen_decline() Karsten Graul
2020-10-23 18:48 ` [PATCH net 2/3] net/smc: fix suppressed return code Karsten Graul
@ 2020-10-23 18:48 ` Karsten Graul
2020-10-26 23:39 ` [PATCH net 0/3] net/smc: fixes 2020-10-23 Jakub Kicinski
3 siblings, 0 replies; 5+ messages in thread
From: Karsten Graul @ 2020-10-23 18:48 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
The system EID that is defined by the ISM driver is not correct. Using
an incorrect system EID allows to communicate with remote Linux systems
that use the same incorrect system EID, but when it comes to
interoperability with other operating systems then the system EIDs do
never match which prevents SMC-Dv2 communication.
Using the correct system EID fixes this problem.
Fixes: 201091ebb2a1 ("net/smc: introduce System Enterprise ID (SEID)")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
drivers/s390/net/ism_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c
index fe96ca3c88a5..26cc943d2034 100644
--- a/drivers/s390/net/ism_drv.c
+++ b/drivers/s390/net/ism_drv.c
@@ -390,7 +390,7 @@ static int ism_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
}
static struct ism_systemeid SYSTEM_EID = {
- .seid_string = "IBM-SYSZ-IBMSEID00000000",
+ .seid_string = "IBM-SYSZ-ISMSEID00000000",
.serial_number = "0000",
.type = "0000",
};
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/3] net/smc: fixes 2020-10-23
2020-10-23 18:48 [PATCH net 0/3] net/smc: fixes 2020-10-23 Karsten Graul
` (2 preceding siblings ...)
2020-10-23 18:48 ` [PATCH net 3/3] s390/ism: fix incorrect system EID Karsten Graul
@ 2020-10-26 23:39 ` Jakub Kicinski
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2020-10-26 23:39 UTC (permalink / raw)
To: Karsten Graul; +Cc: davem, netdev, linux-s390, heiko.carstens, raspl, ubraun
On Fri, 23 Oct 2020 20:48:27 +0200 Karsten Graul wrote:
> Please apply the following patch series for smc to netdev's net tree.
>
> Patch 1 fixes a potential null pointer dereference. Patch 2 takes care
> of a suppressed return code and patch 3 corrects the system EID in the
> ISM driver.
Applied, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-10-26 23:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-23 18:48 [PATCH net 0/3] net/smc: fixes 2020-10-23 Karsten Graul
2020-10-23 18:48 ` [PATCH net 1/3] net/smc: fix null pointer dereference in smc_listen_decline() Karsten Graul
2020-10-23 18:48 ` [PATCH net 2/3] net/smc: fix suppressed return code Karsten Graul
2020-10-23 18:48 ` [PATCH net 3/3] s390/ism: fix incorrect system EID Karsten Graul
2020-10-26 23:39 ` [PATCH net 0/3] net/smc: fixes 2020-10-23 Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).