security: tf_driver: restore current task flags
Chris Johnson [Tue, 14 Aug 2012 23:12:16 +0000 (16:12 -0700)]
In K3.1, this code was setting PF_FREEZER_NOSIG, which meant
freeze_task would signal this thread to TIF_FREEZE later.

In K3.4, PF_FREEZER_NOSIG was removed and the code ported to
toggle PF_KTHREAD instead. But, in the port we missed restoring
the previous task value (leaving PF_KTHREAD still set).

Bug 988873

Change-Id: I1071ea33c08c64288162cd628977081a422c716f
Signed-off-by: Chris Johnson <cwj@nvidia.com>
Reviewed-on: http://git-master/r/123535
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Karan Jhavar <kjhavar@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

security/tf_driver/tf_comm.c

index c401cf8..b3d58e2 100644 (file)
@@ -1405,6 +1405,11 @@ exit:
                wait_prepared = false;
        }
 
+#ifdef CONFIG_FREEZER
+       current->flags &= ~(PF_KTHREAD);
+       current->flags |= (saved_flags & PF_KTHREAD);
+#endif
+
        return result;
 }