Re: probe_write_common_error

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

 



On Tue, Mar 31, 2020 at 07:16:28PM +0300, Gilad Reti wrote:
> When I try to probe_write_common into a writable location (e.g a
> memory address on a usermode stack) which is not yet mapped or mapped
> as read only to the memory, the function sometimes return a EFAULT
> (bad address) error. This is happening since the pagefault handler was
> disabled and thus this memory location won't be mapped when the
> function tries to write into it, an error will be returned and no data
> will be written.
> Is that behavior intended? Did you want those functions to have as
> less side-effects are possible?

You mean bpf_probe_write_user() helper?
Yes it's a non-faulting helper that will fail if prog is trying to
write into a valid memory that could have been served with minor fault.
The main reason for this is that bpf progs are not allowed to sleep.
We're working on sleepable bpf progs that will be able to do copy_from/to_user
from the context where it is safe to sleep. Like syscall entry.
Could you please share more about your use case, so we can make sure
that it will be covered by upcoming work?



[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