Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6-1]: src/sys/compat/linux/common Pull up following revision(s) (...



details:   https://anonhg.NetBSD.org/src/rev/6cba14190441
branches:  netbsd-6-1
changeset: 776250:6cba14190441
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Aug 19 05:03:58 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1489):
        sys/compat/linux/common/linux_time.c: 1.38-1.39 via patch
Only let the superuser set the compat_linux timezone.
Not really keen to invent a new kauth cookie for this useless purpose.
>From Ilja Van Sprundel.
--
Put suser check in the right function: settimeofday, not gettimeofday.
While here, remove wrong comment.
Noted by kre@.

diffstat:

 sys/compat/linux/common/linux_time.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 5918357a4116 -r 6cba14190441 sys/compat/linux/common/linux_time.c
--- a/sys/compat/linux/common/linux_time.c      Sat Aug 19 04:44:53 2017 +0000
+++ b/sys/compat/linux/common/linux_time.c      Sat Aug 19 05:03:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_time.c,v 1.35 2011/11/18 04:07:44 christos Exp $ */
+/*     $NetBSD: linux_time.c,v 1.35.14.1 2017/08/19 05:03:58 snj Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.35 2011/11/18 04:07:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.35.14.1 2017/08/19 05:03:58 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -109,11 +109,10 @@
                        return (error);
        }
 
-       /*
-        * If user is not the superuser, we returned
-        * after the sys_settimeofday() call.
-        */
        if (SCARG(uap, tzp)) {
+               if (kauth_authorize_generic(kauth_cred_get(),
+                       KAUTH_GENERIC_ISSUSER, NULL) != 0)
+                       return (EPERM);
                error = copyin(SCARG(uap, tzp), &linux_sys_tz, sizeof(linux_sys_tz));
                if (error)
                        return (error);



Home | Main Index | Thread Index | Old Index