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: <CAP01T77mcUi4h_dT6QfEPg_xeUGhsegcV+NCqpQSY-VtxuLV4A@mail.gmail.com>
Date: Thu, 13 Feb 2025 10:05:59 +0100
From: Kumar Kartikeya Dwivedi <memxor@...il.com>
To: Changwoo Min <changwoo@...lia.com>
Cc: Song Liu <song@...nel.org>, ast@...nel.org, daniel@...earbox.net, 
	andrii@...nel.org, martin.lau@...ux.dev, eddyz87@...il.com, 
	yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org, 
	sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, tj@...nel.org, 
	arighi@...dia.com, kernel-dev@...lia.com, bpf@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next] bpf: Add a retry after refilling the free list
 when unit_alloc() fails

On Thu, 13 Feb 2025 at 09:42, Changwoo Min <changwoo@...lia.com> wrote:
>
> Hello Song,
>
> Thank you for the review!
>
> On 25. 2. 13. 03:33, Song Liu wrote:
> > On Wed, Feb 12, 2025 at 12:49 AM Changwoo Min <changwoo@...lia.com> wrote:
> >>
> >> When there is no entry in the free list (c->free_llist), unit_alloc()
> >> fails even when there is available memory in the system, causing allocation
> >> failure in various BPF calls -- such as bpf_mem_alloc() and
> >> bpf_cpumask_create().
> >>
> >> Such allocation failure can happen, especially when a BPF program tries many
> >> allocations -- more than a delta between high and low watermarks -- in an
> >> IRQ-disabled context.
> >
> > Can we add a selftests for this scenario?
>
> It would be a bit tricky to create an IRQ-disabled case in a BPF
> program. However, I think it will be possible to reproduce the
> allocation failure issue when allocating sufficiently enough
> small allocations.

You can also make use of recently introduced
bpf_local_irq_{save,restore} in the selftest.

>
> [...]
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ