]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: do_notify_resume can be called with bad thread_info flags argument
authorAnton Blanchard <anton@samba.org>
Fri, 31 Oct 2014 05:50:57 +0000 (16:50 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 31 Oct 2014 05:52:46 +0000 (16:52 +1100)
commit6728e5809d367b0a6b7361c845fa679fabbba305
tree2230d3d8d813bada4f9ffe54fe6ffbcb947c9bd6
parent8e9c71ee967e97b90470cb1808979c1a156c1d45
powerpc: do_notify_resume can be called with bad thread_info flags argument

Back in e545d4437a9a ("powerpc: Rework lazy-interrupt handling") we
added a call out to restore_interrupts() (written in c) before calling
do_notify_resume:

        bl      restore_interrupts
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      do_notify_resume

Unfortunately do_notify_resume takes two arguments, the second one
being the thread_info flags:

void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)

We do populate r4 (the second argument) earlier, but
restore_interrupts() is free to muck it up all it wants. My guess is
the gcc compiler gods shone down on us and its register allocator
never used r4. Sometimes, rarely, luck is on our side.

LLVM on the other hand did trample r4.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/entry_64.S