diff options
author | Md Haris Iqbal <haris.iqbal@ionos.com> | 2021-09-22 14:53:32 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-10-04 16:46:12 -0300 |
commit | dea7bb3ad3e08f96815330f88a62c24d7a9dacae (patch) | |
tree | b81a62b78e19c86c0a8a5acdd910d72e0cc80720 /drivers/infiniband/ulp/rtrs/rtrs-clt.c | |
parent | 6f5649afd3984e35c4b862a05c4511c6d18b27af (diff) | |
download | lwn-dea7bb3ad3e08f96815330f88a62c24d7a9dacae.tar.gz lwn-dea7bb3ad3e08f96815330f88a62c24d7a9dacae.zip |
RDMA/rtrs: Do not allow sessname to contain special symbols / and .
Allowing these characters in sessname can lead to unexpected results,
particularly because / is used as a separator between files in a path, and
. points to the current directory.
Link: https://lore.kernel.org/r/20210922125333.351454-7-haris.iqbal@ionos.com
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Reviewed-by: Gioh Kim <gi-oh.kim@ionos.com>
Reviewed-by: Aleksei Marov <aleksei.marov@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/ulp/rtrs/rtrs-clt.c')
-rw-r--r-- | drivers/infiniband/ulp/rtrs/rtrs-clt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index bc8824b4ee0d..15c0077dd27e 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -2788,6 +2788,12 @@ struct rtrs_clt *rtrs_clt_open(struct rtrs_clt_ops *ops, struct rtrs_clt *clt; int err, i; + if (strchr(sessname, '/') || strchr(sessname, '.')) { + pr_err("sessname cannot contain / and .\n"); + err = -EINVAL; + goto out; + } + clt = alloc_clt(sessname, paths_num, port, pdu_sz, ops->priv, ops->link_ev, reconnect_delay_sec, |