lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] [v2] bpf: fix bpf_probe_read_kernel prototype mismatch
On Wed, May 24, 2023, at 05:12, Yonghong Song wrote:
> On 5/23/23 12:43 PM, Arnd Bergmann wrote:

>> Aside from the warning, this addresses a bug on 32-bit architectures
>> from incorrect argument passing with the mismatched prototype.
>
> Could you explain what is this '32-bit architectures ... incorrect
> argument passing' thing?

I've expanded that paragraph now:

| Aside from the warning, this addresses a bug on 32-bit architectures
| from incorrect argument passing with the mismatched prototype:
| BPF_CALL_x() functions use 64-bit arguments that are passed in
| pairs of register or on the stack on 32-bit architectures, while the
| normal function uses one register per argument.

Let me know if you think I should put more details in there.

>> @@ -1635,11 +1636,13 @@ bool bpf_opcode_in_insntable(u8 code)
>> }
>>
>> #ifndef CONFIG_BPF_JIT_ALWAYS_ON
>> -u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
>> +#ifndef CONFIG_BPF_EVENTS
>> +int bpf_probe_read_kernel_common(void * dst, u32 size, const void *unsafe_ptr)
>
> void * dst => void *dst
>

Fixed now.

Thanks,

Arnd

\
 
 \ /
  Last update: 2023-05-24 15:32    [W:0.051 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site