lkml.org 
[lkml]   [2011]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 28/28] posix clocks: Introduce dynamic clocks
On Thu, Mar 03, 2011 at 03:50:08PM +0100, torbenh wrote:
> On Tue, Feb 01, 2011 at 01:52:35PM -0000, Thomas Gleixner wrote:
> > +static int pc_clock_adjtime(clockid_t id, struct timex *tx)
> > +{
> > + struct posix_clock_desc cd;
> > + int err;
> > +
> > + err = get_clock_desc(id, &cd);
> > + if (err)
> > + return err;
>
> there is no permission check here.
> if i get the clock fd in READ mode, i can still adjtime.
> same for settime.

You are right, but I think the check should be for the capability
instead. Checking the file mode for RDWR seems a bit pedantic to me.

For the normal system timer, clock_settime calls security_settime, but
adjtimex calls capable(CAP_SYS_TIME) directly. Perhaps adjtimex should
also use the security call, too.

Thanks,

Richard



\
 
 \ /
  Last update: 2011-03-03 17:05    [W:0.247 / U:25.500 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site