From: Andrew Morton <akpm@linux-foundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Josh Boyer <jwboyer@redhat.com>, Kay Sievers <kay@vrfy.org>,
linux-kernel@vger.kernel.org, Eric Paris <eparis@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] kmsg: honor dmesg_restrict sysctl on /dev/kmsg
Date: Wed, 8 May 2013 14:22:23 -0700 [thread overview]
Message-ID: <20130508142223.c4497dc285600f30cc56d21a@linux-foundation.org> (raw)
In-Reply-To: <20130430172541.GA23382@www.outflux.net>
On Tue, 30 Apr 2013 10:25:41 -0700 Kees Cook <keescook@chromium.org> wrote:
> To fix /dev/kmsg, let's compare the existing interfaces and what they allow:
>
> - /proc/kmsg allows:
> - open (SYSLOG_ACTION_OPEN) if CAP_SYSLOG since it uses a destructive
> single-reader interface (SYSLOG_ACTION_READ).
> - everything, after an open.
>
> - syslog syscall allows:
> - anything, if CAP_SYSLOG.
> - SYSLOG_ACTION_READ_ALL and SYSLOG_ACTION_SIZE_BUFFER, if dmesg_restrict==0.
> - nothing else (EPERM).
>
> The use-cases were:
> - dmesg(1) needs to do non-destructive SYSLOG_ACTION_READ_ALLs.
> - sysklog(1) needs to open /proc/kmsg, drop privs, and still issue the
> destructive SYSLOG_ACTION_READs.
>
> AIUI, dmesg(1) is moving to /dev/kmsg, and systemd-journald doesn't
> clear the ring buffer.
>
> Based on the comments in devkmsg_llseek, it sounds like actions besides
> reading aren't going to be supported by /dev/kmsg (i.e. SYSLOG_ACTION_CLEAR),
> so we have a strict subset of the non-destructive syslog syscall actions.
>
> To this end, move the check as Josh had done, but also rename the constants
> to reflect their new uses (SYSLOG_FROM_CALL becomes SYSLOG_FROM_READER, and
> SYSLOG_FROM_FILE becomes SYSLOG_FROM_PROC). SYSLOG_FROM_READER allows
> non-destructive actions, and SYSLOG_FROM_PROC allows destructive actions
> after a capabilities-constrained SYSLOG_ACTION_OPEN check.
>
> - /dev/kmsg allows:
> - open if CAP_SYSLOG or dmesg_restrict==0
> - reading/polling, after open
hm, that changelog is waaaay down in the weeds and anyone who hasn't
been following this with a microscope won't have a clue.
I went into an earlier patch and dug out this:
: The dmesg_restrict sysctl currently covers the syslog method for access
: dmesg, however /dev/kmsg isn't covered by the same protections. Most
: people haven't noticed because util-linux dmesg(1) defaults to using the
: syslog method for access in older versions. With util-linux dmesg(1)
: defaults to reading directly from /dev/kmsg.
:
: Addresses https://bugzilla.redhat.com/show_bug.cgi?id=903192
Which is still accurate and relevant, yes?
next prev parent reply other threads:[~2013-05-08 21:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 17:25 Kees Cook
2013-04-30 18:35 ` Josh Boyer
2013-04-30 18:54 ` Kees Cook
2013-05-07 16:27 ` Josh Boyer
2013-05-08 21:22 ` Andrew Morton [this message]
2013-05-08 21:26 ` Kees Cook
2013-05-08 21:32 ` Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2013-02-22 18:18 [PATCH] kmsg: Honor " Josh Boyer
2013-02-27 17:54 ` Kees Cook
2013-02-27 18:01 ` Josh Boyer
2013-02-27 18:14 ` Kees Cook
2013-02-27 20:46 ` Eric Paris
2013-02-27 22:19 ` Josh Boyer
2013-02-27 22:34 ` Kees Cook
2013-03-22 21:54 ` Andrew Morton
2013-03-22 22:14 ` Josh Boyer
2013-04-01 23:51 ` Kees Cook
2013-04-02 1:05 ` Josh Boyer
2013-04-08 21:34 ` Kees Cook
2013-04-09 0:50 ` Josh Boyer
2013-02-27 18:05 ` Kees Cook
2013-02-27 18:13 ` Josh Boyer
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=20130508142223.c4497dc285600f30cc56d21a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=eparis@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jwboyer@redhat.com \
--cc=kay@vrfy.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®