Re: [PATCH bpf] bpf: add check for invalid name in btf_name_valid_section()
From: Eduard Zingerman
Date: Fri Aug 30 2024 - 14:04:39 EST
On Fri, 2024-08-30 at 20:41 +0900, Jeongjun Park wrote:
[...]
> So does that mean it's appropriate to add if(!isprint(*src)) instead
> of if(!*src)?
I'd prefer to add "if (!*src) return false" and remove "src++" in
order to not repeat isprint().
> As far as I know, the first character of name doesn't need isprint() check,
> so if that's true, it would be appropriate to use isprint. Once this
> is confirmed,
The intent of the buggy commit [1] was to check that all characters in
a section name are printable. But I can't even check name for
printable characters these days :(
[1] bd70a8fb7ca4 ("bpf: Allow all printable characters in BTF DATASEC names")
[...]