X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=kernel%2Fsys.c;h=01df5c4b252fdf7ee91cc2610f0651fca0032c04;hb=bd90e22278ca4f153d20cce4514936a106e64861;hp=2855ee73acd0ef9f62699ff669659e045df84422;hpb=33611ba0fed7c7f7768aeb5e0dcda85cc8cf74c4;p=mirror_ubuntu-artful-kernel.git diff --git a/kernel/sys.c b/kernel/sys.c index 2855ee73acd0..01df5c4b252f 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -60,6 +60,8 @@ #include #include +#include + #include /* Move somewhere else to avoid recompiling? */ #include @@ -1131,6 +1133,21 @@ out: DECLARE_RWSEM(uts_sem); +#ifdef COMPAT_UTS_MACHINE +static char compat_uts_machine[__OLD_UTS_LEN+1] = COMPAT_UTS_MACHINE; + +static int __init parse_compat_uts_machine(char *arg) +{ + strncpy(compat_uts_machine, arg, __OLD_UTS_LEN); + compat_uts_machine[__OLD_UTS_LEN] = 0; + return 0; +} +early_param("compat_uts_machine", parse_compat_uts_machine); + +#undef COMPAT_UTS_MACHINE +#define COMPAT_UTS_MACHINE compat_uts_machine +#endif + #ifdef COMPAT_UTS_MACHINE #define override_architecture(name) \ (personality(current->personality) == PER_LINUX32 && \ @@ -2187,6 +2204,17 @@ static int propagate_has_child_subreaper(struct task_struct *p, void *data) return 1; } +int __weak arch_prctl_spec_ctrl_get(struct task_struct *t, unsigned long which) +{ + return -EINVAL; +} + +int __weak arch_prctl_spec_ctrl_set(struct task_struct *t, unsigned long which, + unsigned long ctrl) +{ + return -EINVAL; +} + SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5) { @@ -2389,6 +2417,16 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, case PR_GET_FP_MODE: error = GET_FP_MODE(me); break; + case PR_GET_SPECULATION_CTRL: + if (arg3 || arg4 || arg5) + return -EINVAL; + error = arch_prctl_spec_ctrl_get(me, arg2); + break; + case PR_SET_SPECULATION_CTRL: + if (arg4 || arg5) + return -EINVAL; + error = arch_prctl_spec_ctrl_set(me, arg2, arg3); + break; default: error = -EINVAL; break;