* [PATCH] fs/procfs: remove build ID-related code duplication in PROCMAP_QUERY
@ 2024-07-29 17:40 Andrii Nakryiko
0 siblings, 0 replies; only message in thread
From: Andrii Nakryiko @ 2024-07-29 17:40 UTC (permalink / raw)
To: linux-mm, akpm
Cc: linux-fsdevel, linux-kernel, adobriyan, Andrii Nakryiko,
Jann Horn
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.
Reported-by: Jann Horn <jannh@google.com>
Fixes: ed5d583a88a9 ("fs/procfs: implement efficient VMA querying API for /proc/<pid>/maps")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
fs/proc/task_mmu.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 5f171ad7b436..3ba613052506 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -543,21 +543,6 @@ static int do_procmap_query(struct proc_maps_private *priv, void __user *uarg)
}
}
- if (karg.build_id_size) {
- __u32 build_id_sz;
-
- err = build_id_parse(vma, build_id_buf, &build_id_sz);
- if (err) {
- karg.build_id_size = 0;
- } else {
- if (karg.build_id_size < build_id_sz) {
- err = -ENAMETOOLONG;
- goto out;
- }
- karg.build_id_size = build_id_sz;
- }
- }
-
if (karg.vma_name_size) {
size_t name_buf_sz = min_t(size_t, PATH_MAX, karg.vma_name_size);
const struct path *path;
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-29 17:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 17:40 [PATCH] fs/procfs: remove build ID-related code duplication in PROCMAP_QUERY Andrii Nakryiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).