Opened 3 years ago

#12916 new bug

[Debugger] Handle retrieving image paths for chrooted teams

Reported by: anevilyak Owned by: anevilyak
Priority: normal Milestone: Unscheduled
Component: Applications/Debugger Version: R1/Development
Keywords: Cc: bonefish
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Currently, LocalDebuggerInterface uses get_next_image_info() to retrieve the list of images for the targetted team. However, if the team is in a chroot, the path returned in the image information appears to have the path used inside the chroot, rather than the full filesystem path, which consequently leads to us being unable to locate the binary in question.

A few potential solutions present themselves here:

1) get_*_image_info could detect if the caller is in the same team or not, and if not, return the full path rather than the adjusted one. This may or may not be easily done depending on the inner workings of the corresponding kernel data structures (not yet investigated).

2) A new system call could be introduced that, given a team_id and a root-relative path within that team, maps it to its full filesystem path outside the chroot.

or

3) Additional calls/messages could be added to the debug API that provides similar semantics to get_*_image_info() but always returns the full path, thus leaving the former unmodified.

IMO, the third approach would probably be best, since it minimizes the risk of introducing any regressions in the more widely used standard calls, and makes it clear that the desired behavior is to return the information needed by the debugger. In any case, any such solution also needs to adjust the debug kit's image load/unload events to likewise take chroots into account if they don't already.

Thoughts/suggestions?

Change History (0)

Note: See TracTickets for help on using tickets.