public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Bernard Metzler <bmt@zurich.ibm.com>
Cc: linux-rdma@vger.kernel.org, leonro@nvidia.com,
	Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] RDMA/siw: Set defined status for work completion with undefined status
Date: Tue, 15 Nov 2022 16:52:15 -0400	[thread overview]
Message-ID: <Y3P7//cTbZXXMMA+@nvidia.com> (raw)
In-Reply-To: <20221115170747.1263298-1-bmt@zurich.ibm.com>

On Tue, Nov 15, 2022 at 06:07:47PM +0100, Bernard Metzler wrote:
> A malicious user may write undefined values into memory mapped completion
> queue elements status or opcode. Undefined status or opcode values will
> result in out-of-bounds access to an array mapping siw internal
> representation of opcode and status to RDMA core representation when
> reaping CQ elements. While siw detects those undefined values,
> it did not correctly set completion status to a defined value, thus
> defeating the whole purpose of the check.
> 
> This bug leads to the following Smatch static checker warning:
> 
> 	drivers/infiniband/sw/siw/siw_cq.c:96 siw_reap_cqe()
> 	error: buffer overflow 'map_cqe_status' 10 <= 21
> 
> Fixes: bdf1da5df9da: ("RDMA/siw: Fix immediate work request flush to completion queue")
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
> ---
>  drivers/infiniband/sw/siw/siw_cq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-next, thanks

Jason

      reply	other threads:[~2022-11-15 20:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 17:07 [PATCH] RDMA/siw: Set defined status for work completion with undefined status Bernard Metzler
2022-11-15 20:52 ` Jason Gunthorpe [this message]

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=Y3P7//cTbZXXMMA+@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bmt@zurich.ibm.com \
    --cc=error27@gmail.com \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@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