]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: signal: Refactor sigcontext parsing in rt_sigreturn
authorDave Martin <Dave.Martin@arm.com>
Thu, 15 Jun 2017 14:03:39 +0000 (15:03 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 20 Jun 2017 11:42:58 +0000 (12:42 +0100)
commit8ea17cf28961b88570ad532c367736b28ddccf6d
tree0aa4f06e85f3f80b9fe8cd34d711e1e0ef750bbe
parentb56bef050759993feb8764141c7e33d5de89aaf3
arm64: signal: Refactor sigcontext parsing in rt_sigreturn

Currently, rt_sigreturn does very limited checking on the
sigcontext coming from userspace.

Future additions to the sigcontext data will increase the potential
for surprises.  Also, it is not clear whether the sigcontext
extension records are supposed to occur in a particular order.

To allow the parsing code to be extended more easily, this patch
factors out the sigcontext parsing into a separate function, and
adds extra checks to validate the well-formedness of the sigcontext
structure.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/signal.c