From: "Paul E. McKenney" <paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: qib_lookup_qpn() appears to leak pointer out of rcu_read_unlock()
Date: Tue, 11 Feb 2014 16:35:11 -0800 [thread overview]
Message-ID: <20140212003511.GA27242@linux.vnet.ibm.com> (raw)
Hello!
The qib_lookup_qpn() function does RCU pointer traversals within RCU
read-side critical sections as required, but the qp pointer is returned
from this function after it does rcu_read_unlock(). One of the callers,
qib_rcv_hdrerr(), dereferences this pointer upon return.
This appears to me to be a bug. From what I can see, the structure
pointed to by qp could be freed immediately after the rcu_read_unlock(),
which would result in a SEGV when qib_rcv_hdrerr() does its later
spin_lock(&qp->r_lock).
So what am I missing here?
Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: qib_lookup_qpn() appears to leak pointer out of rcu_read_unlock()
Date: Tue, 11 Feb 2014 16:35:11 -0800 [thread overview]
Message-ID: <20140212003511.GA27242@linux.vnet.ibm.com> (raw)
Hello!
The qib_lookup_qpn() function does RCU pointer traversals within RCU
read-side critical sections as required, but the qp pointer is returned
from this function after it does rcu_read_unlock(). One of the callers,
qib_rcv_hdrerr(), dereferences this pointer upon return.
This appears to me to be a bug. From what I can see, the structure
pointed to by qp could be freed immediately after the rcu_read_unlock(),
which would result in a SEGV when qib_rcv_hdrerr() does its later
spin_lock(&qp->r_lock).
So what am I missing here?
Thanx, Paul
next reply other threads:[~2014-02-12 0:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 0:35 Paul E. McKenney [this message]
2014-02-12 0:35 ` qib_lookup_qpn() appears to leak pointer out of rcu_read_unlock() Paul E. McKenney
[not found] ` <20140212003511.GA27242-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-02-12 13:59 ` Marciniszyn, Mike
2014-02-12 13:59 ` Marciniszyn, Mike
[not found] ` <32E1700B9017364D9B60AED9960492BC211F3D24-AtyAts71sc9zLByeVOV5+bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-02-12 14:55 ` Paul E. McKenney
2014-02-12 14:55 ` Paul E. McKenney
[not found] ` <20140212145543.GY4250-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-02-12 14:57 ` Marciniszyn, Mike
2014-02-12 14:57 ` Marciniszyn, Mike
[not found] ` <32E1700B9017364D9B60AED9960492BC211F3D75-AtyAts71sc9zLByeVOV5+bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-02-12 21:50 ` Paul E. McKenney
2014-02-12 21:50 ` Paul E. McKenney
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=20140212003511.GA27242@linux.vnet.ibm.com \
--to=paulmck-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@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 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.