The answer to my issue is in arch/arm64/kernel/process.c, copy_thread():
if (stack_start) {
if (is_compat_thread(task_thread_info(p)))
childregs->compat_sp = stack_start;
/* 16-byte aligned stack mandatory on AArch64 */
else if (stack_start & 15)
return -EINVAL;
else
childregs->sp = stack_start;
}
Ahah! The stack being passed into clone() has to be 16 byte aligned. With this simple fix to my code, clone() worked. Pity this was not in the documentation.
Where are the system call man pages maintained? Is it very difficult to create a pull request?
ReplyDelete"Pity this was not in the documentation."
ReplyDeleteAnd a pity that the person who learned the information has not sent a patch or bug report to me :-). See https://www.kernel.org/doc/man-pages/reporting_bugs.html
My apologies, I will be a better citizen next time. :-(
DeleteOh -- you can be better this time :-). See https://www.kernel.org/doc/man-pages/reporting_bugs.html
DeleteDone. Sorry to take so long.
DeleteFix landed in linux-next: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e6d9a52543338603e25e71e0e4942f05dae0dd8a
ReplyDelete