From: Jason Gunthorpe <jgg@ziepe.ca>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] RDMA/uverbs: check for allocation failure in uapi_add_elm()
Date: Thu, 30 May 2019 18:47:09 +0000 [thread overview]
Message-ID: <20190530184709.GA982@ziepe.ca> (raw)
In-Reply-To: <20190530082024.GA11836@mwanda>
On Thu, May 30, 2019 at 11:20:24AM +0300, Dan Carpenter wrote:
> If the kzalloc() fails then we should return ERR_PTR(-ENOMEM). In the
> current code it's possible that the kzalloc() fails and the
> radix_tree_insert() inserts the NULL pointer successfully and we return
> the NULL "elm" pointer to the caller. That results in a NULL pointer
> dereference.
>
> Fixes: 9ed3e5f44772 ("IB/uverbs: Build the specs into a radix tree at runtime")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/infiniband/core/uverbs_uapi.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied to for-next, thanks
Jason
prev parent reply other threads:[~2019-05-30 18:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 8:20 [PATCH] RDMA/uverbs: check for allocation failure in uapi_add_elm() Dan Carpenter
2019-05-30 18:47 ` 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=20190530184709.GA982@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.