]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
linux-user/syscall.c: fix missed flag for shared memory in open_self_maps
authorAndrey Kazmin <a.kazmin@partner.samsung.com>
Mon, 27 Dec 2021 12:50:48 +0000 (15:50 +0300)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 6 Jan 2022 10:40:52 +0000 (11:40 +0100)
The possible variants for region type in /proc/self/maps are either
private "p" or shared "s". In the current implementation,
we mark shared regions as "-". It could break memory mapping parsers
such as included into ASan/HWASan sanitizers.

Fixes: 01ef6b9e4e4e ("linux-user: factor out reading of /proc/self/maps")
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20211227125048.22610-1-a.kazmin@partner.samsung.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c

index 01cd59cdce53d66903d76095225f2c1d4f32934c..3160d77154b567d45fefc25e404ad6660071f2d3 100644 (file)
@@ -8045,7 +8045,7 @@ static int open_self_maps(void *cpu_env, int fd)
                             (flags & PAGE_READ) ? 'r' : '-',
                             (flags & PAGE_WRITE_ORG) ? 'w' : '-',
                             (flags & PAGE_EXEC) ? 'x' : '-',
-                            e->is_priv ? 'p' : '-',
+                            e->is_priv ? 'p' : 's',
                             (uint64_t) e->offset, e->dev, e->inode);
             if (path) {
                 dprintf(fd, "%*s%s\n", 73 - count, "", path);