Commit 61ec29fa authored by Keith Owens's avatar Keith Owens Committed by Tony Luck

[IA64] Sanity check unw_unwind_to_user

Signed-off-by: default avatarKeith Owens <kaos@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent e2a6ce5b
...@@ -1945,7 +1945,7 @@ EXPORT_SYMBOL(unw_unwind); ...@@ -1945,7 +1945,7 @@ EXPORT_SYMBOL(unw_unwind);
int int
unw_unwind_to_user (struct unw_frame_info *info) unw_unwind_to_user (struct unw_frame_info *info)
{ {
unsigned long ip; unsigned long ip, sp;
while (unw_unwind(info) >= 0) { while (unw_unwind(info) >= 0) {
if (unw_get_rp(info, &ip) < 0) { if (unw_get_rp(info, &ip) < 0) {
...@@ -1954,6 +1954,9 @@ unw_unwind_to_user (struct unw_frame_info *info) ...@@ -1954,6 +1954,9 @@ unw_unwind_to_user (struct unw_frame_info *info)
__FUNCTION__, ip); __FUNCTION__, ip);
return -1; return -1;
} }
unw_get_sp(info, &sp);
if (sp >= (unsigned long)info->task + IA64_STK_OFFSET)
break;
if (ip < FIXADDR_USER_END) if (ip < FIXADDR_USER_END)
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment