Merge tag 'block-6.1-2022-10-13' of git://git.kernel.dk/linux
[platform/kernel/linux-starfive.git] / kernel / sys.c
index 8a64324..5fd54bf 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/times.h>
 #include <linux/posix-timers.h>
 #include <linux/security.h>
+#include <linux/random.h>
 #include <linux/suspend.h>
 #include <linux/tty.h>
 #include <linux/signal.h>
@@ -1366,6 +1367,7 @@ SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
        if (!copy_from_user(tmp, name, len)) {
                struct new_utsname *u;
 
+               add_device_randomness(tmp, len);
                down_write(&uts_sem);
                u = utsname();
                memcpy(u->nodename, tmp, len);
@@ -1419,6 +1421,7 @@ SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
        if (!copy_from_user(tmp, name, len)) {
                struct new_utsname *u;
 
+               add_device_randomness(tmp, len);
                down_write(&uts_sem);
                u = utsname();
                memcpy(u->domainname, tmp, len);