]> git.baikalelectronics.ru Git - kernel.git/commit
m68knommu: fix trap on execing /bin/init
authorGreg Ungerer <gerg@uclinux.org>
Wed, 6 Feb 2013 01:13:23 +0000 (11:13 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Wed, 6 Feb 2013 01:13:23 +0000 (11:13 +1000)
commit9a732ecf4d02a8e9e69c86f9d7d5c86eb828d429
treee6d625ea7693ec2f474a37108170c0bae626deca
parentba8d018b2c0459728dc0f10217f338888c3a5389
m68knommu: fix trap on execing /bin/init

As of commit c54b15c5 ("m68k: switch to saner kernel_execve() semantics")
the non-mmu m68k targets have trapped on booting. The execing of /bin/init
causes the exec path to try and return through a 0x0 return address - thus
trapping or otherwise hanging or crashing.

The problem isn't in the exec path as such though, but rather in the
m68knommu start_thread() macro. It is trying to clear the a6 register that
it assumes is part of a struct switch_stack below the thread registers on
our stack. But that is not what the stack frames look like when this is run.
So it ends up corrupting our call stack and zeroing out a function return
address that is sitting there.

The clearing of a6 was introduced many years ago in commit 3bd47f46ed
("m68knommu: force stack alignment on ColdFire"). It used to work because
the kernel init exec code path had a short cut back to the exception return
code, and it didn't need to return through the calls on the stack.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/include/asm/processor.h