lkml.org 
[lkml]   [2021]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RESEND 2/2] x86/mm: Randomize va with generic arch_pick_mmap_layout()
From
Date

> On Sep 21, 2021, at 10:41 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Sep 21, 2021 at 10:34:14PM +0800, sxwjean@me.com wrote:
>> diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
>> index 7516e4199b3c..c697e377644d 100644
>> --- a/arch/x86/include/asm/compat.h
>> +++ b/arch/x86/include/asm/compat.h
>> @@ -151,6 +151,11 @@ struct compat_shmid64_ds {
>> compat_ulong_t __unused5;
>> };
>>
>> +static inline int is_compat_task(void)
>> +{
>> + return IS_ENABLED(CONFIG_COMPAT) && test_thread_flag(TIF_32BIT);
>> +}
>> +
>
> This is still fundamentally broken for x86. x86 doesn't have compat
> tasks, the granularity is at syscall at best.

Hi Peter,

Thank you for pointing this out. I understand now a 64bit task can call a 32bit syscall.
Here we should use in_compat_syscall() to check if the kernel is in compat mode, right?

Regards,
Xiongwei
\
 
 \ /
  Last update: 2021-09-22 15:29    [W:0.073 / U:3.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site