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: <CAEf4BzbmTK9HtR0RwY30bPa1oObALv_prfZJ2sZq3eZku6pTzw@mail.gmail.com>
Date: Fri, 19 Sep 2025 15:37:55 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Tao Chen <chen.dylane@...ux.dev>
Cc: qmo@...nel.org, ast@...nel.org, daniel@...earbox.net, andrii@...nel.org, 
	martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org, 
	yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org, 
	sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, bpf@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v4 2/2] bpftool: Fix UAF in get_delegate_value

On Thu, Sep 18, 2025 at 8:48 PM Tao Chen <chen.dylane@...ux.dev> wrote:
>
> The return value ret pointer is pointing opts_copy, but opts_copy
> gets freed in get_delegate_value before return, fix this by free
> the mntent->mnt_opts strdup memory after show delegate value.
>
> Fixes: 2d812311c2b2 ("bpftool: Add bpf_token show")
> Signed-off-by: Tao Chen <chen.dylane@...ux.dev>
> ---
>  tools/bpf/bpftool/token.c | 90 ++++++++++++++++-----------------------
>  1 file changed, 37 insertions(+), 53 deletions(-)
>
> diff --git a/tools/bpf/bpftool/token.c b/tools/bpf/bpftool/token.c
> index 82b829e44c8..2bbec4c98f2 100644
> --- a/tools/bpf/bpftool/token.c
> +++ b/tools/bpf/bpftool/token.c
> @@ -20,6 +20,16 @@
>
>  #define MOUNTS_FILE "/proc/mounts"
>
> +struct {

this should have been static, fixed up when applying


> +       const char *header;
> +       const char *key;
> +} sets[] = {
> +       {"allowed_cmds", "delegate_cmds"},
> +       {"allowed_maps", "delegate_maps"},
> +       {"allowed_progs", "delegate_progs"},
> +       {"allowed_attachs", "delegate_attachs"},
> +};
> +
>  static bool has_delegate_options(const char *mnt_ops)
>  {
>         return strstr(mnt_ops, "delegate_cmds") ||

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ