Whamcloud - gitweb
LU-4629 osd-ldiskfs: Fix use after free 09/10609/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 5 Jun 2014 16:50:36 +0000 (20:50 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Jun 2014 02:59:10 +0000 (02:59 +0000)
Object 'dir' was dereferenced at line 3343 after being freed
by calling 'kfree' at line 3332.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Id8d216868798622f12773b621acf46e81988b954
Reviewed-on: http://review.whamcloud.com/10609
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/osd-ldiskfs/osd_handler.c

index 469a83d..a3dff28 100644 (file)
@@ -3340,7 +3340,8 @@ static int osd_index_try(const struct lu_env *env, struct dt_object *dt,
                         * recheck under lock.
                         */
                        if (!osd_has_index(obj))
                         * recheck under lock.
                         */
                        if (!osd_has_index(obj))
-                               result = osd_iam_container_init(env, obj, dir);
+                               result = osd_iam_container_init(env, obj,
+                                                               obj->oo_dir);
                        else
                                result = 0;
                        up_write(&obj->oo_ext_idx_sem);
                        else
                                result = 0;
                        up_write(&obj->oo_ext_idx_sem);