Skip to content

Commit fa2ec3e

Browse files
colincrossctmarinas
authored andcommitted
arm64: implement TASK_SIZE_OF
include/linux/sched.h implements TASK_SIZE_OF as TASK_SIZE if it is not set by the architecture headers. TASK_SIZE uses the current task to determine the size of the virtual address space. On a 64-bit kernel this will cause reading /proc/pid/pagemap of a 64-bit process from a 32-bit process to return EOF when it reads past 0xffffffff. Implement TASK_SIZE_OF exactly the same as TASK_SIZE with test_tsk_thread_flag instead of test_thread_flag. Cc: stable@vger.kernel.org Signed-off-by: Colin Cross <ccross@android.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent bec7ced commit fa2ec3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm64/include/asm/memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
#define TASK_SIZE_32 UL(0x100000000)
5757
#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \
5858
TASK_SIZE_32 : TASK_SIZE_64)
59+
#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \
60+
TASK_SIZE_32 : TASK_SIZE_64)
5961
#else
6062
#define TASK_SIZE TASK_SIZE_64
6163
#endif /* CONFIG_COMPAT */

0 commit comments

Comments
 (0)