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 05:01:14PM +0100, Richard Cochran wrote:
> 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.

i dont see, why an fd based clock, which already has associated permissions,
should check against the capability.
why should the ptpd be running as root ?
changing the permissions of /dev/ptp0 to allow ptpd to set the
clock should be enough.

>
> 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.

probably yes.

>
> Thanks,
>
> Richard
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
torben Hohn


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