<div dir="auto"><div dir="auto">Please don't split message a across multiple lines.</div><div dir="auto">Open and access are not the same in all security checks, so not a great idea.</div><div dir="auto">Some analyzer tools may flag as time of check, time of use issue.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 7, 2025, 02:50 Jake Freeland <<a href="mailto:jfree@freebsd.org" target="_blank" rel="noreferrer">jfree@freebsd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Currently, hugepage mountpoints will be used irrespective of permissions,<br>
leading to potential EACCES errors during memory allocation. Fix this by<br>
not using a mountpoint if we do not have read/write permissions on it.<br>
<br>
Signed-off-by: Jake Freeland <jfree@FreeBSD.org><br>
---<br>
 lib/eal/linux/eal_hugepage_info.c | 6 ++++++<br>
 1 file changed, 6 insertions(+)<br>
<br>
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c<br>
index d47a19c56a..dbfa38b05c 100644<br>
--- a/lib/eal/linux/eal_hugepage_info.c<br>
+++ b/lib/eal/linux/eal_hugepage_info.c<br>
@@ -260,6 +260,12 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)<br>
                                continue;<br>
                }<br>
<br>
+               if (access(splitstr[MOUNTPT], R_OK | W_OK) < 0) {<br>
+                       EAL_LOG(NOTICE, "Missing r/w permissions on huge dir: "<br>
+                           "'%s'. Skipping it", splitstr[MOUNTPT]);<br>
+                       continue;<br>
+               }<br>
+<br>
                /*<br>
                 * If no --huge-dir option has been given, we're done.<br>
                 */<br>
-<br></blockquote></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
</blockquote></div></div>