Re: [PATCH bpf v5] bpf: verifier: prevent userspace memory access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> writes:

> On Sun, Mar 24, 2024 at 11:54 AM Puranjay Mohan <puranjay12@xxxxxxxxx> wrote:
>>
>> +u64 bpf_arch_uaddress_limit(void)
>> +{
>> +       return max(TASK_SIZE_MAX + PAGE_SIZE, VSYSCALL_ADDR);
>
> This is broken. See my other email.
> Sadly you didn't test it.

Yes, sorry for this. I was relying on the CI for the test this time as
thought it would work. I just realised this would reject all addresses!

Given that the current x86-64 JIT just tests for TASK_SIZE_MAX +
PAGE_SIZE can we go ahead with this and later fix it for VSYSCALL_ADDR
as it is specific for x86-64?

Also, I will spend some time figuring out the best way to do this, there
should be some mathematical trick somewhere.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux