Re: [PATCH 1/2] powerpc/jprobes: Save and restore the parameter save area
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-05-18 05:22:30
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-05-18 05:22:30
"Naveen N. Rao" [off-list ref] writes:
As pointed out in x86 setjmp_pre_handler(), we need to save and restore the parameter save area since the jprobe hook might overwrite it. Since there is no easy way to identify the size of the parameter save area, we choose to save/restore a fixed 16 [double]word-sized area including the stack frame header. We introduce STACK_FRAME_PARM_SAVE to encode the offset of the parameter save area from the stack frame pointer. Remove the similarly named PARAMETER_SAVE_AREA_OFFSET in ptrace.c as those are currently not used anywhere. Signed-off-by: Naveen N. Rao <redacted> --- Michael, I've set the limit to 16 parameters as being a "reasonable" number, but we could very well make this 24 or 32 if we want to be sure. Let me know what you prefer.
That sounds incredibly fragile. Are we really just guessing at the size required? What happens if we under estimate, do we crash, silently corrupt data .. ? cheers