qcom: minidump: Fix stack pointer arithmetic to avoid underflow
Currently, the stack pointer value that is being passed in
might be 0, or might be some value that is not a kernel
address, but it would still be useful to attempt to dump
the process' stack. Add check to use current stack pointer
if given value is not a kernel address. Also, the PAGE_ALIGN
macro up-aligns a value that is passed into it, which is not
correct, so use correct arithmetic to obtain aligned stack
pointer value, and add sanity check to ensure that the stack
pointer is within the process stack to avoid underflow errors
that may lead to registering a large amount of minidump
entries.
Change-Id: I211464cbff669a5dd4ffa0919ffea4f79fe55db1
Signed-off-by:
Isaac J. Manjarres <isaacm@codeaurora.org>
Loading
Please register or sign in to comment