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: <90eda54b-6898-40bb-adbb-409404ad185f@igalia.com>
Date: Thu, 13 Feb 2025 19:11:47 +0900
From: Changwoo Min <changwoo@...lia.com>
To: Kumar Kartikeya Dwivedi <memxor@...il.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

Hello Kumar,

On 25. 2. 13. 18:05, Kumar Kartikeya Dwivedi wrote:
> 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.

Thank you for the suggestion. I will try it out.

Regards,
Changwoo Min


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ