]> git.openfabrics.org - ~shefty/librdmacm.git/commit
librdmacm: Work-around kernel bug returning uid = 0
authorSean Hefty <sean.hefty@intel.com>
Sat, 2 Feb 2013 01:17:34 +0000 (17:17 -0800)
committerSean Hefty <sean.hefty@intel.com>
Sat, 2 Feb 2013 01:17:34 +0000 (17:17 -0800)
commit371b692ceabacccb9b7313d89c50e79e4d7b9ed6
treecfa0e77e75c5916658adb6db2edde6e75c0adac2
parent75e5b5b17d8a478b4fad5d9ee700edb943b050ba
librdmacm: Work-around kernel bug returning uid = 0

Older kernels have a bug where it can report an event with the
uid set to 0.  The librdmacm crashes when casting the uid to
an rdma_cm_id and dereferencing the NULL pointer.

There are a limited number of events where this can occur and
in most cases it's safe to simply discard the event.  (This is
what the kernel does anyway.)  However, it's possible for us
to process an RDMA_CM_EVENT_ESTABLISHED event with the uid
set to 0.  (See kernel commit 418edaaba96e58112b15c82b4907084e2a9caf42.)

Although it's rare for this to occur, it does in fact happen
in practice.  To work-around the kernel bug, when the uid of an
established event is set to 0, we first try to locate the correct
user space id based on related data before discarding the event.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.c