From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Sean Hefty <sean.hefty@intel.com>,
Doug Ledford <dledford@redhat.com>,
Roland Dreier <roland@purestorage.com>
Subject: [14/44] IB/cm: Bump reference count on cm_id before invoking callback
Date: Mon, 21 Mar 2011 16:09:54 -0700 [thread overview]
Message-ID: <20110321231052.198549685@clark.kroah.org> (raw)
In-Reply-To: <20110321231105.GA1744@kroah.com>
2.6.32-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Sean Hefty <sean.hefty@intel.com>
commit 29963437a48475036353b95ab142bf199adb909e upstream.
When processing a SIDR REQ, the ib_cm allocates a new cm_id. The
refcount of the cm_id is initialized to 1. However, cm_process_work
will decrement the refcount after invoking all callbacks. The result
is that the cm_id will end up with refcount set to 0 by the end of the
sidr req handler.
If a user tries to destroy the cm_id, the destruction will proceed,
under the incorrect assumption that no other threads are referencing
the cm_id. This can lead to a crash when the cm callback thread tries
to access the cm_id.
This problem was noticed as part of a larger investigation with kernel
crashes in the rdma_cm when running on a real time OS.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/infiniband/core/cm.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -2986,6 +2986,7 @@ static int cm_sidr_req_handler(struct cm
goto out; /* No match. */
}
atomic_inc(&cur_cm_id_priv->refcount);
+ atomic_inc(&cm_id_priv->refcount);
spin_unlock_irq(&cm.lock);
cm_id_priv->id.cm_handler = cur_cm_id_priv->id.cm_handler;
next prev parent reply other threads:[~2011-03-22 0:00 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 23:11 [00/44] 2.6.32.34-longterm review Greg KH
2011-03-21 23:09 ` [01/44] hwmon/f71882fg: Set platform drvdata to NULL later Greg KH
2011-03-21 23:09 ` [02/44] mtd: jedec_probe: Change variable name from cfi_p to cfi Greg KH
2011-03-22 1:58 ` [Stable-review] " Ben Hutchings
2011-03-22 22:25 ` Greg KH
2011-03-21 23:09 ` [03/44] mtd: add "platform:" prefix for platform modalias Greg KH
2011-03-21 23:09 ` [04/44] libata: no special completion processing for EH commands Greg KH
2011-03-21 23:09 ` [05/44] MIPS: MTX-1: Make au1000_eth probe all PHY addresses Greg KH
2011-03-21 23:09 ` [06/44] x86/mm: Handle mm_fault_error() in kernel space Greg KH
2011-03-21 23:09 ` [07/44] ftrace: Fix memory leak with function graph and cpu hotplug Greg KH
2011-03-21 23:09 ` [08/44] x86: Fix panic when handling "mem={invalid}" param Greg KH
2011-03-21 23:09 ` [09/44] x86: Emit "mem=nopentium ignored" warning when not supported Greg KH
2011-03-21 23:09 ` [10/44] ahci: AHCI and RAID mode SATA patch for Intel Patsburg DeviceIDs Greg KH
2011-03-21 23:09 ` [11/44] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Greg KH
2011-03-21 23:09 ` [12/44] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Greg KH
2011-03-21 23:09 ` [13/44] RDMA/cma: Fix crash in request handlers Greg KH
2011-03-21 23:09 ` Greg KH [this message]
2011-03-21 23:09 ` [15/44] x86, quirk: Fix SB600 revision check Greg KH
2011-03-21 23:09 ` [16/44] ath9k_hw: Fix incorrect macversion and macrev checks Greg KH
2011-03-21 23:09 ` [17/44] USB: serial/kobil_sct, fix potential tty NULL dereference Greg KH
2011-03-21 23:09 ` [18/44] USB: serial: ch341: add new id Greg KH
2011-03-21 23:09 ` [19/44] xhci: Fix cycle bit calculation during stall handling Greg KH
2011-03-21 23:10 ` [20/44] ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs Greg KH
2011-03-21 23:10 ` [21/44] PCI: remove quirk for pre-production systems Greg KH
2011-03-21 23:10 ` [22/44] PCI: add more checking to ICH region quirks Greg KH
2011-03-21 23:10 ` [23/44] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Greg KH
2011-03-21 23:10 ` [24/44] PCI: sysfs: Fix failure path for addition of "vpd" attribute Greg KH
2011-03-21 23:10 ` [25/44] ALSA: ctxfi - Fix incorrect SPDIF status bit mask Greg KH
2011-03-21 23:10 ` [26/44] ALSA: ctxfi - Fix SPDIF status retrieval Greg KH
2011-03-21 23:10 ` [27/44] ALSA: ctxfi - Clear input settings before initialization Greg KH
2011-03-21 23:10 ` [28/44] SUNRPC: Ensure we always run the tk_callback before tk_action Greg KH
2011-03-21 23:10 ` [29/44] perf: Handle stopped state with tracepoints Greg KH
2011-03-21 23:10 ` [30/44] perf, powerpc: Handle events that raise an exception without overflowing Greg KH
2011-03-21 23:10 ` [31/44] ext3: Always set dx_nodes fake_dirent explicitly Greg KH
2011-03-21 23:10 ` [32/44] call_function_many: fix list delete vs add race Greg KH
2011-03-21 23:10 ` [33/44] call_function_many: add missing ordering Greg KH
2011-03-21 23:10 ` [34/44] x86: Flush TLB if PGD entry is changed in i386 PAE mode Greg KH
2011-03-21 23:10 ` [35/44] isdn: avoid calling tty_ldisc_flush() in atomic context Greg KH
2011-03-21 23:10 ` [36/44] smp_call_function_many: handle concurrent clearing of mask Greg KH
2011-03-21 23:10 ` [37/44] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Greg KH
2011-03-21 23:10 ` [38/44] i2c: Fix typo in instantiating-devices document Greg KH
2011-03-21 23:10 ` [39/44] mmc: sdio: remember new card RCA when redetecting card Greg KH
2011-03-21 23:10 ` [40/44] powerpc/kexec: Fix race in kexec shutdown Greg KH
2011-03-21 23:10 ` [41/44] powerpc/kdump: Fix race in kdump shutdown Greg KH
2011-03-21 23:10 ` [42/44] powerpc: rtas_flash needs to use rtas_data_buf Greg KH
2011-03-21 23:10 ` [43/44] x86, binutils, xen: Fix another wrong size directive Greg KH
2011-03-21 23:10 ` [44/44] hwmon: (sht15) Fix integer overflow in humidity calculation Greg KH
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=20110321231052.198549685@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@purestorage.com \
--cc=sean.hefty@intel.com \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®