All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps
       [not found] <CGME20211227125057eucas1p14ebd7c0d73df4a25abc40bfa3fe0c3f2@eucas1p1.samsung.com>
@ 2021-12-27 12:50 ` Andrey Kazmin
  2021-12-27 21:09   ` Laurent Vivier
  2022-01-05 10:19   ` Laurent Vivier
  0 siblings, 2 replies; 4+ messages in thread
From: Andrey Kazmin @ 2021-12-27 12:50 UTC (permalink / raw)
  To: a.kazmin, qemu-devel

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.

Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 56a3e17183..2199a98725 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7790,7 +7790,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);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps
  2021-12-27 12:50 ` [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps Andrey Kazmin
@ 2021-12-27 21:09   ` Laurent Vivier
  2022-01-05 14:54     ` Alex Bennée
  2022-01-05 10:19   ` Laurent Vivier
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Vivier @ 2021-12-27 21:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Le 27/12/2021 à 13:50, Andrey Kazmin a écrit :
> 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.
> 
> Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
> ---
>   linux-user/syscall.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 56a3e17183..2199a98725 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7790,7 +7790,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);

Fixes: 01ef6b9e4e4e ("linux-user: factor out reading of /proc/self/maps")
Cc: alex.bennee@linaro.org
Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps
  2021-12-27 12:50 ` [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps Andrey Kazmin
  2021-12-27 21:09   ` Laurent Vivier
@ 2022-01-05 10:19   ` Laurent Vivier
  1 sibling, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-01-05 10:19 UTC (permalink / raw)
  To: Andrey Kazmin, qemu-devel

Le 27/12/2021 à 13:50, Andrey Kazmin a écrit :
> 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.
> 
> Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
> ---
>   linux-user/syscall.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 56a3e17183..2199a98725 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7790,7 +7790,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);


Applied to my linux-user-for-7.0 branch.

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps
  2021-12-27 21:09   ` Laurent Vivier
@ 2022-01-05 14:54     ` Alex Bennée
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2022-01-05 14:54 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: qemu-devel


Laurent Vivier <laurent@vivier.eu> writes:

> Le 27/12/2021 à 13:50, Andrey Kazmin a écrit :
>> 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.
>> Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>

Acked-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-05 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20211227125057eucas1p14ebd7c0d73df4a25abc40bfa3fe0c3f2@eucas1p1.samsung.com>
2021-12-27 12:50 ` [PATCH] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps Andrey Kazmin
2021-12-27 21:09   ` Laurent Vivier
2022-01-05 14:54     ` Alex Bennée
2022-01-05 10:19   ` Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.