From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Gal Pressman <galpress@amazon.com>,
Jason Gunthorpe <jgg@mellanox.com>,
Sasha Levin <sashal@kernel.org>,
linux-rdma@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 051/371] RDMA/ocrdma: Fix out of bounds index check in query pkey
Date: Thu, 16 Jan 2020 12:11:59 -0500 [thread overview]
Message-ID: <20200116171719.16965-51-sashal@kernel.org> (raw)
In-Reply-To: <20200116171719.16965-1-sashal@kernel.org>
From: Gal Pressman <galpress@amazon.com>
[ Upstream commit b188940796c7be31c1b8c25a9a0e0842c2e7a49e ]
The pkey table size is one element, index should be tested for > 0 instead
of > 1.
Fixes: fe2caefcdf58 ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter")
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 27d5e8d9f08d..7683d13dad3d 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -55,7 +55,7 @@
int ocrdma_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
{
- if (index > 1)
+ if (index > 0)
return -EINVAL;
*pkey = 0xffff;
--
2.20.1
next prev parent reply other threads:[~2020-01-16 17:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200116171719.16965-1-sashal@kernel.org>
2020-01-16 17:11 ` [PATCH AUTOSEL 4.14 007/371] IB/rxe: replace kvfree with vfree Sasha Levin
2020-01-16 17:11 ` [PATCH AUTOSEL 4.14 008/371] IB/hfi1: Add mtu check for operational data VLs Sasha Levin
2020-01-16 17:11 ` [PATCH AUTOSEL 4.14 021/371] IB/rxe: Fix incorrect cache cleanup in error flow Sasha Levin
2020-01-16 17:11 ` [PATCH AUTOSEL 4.14 050/371] IB/usnic: Fix out of bounds index check in query pkey Sasha Levin
2020-01-16 17:11 ` Sasha Levin [this message]
2020-01-16 17:12 ` [PATCH AUTOSEL 4.14 052/371] RDMA/qedr: " Sasha Levin
2020-01-16 17:12 ` [PATCH AUTOSEL 4.14 056/371] RDMA/iw_cxgb4: Fix the unchecked ep dereference Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200116171719.16965-51-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=galpress@amazon.com \
--cc=jgg@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).