Skip to content

Commit edc5149

Browse files
committed
executor: fix is_kernel_data/pc for gVisor
The address ranges in is_kernel_data/pc are only true for normal Linux.
1 parent dac2aa4 commit edc5149

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

executor/executor_linux.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ static bool use_cover_edges(uint32 pc)
184184

185185
static bool is_kernel_data(uint64 addr)
186186
{
187+
if (is_gvisor)
188+
return false;
187189
#if GOARCH_386 || GOARCH_amd64
188190
// This range corresponds to the first 1TB of the physical memory mapping,
189191
// see Documentation/arch/x86/x86_64/mm.rst.
@@ -196,6 +198,8 @@ static bool is_kernel_data(uint64 addr)
196198
// Returns >0 for yes, <0 for no, 0 for don't know.
197199
static int is_kernel_pc(uint64 pc)
198200
{
201+
if (is_gvisor)
202+
return 0;
199203
#if GOARCH_386 || GOARCH_amd64
200204
// Text/modules range for x86_64.
201205
return pc >= 0xffffffff80000000ull && pc < 0xffffffffff000000ull ? 1 : -1;

0 commit comments

Comments
 (0)