On Mon, 2020-12-07 at 14:09 +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the block tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> fs/io_uring.c: In function 'io_shutdown':
> fs/io_uring.c:3782:9: error: too many arguments to function
> 'sock_from_fi
On Thu, 2020-12-03 at 18:05 -0800, Martin KaFai Lau wrote:
> On Wed, Dec 02, 2020 at 09:55:27PM +0100, Florent Revest wrote:
> > This extends the existing bpf_sk_storage_get test where a socket is
> > created and tagged with its creator's pid by a task_file iterator.
> >
tored in the local storage.
Signed-off-by: Florent Revest
Acked-by: Yonghong Song
Acked-by: Martin KaFai Lau
---
.../selftests/bpf/prog_tests/bpf_iter.c| 18 --
.../progs/bpf_iter_bpf_sk_storage_helpers.c| 18 ++
2 files changed, 34 insertions(
to selectively delete local storage values.
Signed-off-by: Florent Revest
Acked-by: Martin KaFai Lau
Acked-by: KP Singh
---
net/core/bpf_sk_storage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c
index a32037daa933..4edd033e899c
his
information could be used from a cgroup_skb/*gress hook to try to
associate network traffic with processes.
The test makes sure that a socket it created is tagged with prog_tests's
pid.
Signed-off-by: Florent Revest
Acked-by: Yonghong Song
Acked-by: Martin KaFai Lau
---
.../self
The eBPF program iterates over all entries (well, only one) of a socket
local storage map and deletes them all. The test makes sure that the
entry is indeed deleted.
Signed-off-by: Florent Revest
Acked-by: Martin KaFai Lau
---
.../selftests/bpf/prog_tests/bpf_iter.c | 64
hether the returned socket is NULL or not.
Suggested-by: Al Viro
Signed-off-by: Florent Revest
Reviewed-by: KP Singh
---
fs/eventpoll.c | 3 +--
fs/io_uring.c| 16
include/linux/net.h | 2 +-
net/core/netclassid_cgroup.c | 3 +--
o other program types
inheriting this set of helpers such as iterators or LSM programs.
Signed-off-by: Florent Revest
Acked-by: KP Singh
Acked-by: Martin KaFai Lau
---
include/uapi/linux/bpf.h | 9 +
kernel/trace/bpf_trace.c | 20
scripts/bpf_helpers_doc.py
o other program types
inheriting this set of helpers such as iterators or LSM programs.
Signed-off-by: Florent Revest
Acked-by: KP Singh
Acked-by: Martin KaFai Lau
---
include/uapi/linux/bpf.h | 9 +
kernel/trace/bpf_trace.c | 20
scripts/bpf_helpers_doc.py
hether the returned socket is NULL or not.
Suggested-by: Al Viro
Signed-off-by: Florent Revest
Reviewed-by: KP Singh
---
fs/eventpoll.c | 3 +--
fs/io_uring.c| 16
include/linux/net.h | 2 +-
net/core/netclassid_cgroup.c | 3 +--
tored in the local storage.
Signed-off-by: Florent Revest
Acked-by: Yonghong Song
---
.../selftests/bpf/prog_tests/bpf_iter.c| 13 +
.../progs/bpf_iter_bpf_sk_storage_helpers.c| 18 ++
2 files changed, 31 insertions(+)
diff --git a/tools/testing/selftest
his
information could be used from a cgroup_skb/*gress hook to try to
associate network traffic with processes.
The test makes sure that a socket it created is tagged with prog_tests's
pid.
Signed-off-by: Florent Revest
Acked-by: Yonghong Song
---
.../selftests/bpf/prog_tests/b
The eBPF program iterates over all entries (well, only one) of a socket
local storage map and deletes them all. The test makes sure that the
entry is indeed deleted.
Signed-off-by: Florent Revest
Acked-by: Martin KaFai Lau
---
.../selftests/bpf/prog_tests/bpf_iter.c | 64
to selectively delete local storage values.
Signed-off-by: Florent Revest
Acked-by: Martin KaFai Lau
Acked-by: KP Singh
---
net/core/bpf_sk_storage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c
index a32037daa933..4edd033e899c
On Thu, 2020-11-26 at 23:00 -0800, Yonghong Song wrote:
> On 11/26/20 8:44 AM, Florent Revest wrote:
> > +SEC("iter/task_file")
> > +int fill_socket_owner(struct bpf_iter__task_file *ctx)
> > +{
> > + struct task_struct *task = ctx->task;
> > +
hether the returned socket is NULL or not.
Suggested-by: Al Viro
Signed-off-by: Florent Revest
---
fs/eventpoll.c | 3 +--
fs/io_uring.c| 16
include/linux/net.h | 2 +-
net/core/netclassid_cgroup.c | 3 +--
net/core/netprio_cgroup.c|
The eBPF program iterates over all entries (well, only one) of a socket
local storage map and deletes them all. The test makes sure that the
entry is indeed deleted.
Signed-off-by: Florent Revest
Acked-by: Martin KaFai Lau
---
.../selftests/bpf/prog_tests/bpf_iter.c | 64
tored in the local storage.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/bpf_iter.c| 13 +
.../progs/bpf_iter_bpf_sk_storage_helpers.c| 18 ++
2 files changed, 31 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_iter
his
information could be used from a cgroup_skb/*gress hook to try to
associate network traffic with processes.
The test makes sure that a socket it created is tagged with prog_tests's
pid.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/bpf_iter.c | 40 ++
o other program types
inheriting this set of helpers such as iterators or LSM programs.
Signed-off-by: Florent Revest
Acked-by: KP Singh
Acked-by: Martin KaFai Lau
---
include/uapi/linux/bpf.h | 9 +
kernel/trace/bpf_trace.c | 20
scripts/bpf_helpers_doc.py
to selectively delete local storage values.
Signed-off-by: Florent Revest
Acked-by: Martin KaFai Lau
---
net/core/bpf_sk_storage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c
index a32037daa933..4edd033e899c 100644
--- a/net/core
On Thu, 2020-11-19 at 16:32 -0800, Martin KaFai Lau wrote:
> Does it affect all sk(s) in the system? Can it be limited to
> the sk that the test is testing?
Oh I just realized I haven't answered you here yet! Thanks for the
reviews. :D I'm sending a v3 addressing your comments
From: Florent Revest
While eBPF programs can check whether a file is a socket by file->f_op
== &socket_file_ops, they cannot convert the void private_data pointer
to a struct socket BTF pointer. In order to do this a new helper
wrapping sock_from_file is added.
This is useful to
From: Florent Revest
The eBPF program iterates over all entries (well, only one) of a socket
local storage map and deletes them all. The test makes sure that the
entry is indeed deleted.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/bpf_iter.c | 64
From: Florent Revest
The eBPF program iterates over all files and tasks. For all socket
files, it stores the tgid of the last task it encountered with a handle
to that socket. This is a heuristic for finding the "owner" of a socket
similar to what's done by lsof, ss, n
From: Florent Revest
Iterators are currently used to expose kernel information to userspace
over fast procfs-like files but iterators could also be used to
manipulate local storage. For example, the task_file iterator could be
used to initialize a socket local storage with associations between
From: Florent Revest
Currently, the sock_from_file prototype takes an "err" pointer that is
either not set or set to -ENOTSOCK IFF the returned socket is NULL. This
makes the error redundant and it is ignored by a few callers.
This patch simplifies the API by letting callers deduce
On Thu, 2020-11-12 at 20:28 +, Al Viro wrote:
> On Thu, Nov 12, 2020 at 09:09:44PM +0100, Florent Revest wrote:
> > From: Florent Revest
> >
> > eBPF programs can already check whether a file is a socket using
> > file->f_op == &socket_file
28 matches
Mail list logo