From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
Cc: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Chris Blake
<chrisrblake93-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: 4.13 ib_mthca NULL pointer dereference with OpenSM
Date: Tue, 31 Oct 2017 07:11:04 +0200 [thread overview]
Message-ID: <20171031051104.GF16127@mtr-leonro.local> (raw)
In-Reply-To: <20171031042435.GB7961-uk2M96/98Pc@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
On Mon, Oct 30, 2017 at 10:24:35PM -0600, Jason Gunthorpe wrote:
> On Tue, Oct 31, 2017 at 03:16:42AM +0000, Parav Pandit wrote:
>
> > I am yet to review my below patch with Dan as he did most security
> > dev, but I suspect this might be the cause where rmpp list is not
> > initialized and mad processing is continued when security check
> > fails.
>
> This patch sure looks needed to me, ib_free_recv_mad touches
> rmpp_list, so if it needs initializion then it certainly has to be
> done earlier..
Right, it aligns with my analysis too.
>
> Adding the new return sure makes alot of sense as well..
>
> Hal, Ira, would you check this routine too? kernel oops's are bad..
>
> > diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
> > index f8f53bb..cb91245 100644
> > +++ b/drivers/infiniband/core/mad.c
> > @@ -1974,14 +1974,15 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
> > unsigned long flags;
> > int ret;
> >
> > + INIT_LIST_HEAD(&mad_recv_wc->rmpp_list);
> > ret = ib_mad_enforce_security(mad_agent_priv,
> > mad_recv_wc->wc->pkey_index);
> > if (ret) {
> > ib_free_recv_mad(mad_recv_wc);
> > deref_mad_agent(mad_agent_priv);
> > + return;
> > }
> >
> > - INIT_LIST_HEAD(&mad_recv_wc->rmpp_list);
> > list_add(&mad_recv_wc->recv_buf.list, &mad_recv_wc->rmpp_list);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-10-31 5:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 17:17 4.13 ib_mthca NULL pointer dereference with OpenSM Chris Blake
[not found] ` <CALpBJjoMLCqzVe5yKp4wCX-X-sH+=zv1QZfMvOWh2Ukh3c2LFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-29 19:11 ` Leon Romanovsky
[not found] ` <20171029191114.GO16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-29 19:35 ` Chris Blake
[not found] ` <CALpBJjoJpgR1QB-gzRJLOjGtjK4T2H4EbG1-R+ndodvznWkgwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-30 7:19 ` Leon Romanovsky
[not found] ` <20171030071956.GU16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-30 18:39 ` Chris Blake
[not found] ` <CALpBJjqWrXu3b12EG2-AWKwKs9v2q5pTf11rXSy04C-5dGta6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-30 19:00 ` Leon Romanovsky
2017-10-30 23:01 ` Jason Gunthorpe
[not found] ` <20171030230156.GA4081-uk2M96/98Pc@public.gmane.org>
2017-10-31 3:16 ` Parav Pandit
[not found] ` <VI1PR0502MB300860F7C004ABFB01079F53D15E0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-31 4:24 ` Jason Gunthorpe
[not found] ` <20171031042435.GB7961-uk2M96/98Pc@public.gmane.org>
2017-10-31 5:11 ` Leon Romanovsky [this message]
2017-10-31 12:49 ` Hal Rosenstock
[not found] ` <e2a2aa84-71ce-36f0-91af-0854b24d4a6a-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-31 15:01 ` Daniel Jurgens
[not found] ` <60de3bab-f294-dd11-bcae-d179115f7c31-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-31 15:09 ` Jason Gunthorpe
[not found] ` <20171031150901.GA9852-uk2M96/98Pc@public.gmane.org>
2017-10-31 15:12 ` Daniel Jurgens
2017-10-31 15:15 ` Leon Romanovsky
[not found] ` <20171031151521.GK16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-31 15:20 ` Chris Blake
2017-10-31 15:20 ` Daniel Jurgens
[not found] ` <5ab2d58d-8af8-c075-86f0-7010b8316cba-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-31 17:49 ` Chris Blake
[not found] ` <CALpBJjorS-AK3Ua9UuUnWv33rYqBoeAXF9vsFALTff5Qv3hNSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-31 17:58 ` Parav Pandit
2017-10-31 18:22 ` Daniel Jurgens
[not found] ` <fa1abfd0-e9fc-e842-8a21-c214e9dc8e9e-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-31 18:29 ` Chris Blake
[not found] ` <CALpBJjpPzeBMu1QGS8KOmv33A8CTJ2YjFhEhqaPBUpcVy+i3xg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-31 18:36 ` Chris Blake
2017-10-31 19:23 ` Jason Gunthorpe
[not found] ` <20171031192340.GA18578-uk2M96/98Pc@public.gmane.org>
2017-10-31 19:44 ` Daniel Jurgens
[not found] ` <799ce928-2e7c-7f60-951a-3a88544b7510-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-12 23:38 ` Chris Blake
[not found] ` <CALpBJjogf5ONOmMTr9Z8RQ_78aON=_zSSJ+K-_VQyRRXO6vkAQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-13 17:47 ` Daniel Jurgens
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=20171031051104.GF16127@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=chrisrblake93-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=jgg-uk2M96/98Pc@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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