From: Milan Broz <mbroz@redhat.com> Date: Fri, 14 Nov 2008 01:30:13 +0100 Subject: [md] dm-mpath: NULL ptr access in path activation code Message-id: 491CC695.7050504@redhat.com O-Subject: [RHEL 5.3 PATCH] dm-mpath: NULL pointer access in path activation cod Bugzilla: 471393 RH-Acked-by: Alasdair G Kergon <agk@redhat.com> RH-Acked-by: Mikulas Patocka <mpatocka@redhat.com> RH-Acked-by: Jonathan Brassow <jbrassow@redhat.com> RHEL5.3 kernel dm-mpath: NULL pointer access in path activation code Resolves: rhbz#471393 Patch is in mm tree, queued for 2.6.28-rc5 Path activation code is called even when the pgpath is NULL. This could lead to a panic in activate_path(). Such a panic is seen in -rt kernel. Patch provided and tested by customer. Also test build and basic testing passed. diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index f09d272..54d7d8e 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -431,13 +431,13 @@ static void process_queued_ios(void *data) __choose_pgpath(m); pgpath = m->current_pgpath; - m->pgpath_to_activate = m->current_pgpath; if ((pgpath && !m->queue_io) || (!pgpath && !m->queue_if_no_path)) must_queue = 0; - if (m->pg_init_required && !m->pg_init_in_progress) { + if (m->pg_init_required && !m->pg_init_in_progress && pgpath) { + m->pgpath_to_activate = pgpath; m->pg_init_count++; m->pg_init_required = 0; m->pg_init_in_progress = 1;