lkml.org 
[lkml]   [2008]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] ADJ_OFFSET_SS_READ and capabilities
From
Date

On Sun, 2008-06-22 at 09:32 +0200, Michael Kerrisk wrote:
> Hi Roman, John,
>
> ADJ_OFFSET_SS_READ is a read-only operation. Therefore, it seems
> reasonable not to require any capability (as is the case when 'modes'
> is zero. See the patch below. Does this change seem reasonable?
>
> Cheers,
>
> Michael
>
> --- linux-2.6.26-rc5/kernel/time/ntp.c 2008-06-13 11:16:51.000000000 +0200
> +++ linux-2.6.26-rc5-p/kernel/time/ntp.c 2008-06-22 07:31:43.000000000 +0200
> @@ -281,7 +281,8 @@
> int result;
>
> /* In order to modify anything, you gotta be super-user! */
> - if (txc->modes && !capable(CAP_SYS_TIME))
> + if (txc->modes && txc->modes != ADJ_OFFSET_SS_READ &&
> + !capable(CAP_SYS_TIME))
> return -EPERM;
>
> /* Now we validate the data before disabling interrupts */
>


Hey Michael,
This seems like an ok change, but we'd first want to fix the issue you
pointed out earlier which would make sure adjtimex() read calls don't
cause side effects.

thanks
-john





\
 
 \ /
  Last update: 2008-07-01 00:11    [W:0.205 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site