Skip to content

lib/buildid: fix a few bugs

Chris Mason bpf lkml sashiko-reviews 1 version Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyApplied 4/4

Patches in v1 All 4 applied

#Subject and filesSizeRepliesApplied
1/4lib/buildid: check FMODE_READ before __kernel_read()lib/buildid.c+6 -00 repliesApplied
2/4lib/buildid: check the offset before __kernel_read()lib/buildid.c+6 -00 repliesApplied
3/4lib/buildid: check the file type before __kernel_read()lib/buildid.c+7 -01 replyApplied
4/4lib/buildid: limit the number of ELF notes per parselib/buildid.c+12 -60 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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

Signature · 1 line
2.55.0