]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: consider 64bit addresses when scanning /proc/pid/map_files dir
authorMasatake YAMATO <yamato@redhat.com>
Wed, 30 Nov 2022 05:55:32 +0000 (14:55 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Wed, 30 Nov 2022 05:55:32 +0000 (14:55 +0900)
Close #1930.

The original code assumed 48bit addresses. This assumption came
from linux running on x86_64. As reported in #1930, Linux on
sparc64 uses 64bit addresses.

Tested-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd.c

index 256ff9a923759fad867eecaf3143d4d7e85e9d6a..ef35f49e81e066ef7d25617d4d8db3b0681af16c 100644 (file)
@@ -746,7 +746,7 @@ static void parse_maps_line(struct path_cxt *pc, char *buf, struct proc *proc)
                file_set_path(f, &sb, path, -assoc);
        } else {
                /* As used in tcpdump, AF_PACKET socket can be mmap'ed. */
-               char map_file[sizeof("map_files/000000000000-ffffffffffff")];
+               char map_file[sizeof("map_files/0000000000000000-ffffffffffffffff")];
                char sym[PATH_MAX] = { '\0' };
 
        try_map_files: