Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/procfs: remove build ID-related code duplication in PROCMAP_QUERY

A piece of build ID handling code in PROCMAP_QUERY ioctl() was
accidentally duplicated. It wasn't meant to be part of ed5d583a88a9
("fs/procfs: implement efficient VMA querying API for /proc/<pid>/maps")
commit, which is what introduced duplication.

It has no correctness implications, but we unnecessarily perform the same
work twice, if build ID parsing is requested. Drop the duplication.

Link: https://lkml.kernel.org/r/20240729174044.4008399-1-andrii@kernel.org
Fixes: ed5d583a88a9 ("fs/procfs: implement efficient VMA querying API for /proc/<pid>/maps")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reported-by: Jann Horn <jannh@google.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Andrii Nakryiko and committed by
Andrew Morton
00bd8ec2 b6e21b71

-15
-15
fs/proc/task_mmu.c
··· 543 543 } 544 544 } 545 545 546 - if (karg.build_id_size) { 547 - __u32 build_id_sz; 548 - 549 - err = build_id_parse(vma, build_id_buf, &build_id_sz); 550 - if (err) { 551 - karg.build_id_size = 0; 552 - } else { 553 - if (karg.build_id_size < build_id_sz) { 554 - err = -ENAMETOOLONG; 555 - goto out; 556 - } 557 - karg.build_id_size = build_id_sz; 558 - } 559 - } 560 - 561 546 if (karg.vma_name_size) { 562 547 size_t name_buf_sz = min_t(size_t, PATH_MAX, karg.vma_name_size); 563 548 const struct path *path;