powerpc: Implement arch_within_stack_frames
authorNicholas Miehlbradt <nicholas@linux.ibm.com>
Tue, 28 Feb 2023 05:43:55 +0000 (05:43 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 4 Apr 2023 12:11:03 +0000 (22:11 +1000)
commitac9c8901cb10aab043bf3599d19eebacfcda2858
treed4e853d3daf6e4f2e99dacc5a3372e978bdaebee
parent2500763dd3db37fad94d9b506907c59c2f5e97c6
powerpc: Implement arch_within_stack_frames

Walks the stack when copy_{to,from}_user address is in the stack to
ensure that the object being copied is entirely a single stack frame and
does not contain stack metadata.

Substantially similar to the x86 implementation. The back chain is used
to traverse the stack and identify stack frame boundaries.

Signed-off-by: Nicholas Miehlbradt <nicholas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230228054355.300628-1-nicholas@linux.ibm.com
arch/powerpc/Kconfig
arch/powerpc/include/asm/ppc_asm.h
arch/powerpc/include/asm/thread_info.h