Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2026 19:53:05 +0000
From:      Pawel Biernacki <kaktus@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a64148e21bb4 - main - linux: Add support for PR_SET_VMA to prctl(2)
Message-ID:  <6a1b4021.27e7b.46004f5e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by kaktus:

URL: https://cgit.FreeBSD.org/src/commit/?id=a64148e21bb4ac976345cbedbd32942f97f07cc1

commit a64148e21bb4ac976345cbedbd32942f97f07cc1
Author:     Pawel Biernacki <kaktus@FreeBSD.org>
AuthorDate: 2026-05-30 12:15:21 +0000
Commit:     Pawel Biernacki <kaktus@FreeBSD.org>
CommitDate: 2026-05-30 19:52:58 +0000

    linux: Add support for PR_SET_VMA to prctl(2)
    
    Implement dummy support for PR_SET_VMA with PR_SET_VMA_ANON_NAME in
    prctl(2).  This prevents applications from receiving EINVAL when
    attempting to name anonymous memory regions.
---
 sys/compat/linux/linux_misc.c | 7 +++++++
 sys/compat/linux/linux_misc.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index f89758f41ba0..eafba4f4bd19 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1835,6 +1835,13 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args)
 		linux_msg(td, "unsupported prctl PR_SET_PTRACER");
 		error = EINVAL;
 		break;
+	case LINUX_PR_SET_VMA:
+		if (args->arg2 != LINUX_PR_SET_VMA_ANON_NAME) {
+			linux_msg(td, "unsupported prctl PR_SET_VMA attr %ju",
+			    (uintmax_t)args->arg2);
+			error = EINVAL;
+		}
+		break;
 	default:
 		linux_msg(td, "unsupported prctl option %d", args->option);
 		error = EINVAL;
diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h
index 2044f23f30ee..196f9372d4bf 100644
--- a/sys/compat/linux/linux_misc.h
+++ b/sys/compat/linux/linux_misc.h
@@ -62,6 +62,8 @@
 #define	LINUX_PR_SET_NO_NEW_PRIVS	38 /* Set no_new_privs attribute */
 #define	LINUX_PR_GET_NO_NEW_PRIVS	39 /* Get no_new_privs attribute */
 #define	LINUX_PR_SET_PTRACER	1499557217
+#define	LINUX_PR_SET_VMA	1398164801
+#define	LINUX_PR_SET_VMA_ANON_NAME	0
 
 #define	LINUX_MAX_COMM_LEN	16	/* Maximum length of the process name. */
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a1b4021.27e7b.46004f5e>