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]
Message-ID: <20110304072239.GA8957@riccoc20.at.omicron.at>
Date:	Fri, 4 Mar 2011 08:22:39 +0100
From:	Richard Cochran <richardcochran@...il.com>
To:	Torben Hohn <torbenh@....de>
Cc:	linux-kernel@...r.kernel.org, richard.cochran@...cron.at,
	johnstul@...ibm.com, tglx@...utronix.de
Subject: Re: [PATCH 3/3] Check for write permission on FD based posix-clocks

On Thu, Mar 03, 2011 at 06:26:14PM +0100, Torben Hohn wrote:
> pc_clock_settime() and pc_clock_adjtime() did not check
> whether the fd was opened in write mode.
> 
> It was possible to set a clock, when we only had read
> permissions.
> 
> for completeness, we would also need to check for Read permissions
> on the read operations. but that would be a bit paranoid, probably.

I have no objection to this form of clock access control, but I would
like to get agreement about it from the list.

> diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
> index 04498cb..25028dd 100644
> --- a/kernel/time/posix-clock.c
> +++ b/kernel/time/posix-clock.c
> @@ -287,11 +287,16 @@ static int pc_clock_adjtime(clockid_t id, struct timex *tx)
>  	if (err)
>  		return err;
>  
> +	if ((cd.fp->f_mode & FMODE_WRITE) == 0) {
> +		err = -EACCES;

Looks like clock_settime and adjtimex are supposed to return EPERM in
this case.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ