All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/kernel: Initialize load_tm on task creation
@ 2017-06-05 14:40 Breno Leitao
  2017-06-05 22:52 ` Daniel Axtens
  2017-06-08  4:05 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Breno Leitao @ 2017-06-05 14:40 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Anton Blanchard

Currently tsk->thread.load_tm is not initialized in the task creation
and can contain garbage on a new task.

This is an undesired behaviour, since it affects the timing to enable
and disable the transactional memory laziness (disabling and enabling
the MSR TM bit, which affects TM reclaim and recheckpoint in the
scheduling process).

CC: Anton Blanchard <anton@samba.org>
Fixes: 5d176f751ee3c6eededd984ad409bff201f436a7
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/kernel/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a9435397eab8..2ad725ef4368 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1687,6 +1687,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
 	current->thread.tm_tfhar = 0;
 	current->thread.tm_texasr = 0;
 	current->thread.tm_tfiar = 0;
+	current->thread.load_tm = 0;
 #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
 }
 EXPORT_SYMBOL(start_thread);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/kernel: Initialize load_tm on task creation
  2017-06-05 14:40 [PATCH] powerpc/kernel: Initialize load_tm on task creation Breno Leitao
@ 2017-06-05 22:52 ` Daniel Axtens
  2017-06-06  4:47   ` Michael Ellerman
  2017-06-08  4:05 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Axtens @ 2017-06-05 22:52 UTC (permalink / raw)
  To: Breno Leitao, linuxppc-dev; +Cc: Anton Blanchard

Hi Breno,

Looks good to me.

> Currently tsk->thread.load_tm is not initialized in the task creation
> and can contain garbage on a new task.
>
> This is an undesired behaviour, since it affects the timing to enable
> and disable the transactional memory laziness (disabling and enabling
> the MSR TM bit, which affects TM reclaim and recheckpoint in the
> scheduling process).

Is there any chance this uninitialised memory will leak something
interesting/sensitive? (Therefore, should this go to stable?)

Regards,
Daniel


> CC: Anton Blanchard <anton@samba.org>
> Fixes: 5d176f751ee3c6eededd984ad409bff201f436a7
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>  arch/powerpc/kernel/process.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index a9435397eab8..2ad725ef4368 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -1687,6 +1687,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
>  	current->thread.tm_tfhar = 0;
>  	current->thread.tm_texasr = 0;
>  	current->thread.tm_tfiar = 0;
> +	current->thread.load_tm = 0;
>  #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
>  }
>  EXPORT_SYMBOL(start_thread);
> -- 
> 2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/kernel: Initialize load_tm on task creation
  2017-06-05 22:52 ` Daniel Axtens
@ 2017-06-06  4:47   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-06-06  4:47 UTC (permalink / raw)
  To: Daniel Axtens, Breno Leitao, linuxppc-dev; +Cc: Anton Blanchard

Daniel Axtens <dja@axtens.net> writes:

> Hi Breno,
>
> Looks good to me.
>
>> Currently tsk->thread.load_tm is not initialized in the task creation
>> and can contain garbage on a new task.
>>
>> This is an undesired behaviour, since it affects the timing to enable
>> and disable the transactional memory laziness (disabling and enabling
>> the MSR TM bit, which affects TM reclaim and recheckpoint in the
>> scheduling process).
>
> Is there any chance this uninitialised memory will leak something
> interesting/sensitive? (Therefore, should this go to stable?)

I'll send it to stable anyway for the original bug it fixes.

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc/kernel: Initialize load_tm on task creation
  2017-06-05 14:40 [PATCH] powerpc/kernel: Initialize load_tm on task creation Breno Leitao
  2017-06-05 22:52 ` Daniel Axtens
@ 2017-06-08  4:05 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-06-08  4:05 UTC (permalink / raw)
  To: Breno Leitao, linuxppc-dev; +Cc: Anton Blanchard

On Mon, 2017-06-05 at 14:40:59 UTC, Breno Leitao wrote:
> Currently tsk->thread.load_tm is not initialized in the task creation
> and can contain garbage on a new task.
> 
> This is an undesired behaviour, since it affects the timing to enable
> and disable the transactional memory laziness (disabling and enabling
> the MSR TM bit, which affects TM reclaim and recheckpoint in the
> scheduling process).
> 
> CC: Anton Blanchard <anton@samba.org>
> Fixes: 5d176f751ee3c6eededd984ad409bff201f436a7
> Signed-off-by: Breno Leitao <leitao@debian.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/7f22ced4377628074e2ac25f41a88f

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-08  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 14:40 [PATCH] powerpc/kernel: Initialize load_tm on task creation Breno Leitao
2017-06-05 22:52 ` Daniel Axtens
2017-06-06  4:47   ` Michael Ellerman
2017-06-08  4:05 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.