[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220520113728.12708-2-shung-hsi.yu@suse.com>
Date: Fri, 20 May 2022 19:37:25 +0800
From: Shung-Hsi Yu <shung-hsi.yu@...e.com>
To: netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
CC: Shung-Hsi Yu <shung-hsi.yu@...e.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>
Subject: [PATCH bpf-next 1/4] bpf: verifier: update resolve_pseudo_ldimm64() comment
Since commit 5e581dad4fec ("bpf: make unknown opcode handling more
robust") the verifier also checks for opcode validity while resolving
file descriptor, update the comment to reflect such fact.
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@...e.com>
---
kernel/bpf/verifier.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 9b59581026f8..79a2695ee2e2 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -12350,7 +12350,8 @@ static bool bpf_map_is_cgroup_storage(struct bpf_map *map)
map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE);
}
-/* find and rewrite pseudo imm in ld_imm64 instructions:
+/* check the opcodes of all instructions, and find and rewrite pseudo imm in
+ * ld_imm64 instructions:
*
* 1. if it accesses map FD, replace it with actual map pointer.
* 2. if it accesses btf_id of a VAR, replace it with pointer to the var.
--
2.36.1
Powered by blists - more mailing lists