Index: linux-2.6.11-rsbac-v1.2.4/fs/exec.c
===================================================================
--- linux-2.6.11-rsbac-v1.2.4/fs/exec.c	(Revision 383)
+++ linux-2.6.11-rsbac-v1.2.4/fs/exec.c	(Revision 384)
@@ -1211,6 +1211,7 @@
         union rsbac_target_id_t       rsbac_target_id;
         union rsbac_target_id_t       rsbac_new_target_id;
         union rsbac_attribute_value_t rsbac_attribute_value;
+        int rsbac_has_file_ref = 0;
         #endif
 
 	retval = -ENOMEM;
@@ -1277,6 +1278,9 @@
             retval = -EPERM;
             goto out;
           }
+
+        get_file(file);
+        rsbac_has_file_ref = 1;
         #endif
 
 	retval = prepare_binprm(bprm);
@@ -1325,6 +1329,9 @@
                     printk(KERN_WARNING
                            "do_execve() [sys_execve]: rsbac_adf_set_attr() returned error\n");
                   }
+
+                if (rsbac_has_file_ref)
+                        fput(file);
                 #endif
 
 		kfree(bprm);
@@ -1356,6 +1363,11 @@
 	kfree(bprm);
 
 out_ret:
+        #ifdef CONFIG_RSBAC
+        if (rsbac_has_file_ref)
+                fput(file);
+        #endif
+
 	return retval;
 }
 
