Re: Out-of-bound read suspected in libbpf.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2025-02-19 at 20:43 +0530, Nandakumar Edamana wrote:

[...]

> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 194809da5172..1cc87dbd015d 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -2106,7 +2106,7 @@ static int set_kcfg_value_str(struct extern_desc 
> *ext, char *ext_val,
>          }
> 
>          len = strlen(value);
> -       if (value[len - 1] != '"') {
> +       if (len < 2 || value[len - 1] != '"') {

Makes sense to me, could you please send a formal patch?

>                  pr_warn("extern (kcfg) '%s': invalid string config '%s'\n",
>                          ext->name, value);
>                  return -EINVAL;
> 






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux