summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-12-07 15:49:22 +0100
committerBen Hutchings <ben@decadent.org.uk>2013-01-03 03:32:42 +0000
commitfbc174a67597c55c5682edf74379ca5e55ff0e99 (patch)
tree178674bd96b9e6e689c2f4b009497a828f97503f
parentb17d8aeb433dcf5f2ff6d3ea5e1cc04375cea00f (diff)
freezer: PF_FREEZER_NOSIG should be cleared along with PF_NOFREEZE
This patch is only for pre-v3.3 stable trees which backported b40a7959 "freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD". v3.3+ doesn't need this fix. b40a7959 is the trivial bugfix, but unfortunately I forgot that until 34b087e4 "freezer: kill unused set_freezable_with_signal()" there were another only-for-kernel-threads flag, PF_FREEZER_NOSIG, which should be cleared as well. See https://bugs.launchpad.net/ubuntu/+source/v86d/+bug/1080530 The freezer fails because it expects that a PF_FREEZER_NOSIG task doesn't need a signal. Before b40a7959 it wrongly succeeds leaving the PF_NOFREEZE | PF_FREEZER_NOSIG task unfrozen. Reported-and-tested-by: Joseph Salisbury <joseph.salisbury@canonical.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com> [bwh: Don't touch PF_FORKNOEXEC; it's cleared elsewhere] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--fs/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 121ccae40abb..03d970da2f42 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1095,7 +1095,8 @@ int flush_old_exec(struct linux_binprm * bprm)
bprm->mm = NULL; /* We're using it now */
set_fs(USER_DS);
- current->flags &= ~(PF_RANDOMIZE | PF_KTHREAD | PF_NOFREEZE);
+ current->flags &=
+ ~(PF_RANDOMIZE | PF_KTHREAD | PF_NOFREEZE | PF_FREEZER_NOSIG);
flush_thread();
current->personality &= ~bprm->per_clear;