This adds a new set of sysctls that the Ksplice user-space can use for
feature tests. The first sysctl added is ksplice.init_trace_safe which
means that it is safe to trace a child_subreaper processes without
making them killable which was fixed in
2d39b3cd34 (signal: protect
SIGNAL_UNKILLABLE from unintentional clearing.).
Ksplice can now test this sysctl and use that to determine whether it is
safe to trace init or not. Future sysctls can be added for other
features, as well as kernel internal features for kernel Ksplice.
Orabug:
25414814
Signed-off-by: Jamie Iles <jamie.iles@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
kernel/Makefile
bool
source "kernel/gcov/Kconfig"
+
+config KSPLICE
+ bool "Ksplice"
+ depends on MODULES
+ select SYSCTL
+ help
+ Enable helper features for supporting Ksplice zero-downtime updates.
--- /dev/null
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ */
+#ifndef __LINUX_KSPLICE_H__
+#define __LINUX_KSPLICE_H__
+
+#include <linux/sysctl.h>
+
+extern const struct ctl_table ksplice_sysctls[];
+
+#endif /* __LINUX_KSPLICE_H__ */
obj-$(CONFIG_JUMP_LABEL) += jump_label.o
obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
obj-$(CONFIG_TORTURE_TEST) += torture.o
+obj-$(CONFIG_KSPLICE) += ksplice.o
$(obj)/configs.o: $(obj)/config_data.h
--- /dev/null
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ */
+#include <linux/ksplice.h>
+
+static int init_trace_safe = 1;
+
+const struct ctl_table ksplice_sysctls[] = {
+ {
+ .procname = "init_trace_safe",
+ .data = &init_trace_safe,
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .proc_handler = proc_dointvec,
+ },
+ { }
+};
#include <linux/binfmts.h>
#include <linux/sched/sysctl.h>
#include <linux/kexec.h>
+#include <linux/ksplice.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
.extra1 = &zero,
.extra2 = &one,
},
+#ifdef CONFIG_KSPLICE
+ {
+ .procname = "ksplice",
+ .mode = 0555,
+ .child = ksplice_sysctls,
+ },
+#endif
{ }
};