Skip to content

Commit 745e031

Browse files
andreimateianakryiko
authored andcommitted
bpf: Comment on check_mem_size_reg
This patch adds a comment to check_mem_size_reg -- a function whose meaning is not very transparent. The function implicitly deals with two registers connected by convention, which is not obvious. Signed-off-by: Andrei Matei <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 56c26d5 commit 745e031

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/bpf/verifier.c

+6
Original file line numberDiff line numberDiff line change
@@ -7256,6 +7256,12 @@ static int check_helper_mem_access(struct bpf_verifier_env *env, int regno,
72567256
}
72577257
}
72587258

7259+
/* verify arguments to helpers or kfuncs consisting of a pointer and an access
7260+
* size.
7261+
*
7262+
* @regno is the register containing the access size. regno-1 is the register
7263+
* containing the pointer.
7264+
*/
72597265
static int check_mem_size_reg(struct bpf_verifier_env *env,
72607266
struct bpf_reg_state *reg, u32 regno,
72617267
bool zero_size_allowed,

0 commit comments

Comments
 (0)