mirror of
https://git.FreeBSD.org/src.git
synced 2026-06-02 11:24:32 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user