summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-report
diff options
context:
space:
mode:
authorJake Labelle <southampton.jake.labelle@gmail.com>2026-10-08 20:52:48 +0900
committerViacheslav Dubeyko <slava@dubeyko.com>2026-10-08 09:39:43 -0700
commitde7f49c12566cc5c7437a2f26c6c754b9d4d5648 (patch)
treeb12b40068db5b21a1b47ed5c239940306f87eb1b /tools/perf/scripts/python/bin/stackcollapse-report
parentef2ccb1554df254eb4066171ce93e6d5fb1af2e3 (diff)
downloadlinux-de7f49c12566cc5c7437a2f26c6c754b9d4d5648.tar.gz
linux-de7f49c12566cc5c7437a2f26c6c754b9d4d5648.zip
nilfs2: validate directory position after llseek in readdir
nilfs_readdir() uses ctx->pos, which userspace can set to an arbitrary value via llseek, as an offset into the directory folio and parses whatever bytes sit there as a directory entry. A position pointing into the middle of an entry -- or at unused bytes of a corrupted image that the page validator never inspected -- makes dir_emit() copy up to 255 (name_len) bytes from a bogus entry, possibly reading past the end of the folio and returning unrelated memory contents to userspace. Snap unaligned positions onto a valid entry boundary by walking the rec_len chain from the chunk start before parsing, as ext2 does in ext2_validate_entry(). [ryusuke: fixed offset wrap-around in nilfs_validate_entry() and conformed AI tag to guidelines] Fixes: 2ba466d74ed7 ("nilfs2: directory entry operations") Assisted-by: Claude:claude-mythos-5 Signed-off-by: Jake Labelle <southampton.jake.labelle@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions