diff options
| author | Coly Li <[email protected]> | 2017-10-13 16:35:29 -0700 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2017-10-16 09:07:26 -0600 |
| commit | 91af8300d9c1d7c6b6a2fd754109e08d4798b8d8 (patch) | |
| tree | f5bf8c2ad9357e5e86de16cb63c00a647eafdd2e /tools/perf/scripts/python/event_analyzing_sample.py | |
| parent | 58f913dce2814a9ea7260e93ed3a949e0d5565e3 (diff) | |
bcache: check ca->alloc_thread initialized before wake up it
In bcache code, sysfs entries are created before all resources get
allocated, e.g. allocation thread of a cache set.
There is posibility for NULL pointer deference if a resource is accessed
but which is not initialized yet. Indeed Jorg Bornschein catches one on
cache set allocation thread and gets a kernel oops.
The reason for this bug is, when bch_bucket_alloc() is called during
cache set registration and attaching, ca->alloc_thread is not properly
allocated and initialized yet, call wake_up_process() on ca->alloc_thread
triggers NULL pointer deference failure. A simple and fast fix is, before
waking up ca->alloc_thread, checking whether it is allocated, and only
wake up ca->alloc_thread when it is not NULL.
Signed-off-by: Coly Li <[email protected]>
Reported-by: Jorg Bornschein <[email protected]>
Cc: Kent Overstreet <[email protected]>
Cc: [email protected]
Reviewed-by: Michael Lyle <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions