|
|
Subscribe / Log in / New account

Red-black trees for BPF programs

Red-black trees for BPF programs

Posted Feb 28, 2023 1:15 UTC (Tue) by NYKevin (subscriber, #129325)
In reply to: Red-black trees for BPF programs by mathstuf
Parent article: Red-black trees for BPF programs

Looking through the patches and comments, it looks like it's doing some kind of funky non-owned ref logic to protect against that, but I don't speak kernel-C well enough to understand exactly how it all works. In particular, I couldn't figure out where it prevents you from passing a different less (but I didn't look very hard, frankly).


to post comments

Red-black trees for BPF programs

Posted Feb 28, 2023 2:21 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

The non-owned ref logic can help prevent mutating the nodes in the `less` function (I presume/hope that `const_cast` spell in the C way is verbotten as well?). But are there any BPF rules that forbid referencing some BPF map, mutable global variable, or volatile (to BPF) kernel data binding?


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds