* [PATCH] coredump: Fix the setting of PF_DUMPCORE
@ 2014-07-11 10:00 Silesh C V
2014-07-11 10:35 ` Oleg Nesterov
0 siblings, 1 reply; 2+ messages in thread
From: Silesh C V @ 2014-07-11 10:00 UTC (permalink / raw)
To: viro, linux-fsdevel, linux-kernel
Cc: Silesh C V, Oleg Nesterov, Mandeep Singh Baines
commit 079148b91 (coredump: factor out the setting of PF_DUMPCORE)
cleaned up the setting of PF_DUMPCORE by removing it from all the
linux_binfmt->core_dump() and moving it to zap_threads().But this
ended up clearing all the previously set flags. This causes issues
during core generation when tsk->flags is checked again
(eg. for PF_USED_MATH to dump floating point registers). Fix this.
Signed-off-by: Silesh C V <svellattu@mvista.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Mandeep Singh Baines <msb@chromium.org>
---
fs/coredump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/coredump.c b/fs/coredump.c
index 0b2528f..a93f7e6 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -306,7 +306,7 @@ static int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
if (unlikely(nr < 0))
return nr;
- tsk->flags = PF_DUMPCORE;
+ tsk->flags |= PF_DUMPCORE;
if (atomic_read(&mm->mm_users) == nr + 1)
goto done;
/*
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] coredump: Fix the setting of PF_DUMPCORE
2014-07-11 10:00 [PATCH] coredump: Fix the setting of PF_DUMPCORE Silesh C V
@ 2014-07-11 10:35 ` Oleg Nesterov
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2014-07-11 10:35 UTC (permalink / raw)
To: Silesh C V, Andrew Morton
Cc: viro, linux-fsdevel, linux-kernel, Mandeep Singh Baines
OOPS. Thanks a lot Silesh.
Hopefully Andrew can take this patch. And it probably needs
Cc: stable@vger.kernel.org # v3.10+
On 07/11, Silesh C V wrote:
>
> commit 079148b91 (coredump: factor out the setting of PF_DUMPCORE)
> cleaned up the setting of PF_DUMPCORE by removing it from all the
> linux_binfmt->core_dump() and moving it to zap_threads().But this
> ended up clearing all the previously set flags. This causes issues
> during core generation when tsk->flags is checked again
> (eg. for PF_USED_MATH to dump floating point registers). Fix this.
>
> Signed-off-by: Silesh C V <svellattu@mvista.com>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: Mandeep Singh Baines <msb@chromium.org>
>
> ---
> fs/coredump.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/coredump.c b/fs/coredump.c
> index 0b2528f..a93f7e6 100644
> --- a/fs/coredump.c
> +++ b/fs/coredump.c
> @@ -306,7 +306,7 @@ static int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
> if (unlikely(nr < 0))
> return nr;
>
> - tsk->flags = PF_DUMPCORE;
> + tsk->flags |= PF_DUMPCORE;
> if (atomic_read(&mm->mm_users) == nr + 1)
> goto done;
> /*
> --
> 1.8.1.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-11 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 10:00 [PATCH] coredump: Fix the setting of PF_DUMPCORE Silesh C V
2014-07-11 10:35 ` Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox