Re: [PATCH bpf] bpf: Refactoring btf_name_valid_identifier() and btf_name_valid_section()
From: Alexei Starovoitov
Date: Wed Aug 21 2024 - 14:39:39 EST
On Mon, Aug 19, 2024 at 9:08 AM Jeongjun Park <aha310510@xxxxxxxxx> wrote:
>
> Currently, btf_name_valid_identifier() and btf_name_valid_section() are
> written in a while loop and use pointer operations, so it takes a long
> time to understand the operation of the code. Therefore, I suggest
> refactoring the code to make it easier to maintain.
imo it's harder to read after refactoring. Pls avoid.
> In addition, btf_name_valid_section() does not check for the case where
> src[0] is a NULL value, resulting in an out-of-bounds vuln. Therefore, a
> check for this should be added.
Hmm. Not sure about it. Pls add a selftest that demonstrates the issue
and produce a patch to fix just that.
Do not mix it with questionable refactoring.
pw-bot: cr