[Devel] [PATCH RHEL9 COMMIT] oracle/mm: madv_doexec_flag sysctl
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jan 23 23:35:47 MSK 2025
The commit is pushed to "branch-rh9-5.14.0-427.44.1.vz9.80.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.44.1.vz9.80.5
------>
commit ac2f43aeebdad6a8b6e44c26d4a75ee3383af2e1
Author: Steve Sistare <steven.sistare at oracle.com>
Date: Tue Oct 27 16:48:37 2020 -0700
oracle/mm: madv_doexec_flag sysctl
Export the value of MADV_DOEXEC in /proc/sys/vm/madv_doexec_flag in case
it must change due to a conflict with upstream. Applications must use the
sysctl until the flag is upstreamed, and UEK will provide the sysctl until
the apps are updated to use the final value.
Orabug: 32387875
Signed-off-by: Steve Sistare <steven.sistare at oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett at Oracle.com>
https://virtuozzo.atlassian.net/browse/VSTOR-96305
(cherry picked from Oracle commit 4e520e5b5f4d4ea5be3d1ee5759bf1453580e896)
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
Feature: oracle/mm: MADV_DOEXEC madvise() flag
---
include/linux/mm.h | 1 +
kernel/sysctl.c | 7 +++++++
mm/madvise.c | 2 ++
3 files changed, 10 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0aa3e411fedf..d2ce7bded6da 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -3317,6 +3317,7 @@ extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm);
extern int sysctl_drop_caches;
int drop_caches_sysctl_handler(struct ctl_table *, int, void *, size_t *,
loff_t *);
+extern int madv_doexec_flag;
#endif
void drop_slab(void);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 532a13d25394..0a06aee8f772 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2277,6 +2277,13 @@ static struct ctl_table kern_table[] = {
};
static struct ctl_table vm_table[] = {
+ {
+ .procname = "madv_doexec_flag",
+ .data = &madv_doexec_flag,
+ .maxlen = sizeof (int),
+ .mode = 0444,
+ .proc_handler = proc_dointvec,
+ },
{
.procname = "overcommit_memory",
.data = &sysctl_overcommit_memory,
diff --git a/mm/madvise.c b/mm/madvise.c
index 8cab55109411..2458d6ccdeb2 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -37,6 +37,8 @@
#include "internal.h"
#include "swap.h"
+int madv_doexec_flag = MADV_DOEXEC;
+
struct madvise_walk_private {
struct mmu_gather *tlb;
bool pageout;
More information about the Devel
mailing list