lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP01T776eigY_RD8CFTiqLNcRMvy+jdNtsAmQgTDL0YfLbhzvw@mail.gmail.com>
Date: Tue, 22 Apr 2025 03:05:21 +0200
From: Kumar Kartikeya Dwivedi <memxor@...il.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: bpf@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>, 
	Andrii Nakryiko <andrii@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, netdev@...r.kernel.org, 
	kernel-team@...a.com, Amery Hung <ameryhung@...il.com>
Subject: Re: [RFC PATCH bpf-next 01/12] bpf: Check KF_bpf_rbtree_add_impl for
 the "case KF_ARG_PTR_TO_RB_NODE"

On Sat, 19 Apr 2025 at 00:47, Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> From: Martin KaFai Lau <martin.lau@...nel.org>
>
> In a later patch, two new kfuncs will take the bpf_rb_node pointer arg.
>
> struct bpf_rb_node *bpf_rbtree_left(struct bpf_rb_root *root,
>                                     struct bpf_rb_node *node);
> struct bpf_rb_node *bpf_rbtree_right(struct bpf_rb_root *root,
>                                      struct bpf_rb_node *node);
>
> In the check_kfunc_call, there is a "case KF_ARG_PTR_TO_RB_NODE"
> to check if the reg->type should be an allocated pointer or should be
> a non_owning_ref.
>
> The later patch will need to ensure that the bpf_rb_node pointer passing
> to the new bpf_rbtree_{left,right} must be a non_owning_ref. This
> should be the same requirement as the existing bpf_rbtree_remove.
>
> This patch swaps the current "if else" statement. Instead of checking
> the bpf_rbtree_remove, it checks the bpf_rbtree_add. Then the new
> bpf_rbtree_{left,right} will fall into the "else" case to make
> the later patch simpler. bpf_rbtree_add should be the only
> one that needs an allocated pointer.
>
> This should be a no-op change considering there are only two kfunc(s)
> taking bpf_rb_node pointer arg, rbtree_add and rbtree_remove.
>
> Signed-off-by: Martin KaFai Lau <martin.lau@...nel.org>
> ---

Acked-by: Kumar Kartikeya Dwivedi <memxor@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ