[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Mar 2011 17:01:14 +0100
From: Richard Cochran <richardcochran@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
John Stultz <john.stultz@...aro.org>,
Richard Cochran <richard.cochran@...cron.at>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists