public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Silas Boyd-Wickizer <sbw@mit.edu>
To: linux-kernel@vger.kernel.org
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH 0/3] Use get_online_cpus to avoid races involving for_each_online_cpu
Date: Thu, 2 Aug 2012 17:03:45 -0700	[thread overview]
Message-ID: <20120803000344.GA3443@mit.edu> (raw)

Hello,

I've found 4 races involving for_each_online_cpu that could have ill
effects.  All 4 occur in code that can be compiled as modules, but
which is probably usually linked statically.  All 4 occur during
module init and/or exit.  I've written patches for 3 of the 4, and
will describe the 4th race in separate e-mail.

I've been checking the usages of for_each_online_cpu for the
possibility of races with offlining and onlining CPUs.  I used
libsparse and kernel source annotations to check that code uses
for_each_online_cpu in contexts with hotplug disabled
(e.g. get_online_cpus(), preempt_disable, ..).  I compiled with an
x86 64-bit allyesconfig and weeded out false positives (e.g. careful
use of CPU notifiers) by hand.

I've identified about 40 races, but only 4 that seem to have
unintentional and potentially harmful effects.

Here is a link to my checker code, which isn't fit for inclusion in
anything:

  http://pdos.csail.mit.edu/~sbw/online-checker/

Silas

                 reply	other threads:[~2012-08-03  0:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20120803000344.GA3443@mit.edu \
    --to=sbw@mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /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