summaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_nl.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2015-02-25 13:53:28 +0100
committerJens Axboe <axboe@fb.com>2015-11-25 09:22:01 -0700
commit2b479766ee79a821f3cd7fad92fbcf2ff16cacb3 (patch)
tree55b95aa5f7bcb8bc4066ee8704490d80bcfda093 /drivers/block/drbd/drbd_nl.c
parent84d34f2f0724f26de04f9863704a7ca797c0fd62 (diff)
drbd: fix NULL deref in remember_new_state
The recent (not yet released) backport of the extended state broadcasts to support the "events2" subcommand of drbdsetup had some glitches. remember_old_state() would first count all connections with a net_conf != NULL, then allocate a suitable array, then populate that array with all connections found to have net_conf != NULL. This races with the state change to C_STANDALONE, and the NULL assignment there. remember_new_state() then iterates over said connection array, assuming that it would be fully populated. But rcu_lock() just makes sure the thing some pointer points to, if any, won't go away. It does not make the pointer itself immutable. In fact there is no need to "filter" connections based on whether or not they have a currently valid configuration. Just record them always, if they don't have a config, that's fine, there will be no change then. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
0 files changed, 0 insertions, 0 deletions