From: Pavel Emelyanov Date: Thu, 29 Nov 2007 00:21:38 +0000 (-0800) Subject: Isolate the UTS namespace's domainname and hostname back X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=32df81cbd5b41d281cc3d7e7ff6a98ac6201e197;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Isolate the UTS namespace's domainname and hostname back Commit 7d69a1f4a72b18876c99c697692b78339d491568 ("remove CONFIG_UTS_NS and CONFIG_IPC_NS") by Cedric Le Goater accidentally removed the code that prevented the uts->hostname and uts->domainname values from being overwritten from another namespace. In other words, setting hostname/domainname via sysfs (echo xxx > /proc/sys/kernel/(host|domain)name) cased the new value to be set in init UTS namespace only. Return the isolation back. Signed-off-by: Pavel Emelyanov Acked-by: Cedric Le Goater Acked-by: Serge Hallyn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index c76c06466bfd..fe3a56c2256d 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c @@ -18,6 +18,10 @@ static void *get_uts(ctl_table *table, int write) { char *which = table->data; + struct uts_namespace *uts_ns; + + uts_ns = current->nsproxy->uts_ns; + which = (which - (char *)&init_uts_ns) + (char *)uts_ns; if (!write) down_read(&uts_sem);