lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 3 Mar 2011 15:50:08 +0100
From:	torbenh <torbenh@....de>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	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 Tue, Feb 01, 2011 at 01:52:35PM -0000, Thomas Gleixner wrote:
> From: Richard Cochran <richardcochran@...il.com>
> 
> This patch adds support for adding and removing posix clocks. The
> clock lifetime cycle is patterned after usb devices. Each clock is
> represented by a standard character device. In addition, the driver
> may optionally implement custom character device operations.
> 
> The posix clock and timer system calls listed below now work with
> dynamic posix clocks, as well as the traditional static clocks.
> The following system calls are affected:
> 
>    - clock_adjtime (brand new syscall)
>    - clock_gettime
>    - clock_getres
>    - clock_settime
>    - timer_create
>    - timer_delete
>    - timer_gettime
>    - timer_settime
> 
> [ tglx: Adapted to the posix-timer cleanup. Moved clock_posix_dynamic
>   	to posix-clock.c and made all referenced functions static ]
> 
> Signed-off-by: Richard Cochran <richard.cochran@...cron.at>
> Cc: John Stultz <john.stultz@...aro.org>
> LKML-Reference: <21258f45fcc5e08a595f411c7760f3ccc18964bb.1296124770.git.richard.cochran@...cron.at>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>  include/linux/posix-clock.h  |  150 ++++++++++++++
>  include/linux/posix-timers.h |    6 
>  kernel/posix-timers.c        |    4 
>  kernel/time/Makefile         |    3 
>  kernel/time/posix-clock.c    |  441 +++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 601 insertions(+), 3 deletions(-)
>  create mode 100644 include/linux/posix-clock.h
>  create mode 100644 kernel/time/posix-clock-syscalls.h
>  create mode 100644 kernel/time/posix-clock.c



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

> +
> +	if (cd.clk->ops.clock_adjtime)
> +		err = cd.clk->ops.clock_adjtime(cd.clk, tx);
> +	else
> +		err = -EOPNOTSUPP;
> +
> +	put_clock_desc(&cd);
> +
> +	return err;
> +}




-- 
torben Hohn
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ