* [PATCH] eal/linux: clear asan after allocation and before prefaulting
@ 2024-07-23 8:34 Alex Michon
2024-10-08 9:36 ` David Marchand
0 siblings, 1 reply; 4+ messages in thread
From: Alex Michon @ 2024-07-23 8:34 UTC (permalink / raw)
To: Thomas Monjalon, Anatoly Burakov; +Cc: dev, Alex Michon
Prefaulting may generate asan error.
Signed-off-by: Alex Michon <amichon@kalrayinc.com>
---
.mailmap | 1 +
lib/eal/linux/eal_memalloc.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/.mailmap b/.mailmap
index 3f3f0442e5..b1655a4080 100644
--- a/.mailmap
+++ b/.mailmap
@@ -60,6 +60,7 @@ Alexey Kardashevskiy <aik@ozlabs.ru>
Alex Kiselev <alex@bisonrouter.com> <alex@therouter.net>
Alex Marginean <alexandru.marginean@nxp.com>
Alex Markuze <alex@weka.io>
+Alex Michon <amichon@kalrayinc.com>
Alex Porosanu <alexandru.porosanu@nxp.com>
Alex Rosenbaum <alexr@nvidia.com> <alexr@mellanox.com>
Alex Vesker <valex@nvidia.com>
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index e354efc95d..b9c631ea88 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -38,6 +38,8 @@
#include "eal_memcfg.h"
#include "eal_private.h"
+#include "malloc_elem.h"
+
const int anonymous_hugepages_supported =
#ifdef MAP_HUGE_SHIFT
1;
@@ -636,6 +638,9 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,
goto mapped;
}
+ /* Ensure the prefault doesn't trigger ASAN errors */
+ asan_set_zone(addr, alloc_sz, 0);
+
/* we need to trigger a write to the page to enforce page fault and
* ensure that page is accessible to us, but we can't overwrite value
* that is already there, so read the old value, and write itback.
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] eal/linux: clear asan after allocation and before prefaulting
2024-07-23 8:34 [PATCH] eal/linux: clear asan after allocation and before prefaulting Alex Michon
@ 2024-10-08 9:36 ` David Marchand
2024-10-22 15:37 ` Alex Michon
0 siblings, 1 reply; 4+ messages in thread
From: David Marchand @ 2024-10-08 9:36 UTC (permalink / raw)
To: Alex Michon; +Cc: Thomas Monjalon, Anatoly Burakov, dev
On Thu, Jul 25, 2024 at 9:25 AM Alex Michon <amichon@kalrayinc.com> wrote:
>
> Prefaulting may generate asan error.
I am a bit surprised of this fix.
Could you give details on how to reproduce this issue?
--
David Marchand
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] eal/linux: clear asan after allocation and before prefaulting
2024-10-08 9:36 ` David Marchand
@ 2024-10-22 15:37 ` Alex Michon
2024-10-22 18:54 ` David Marchand
0 siblings, 1 reply; 4+ messages in thread
From: Alex Michon @ 2024-10-22 15:37 UTC (permalink / raw)
To: David Marchand; +Cc: Thomas Monjalon, Anatoly Burakov, dev
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
Hello David,
I ran some more tests and it turns out that this issue was already fixed by this commit:
4d8bdd8b56 malloc: fix ASan handling for unmapped memory
Sorry about the noise,
Alex
________________________________
From: David Marchand <david.marchand@redhat.com>
Sent: 08 October 2024 11:36
To: Alex Michon <amichon@kalrayinc.com>
Cc: Thomas Monjalon <thomas@monjalon.net>; Anatoly Burakov <anatoly.burakov@intel.com>; dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH] eal/linux: clear asan after allocation and before prefaulting
On Thu, Jul 25, 2024 at 9:25 AM Alex Michon <amichon@kalrayinc.com> wrote:
>
> Prefaulting may generate asan error.
I am a bit surprised of this fix.
Could you give details on how to reproduce this issue?
--
David Marchand
[-- Attachment #2: Type: text/html, Size: 2386 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] eal/linux: clear asan after allocation and before prefaulting
2024-10-22 15:37 ` Alex Michon
@ 2024-10-22 18:54 ` David Marchand
0 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2024-10-22 18:54 UTC (permalink / raw)
To: Alex Michon; +Cc: Thomas Monjalon, Anatoly Burakov, dev
Hello Alex,
On Tue, Oct 22, 2024 at 5:40 PM Alex Michon <amichon@kalrayinc.com> wrote:
>
> I ran some more tests and it turns out that this issue was already fixed by this commit:
> 4d8bdd8b56 malloc: fix ASan handling for unmapped memory
>
> Sorry about the noise,
No problem.
Thanks for the update.
--
David Marchand
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-22 18:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-23 8:34 [PATCH] eal/linux: clear asan after allocation and before prefaulting Alex Michon
2024-10-08 9:36 ` David Marchand
2024-10-22 15:37 ` Alex Michon
2024-10-22 18:54 ` David Marchand
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).