Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/226f6a667488
branches:  netbsd-8
changeset: 434189:226f6a667488
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Aug 08 15:59:04 2017 +0000

description:
Pull up following revision(s) (requested by spz in ticket #188):
        sys/compat/linux/common/linux_time.c: revision 1.38
        sys/compat/linux/common/linux_time.c: revision 1.39
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 9301f532ae85 -r 226f6a667488 sys/compat/linux/common/linux_time.c
--- a/sys/compat/linux/common/linux_time.c      Sat Aug 05 05:12:46 2017 +0000
+++ b/sys/compat/linux/common/linux_time.c      Tue Aug 08 15:59:04 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $ */
+/*     $NetBSD: linux_time.c,v 1.37.22.1 2017/08/08 15:59:04 martin 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.37 2014/01/13 10:33:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37.22.1 2017/08/08 15:59:04 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -102,11 +102,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