On Fri, 29 Aug 2025 at 10:02, Steven Rostedt <rost...@goodmis.org> wrote: > > Note, the ring buffer can be mapped to user space. So anything written into > the buffer is already exposed.
Oh, good point. Yeah, that means that you have to do the hashing immediately. Too bad. Because while 'vma->vm_file' is basically free (since you have to access the vma for other reasons anyway), a good hash isn't. siphash is good and fast for being what it is, but it's not completely free. It's something like 50 shift/xor pairs, and it obviously needs to also access that secret hash value that is likely behind a cache miss.. Still, I suspect it's the best we've got. (If hashing is noticeable, it *might* be worth it to use 'siphash_1u32()' and only hash 32 bits of the pointers. That makes the hashing slightly cheaper, and since the low bits of the pointer will be zero anyway due to alignment, and the high bits don't have a lot of information in them either, it doesn't actually remove much information. You might get collissions if the two pointers are exactly 32 GB apart or whatever, but that sounds really really unlucky) Linus