[PATCH bpf 0/4] lib/buildid: fix a few bugs

From: Chris Mason

Date: Thu Dec 03 2026 - 11:31:37 EST


Hi everyone,

These are AI generated fixes for a few buildid bugs.

Patches 1-3 add the checks that freader_fetch() needs before it calls
__kernel_read(). Without them, we can trigger a warning, overflow the
kernfs read buffer, or read from a socket.

Patch 4 limits the number of ELF notes we'll walk, so a bad file can't
lock up the CPU.

This is on top of v7.4-rc5.

Chris Mason (4):
lib/buildid: check FMODE_READ before __kernel_read()
lib/buildid: check the offset before __kernel_read()
lib/buildid: check the file type before __kernel_read()
lib/buildid: limit the number of ELF notes per parse

lib/buildid.c | 37 +++++++++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
--
2.55.0