public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* qib_lookup_qpn() appears to leak pointer out of rcu_read_unlock()
@ 2014-02-12  0:35 Paul E. McKenney
  2014-02-12 13:59 ` Marciniszyn, Mike
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2014-02-12  0:35 UTC (permalink / raw)
  To: roland, sean.hefty, hal.rosenstock; +Cc: linux-rdma, linux-kernel

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-12 21:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12  0:35 qib_lookup_qpn() appears to leak pointer out of rcu_read_unlock() Paul E. McKenney
2014-02-12 13:59 ` Marciniszyn, Mike
2014-02-12 14:55   ` Paul E. McKenney
2014-02-12 14:57     ` Marciniszyn, Mike
2014-02-12 21:50       ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox