diff --git a/cr-dump.c b/cr-dump.c index 6f575e173..5fbbefd6d 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -552,10 +552,14 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size) memzero(tls_array, sizeof(*tls_array) * size); - /* pure x86-64 has a base address only */ - ret = sys_arch_prctl(ARCH_GET_FS, &tls_array[0].base_addr); + /* Pure x86-64 has a base addresses only */ + ret = sys_arch_prctl(ARCH_GET_FS, &tls_array[FS_TLS].base_addr); if (ret) - pr_err("Failed to obtain TLS entry: %d\n", ret); + pr_err("Failed to obtain FS_TLS entry: %d\n", ret); + + ret = sys_arch_prctl(ARCH_GET_GS, &tls_array[GS_TLS].base_addr); + if (ret) + pr_err("Failed to obtain GS_TLS entry: %d\n", ret); err: return ret; diff --git a/include/types.h b/include/types.h index 074404ef3..ba44ae68b 100644 --- a/include/types.h +++ b/include/types.h @@ -12,6 +12,9 @@ #define ARCH_GET_FS 0x1003 #define ARCH_GET_GS 0x1004 +#define FS_TLS 0 +#define GS_TLS 1 + /* some constants for ptrace */ #define PTRACE_SEIZE 0x4206 #define PTRACE_INTERRUPT 0x4207