]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - kernel/sysctl.c
UBUNTU: [Config] Disble stack protector for powerpc-smp
[mirror_ubuntu-zesty-kernel.git] / kernel / sysctl.c
index 8dbaec0e4f7f079b87f50ea67c82341304387783..8adb223c9652a664799011dac18ab972010aa384 100644 (file)
@@ -66,6 +66,7 @@
 #include <linux/kexec.h>
 #include <linux/bpf.h>
 #include <linux/mount.h>
+#include <linux/efi.h>
 
 #include <linux/uaccess.h>
 #include <asm/processor.h>
@@ -104,6 +105,9 @@ extern int core_uses_pid;
 extern char core_pattern[];
 extern unsigned int core_pipe_limit;
 #endif
+#ifdef CONFIG_USER_NS
+extern int unprivileged_userns_clone;
+#endif
 extern int pid_max;
 extern int pid_max_min, pid_max_max;
 extern int percpu_pagelist_fraction;
@@ -280,7 +284,37 @@ static int min_extfrag_threshold;
 static int max_extfrag_threshold = 1000;
 #endif
 
+static unsigned int secure_boot_enabled;
+int secure_boot_proc_handler(struct ctl_table *table, int write,
+       void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       secure_boot_enabled = efi_enabled(EFI_SECURE_BOOT);
+       return proc_dointvec(table, write, buffer, lenp, ppos);
+}
+
+static unsigned int moksbstate_disabled;
+int moksbstate_disabled_proc_handler(struct ctl_table *table, int write,
+       void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       moksbstate_disabled = efi_enabled(EFI_MOKSBSTATE_DISABLED);
+       return proc_dointvec(table, write, buffer, lenp, ppos);
+}
+
 static struct ctl_table kern_table[] = {
+       {
+               .procname   = "secure_boot",
+               .data       = &secure_boot_enabled,
+               .maxlen     = sizeof(unsigned int),
+               .mode       = 0444,
+               .proc_handler   = secure_boot_proc_handler,
+       },
+       {
+               .procname   = "moksbstate_disabled",
+               .data       = &moksbstate_disabled,
+               .maxlen     = sizeof(unsigned int),
+               .mode       = 0444,
+               .proc_handler   = moksbstate_disabled_proc_handler,
+       },
        {
                .procname       = "sched_child_runs_first",
                .data           = &sysctl_sched_child_runs_first,
@@ -490,6 +524,15 @@ static struct ctl_table kern_table[] = {
                .proc_handler   = proc_dointvec,
        },
 #endif
+#ifdef CONFIG_USER_NS
+       {
+               .procname       = "unprivileged_userns_clone",
+               .data           = &unprivileged_userns_clone,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec,
+       },
+#endif
 #ifdef CONFIG_PROC_SYSCTL
        {
                .procname       = "tainted",
@@ -2475,6 +2518,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
                                break;
                        if (neg)
                                continue;
+                       val = convmul * val / convdiv;
                        if ((min && val < *min) || (max && val > *max))
                                continue;
                        *i = val;