From: Michael Kerrisk <mtk.manpages@gmail.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>,
lkml <linux-kernel@vger.kernel.org>,
john stultz <johnstul@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>
Subject: [patch] ADJ_OFFSET_SS_READ and capabilities
Date: Sun, 22 Jun 2008 09:32:59 +0200 [thread overview]
Message-ID: <485E002B.5010101@gmail.com> (raw)
In-Reply-To: <485DF41E.9020909@gmail.com>
Hi Roman, John,
ADJ_OFFSET_SS_READ is a read-only operation. Therefore, it seems
reasonable not to require any capability (as is the case when 'modes'
is zero. See the patch below. Does this change seem reasonable?
Cheers,
Michael
--- linux-2.6.26-rc5/kernel/time/ntp.c 2008-06-13 11:16:51.000000000 +0200
+++ linux-2.6.26-rc5-p/kernel/time/ntp.c 2008-06-22 07:31:43.000000000 +0200
@@ -281,7 +281,8 @@
int result;
/* In order to modify anything, you gotta be super-user! */
- if (txc->modes && !capable(CAP_SYS_TIME))
+ if (txc->modes && txc->modes != ADJ_OFFSET_SS_READ &&
+ !capable(CAP_SYS_TIME))
return -EPERM;
/* Now we validate the data before disabling interrupts */
next parent reply other threads:[~2008-06-23 8:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <485DF41E.9020909@gmail.com>
2008-06-22 7:32 ` Michael Kerrisk [this message]
2008-06-30 22:07 ` [patch] ADJ_OFFSET_SS_READ and capabilities john stultz
2008-07-21 10:38 ` Michael Kerrisk
2008-06-22 7:33 ` [patch] adjtimex() modes argument checking Michael Kerrisk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=485E002B.5010101@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox