Skip to content

Commit

Permalink
executor: fix is_kernel_data/pc for gVisor
Browse files Browse the repository at this point in the history
The address ranges in is_kernel_data/pc are only true for normal Linux.
  • Loading branch information
dvyukov committed Jun 21, 2024
1 parent dac2aa4 commit edc5149
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions executor/executor_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ static bool use_cover_edges(uint32 pc)

static bool is_kernel_data(uint64 addr)
{
if (is_gvisor)
return false;
#if GOARCH_386 || GOARCH_amd64
// This range corresponds to the first 1TB of the physical memory mapping,
// see Documentation/arch/x86/x86_64/mm.rst.
Expand All @@ -196,6 +198,8 @@ static bool is_kernel_data(uint64 addr)
// Returns >0 for yes, <0 for no, 0 for don't know.
static int is_kernel_pc(uint64 pc)
{
if (is_gvisor)
return 0;
#if GOARCH_386 || GOARCH_amd64
// Text/modules range for x86_64.
return pc >= 0xffffffff80000000ull && pc < 0xffffffffff000000ull ? 1 : -1;
Expand Down

0 comments on commit edc5149

Please sign in to comment.