]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: raid10: Fix null pointer dereference in fix_read_error()
authorPrasanna S. Panchamukhi <prasanna.panchamukhi@riverbed.com>
Thu, 24 Jun 2010 03:31:03 +0000 (13:31 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:29:42 +0000 (10:29 -0700)
commitf4795406efcf49765ed02d8a5c2d366d353da017
tree1521d9aac4f5d59efd1f511da7959073ad82eeb6
parent63ec731a4dcb77487b1caedf9b3a8d295c3f1ad7
md: raid10: Fix null pointer dereference in fix_read_error()

commit 0544a21db02c1d8883158fd6f323364f830a120a upstream.

Such NULL pointer dereference can occur when the driver was fixing the
read errors/bad blocks and the disk was physically removed
causing a system crash. This patch check if the
rcu_dereference() returns valid rdev before accessing it in fix_read_error().

Signed-off-by: Prasanna S. Panchamukhi <prasanna.panchamukhi@riverbed.com>
Signed-off-by: Rob Becker <rbecker@riverbed.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/raid10.c