[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sersyvuc.ffs@tglx>
Date: Fri, 15 Nov 2024 23:29:31 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Kunwu Chan <kunwu.chan@...ux.dev>, Kunwu Chan <kunwu.chan@...ux.dev>,
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,
bigeasy@...utronix.de, clrkwllms@...nel.org, rostedt@...dmis.org
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rt-devel@...ts.linux.dev,
syzbot+b506de56cbbb63148c33@...kaller.appspotmail.com
Subject: Re: [PATCH] bpf: Convert lpm_trie::lock to 'raw_spinlock_t'
On Thu, Nov 14 2024 at 10:43, Kunwu Chan wrote:
> On 2024/11/12 23:08, Thomas Gleixner wrote:
>>> @@ -330,7 +330,7 @@ static long trie_update_elem(struct bpf_map *map,
>>> if (key->prefixlen > trie->max_prefixlen)
>>> return -EINVAL;
>>>
>>> - spin_lock_irqsave(&trie->lock, irq_flags);
>>> + raw_spin_lock_irqsave(&trie->lock, irq_flags);
>>>
>>> /* Allocate and fill a new node */
>> Making this a raw spinlock moves the problem from the BPF trie code into
>> the memory allocator. On RT the memory allocator cannot be invoked under
>> a raw spinlock.
> I'am newbiee in this field. But actually when i change it to a raw
> spinlock, the problem syzbot reported dispeared.
Yes, because the actual code path which is going to trigger this, is not
reached. But it will be reached at some point.
IIRC, BPF has it's own allocator which can be used everywhere.
Thanks,
tglx
Powered by blists - more mailing lists