Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Kay Sievers
On Wed, Apr 24, 2013 at 11:51 PM, Josh Boyer wrote: >> In the daemon case, it's nice to be able to drop privileges after >> setting up resources. The past was open /proc/kmsg with CAP_SYS_ADMIN, >> then drop CAP_SYS_ADMIN and keep reading. Then later CAP_SYS_LOG was >> introduced. So if a daemon

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Josh Boyer
On Wed, Apr 24, 2013 at 02:30:53PM -0700, Linus Torvalds wrote: > On Wed, Apr 24, 2013 at 1:35 PM, Kees Cook wrote: > > > > That said, I much prefer doing the privilege test at read time since > > that means passing a file descriptor to another process doesn't mean > > the new process can just con

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Josh Boyer
On Wed, Apr 24, 2013 at 02:36:39PM -0700, Kees Cook wrote: > >> > >> So, the problem here is the expectation of privileges. The /proc/kmsg > >> usage pattern was: > >> > >> open /proc/kmsg with CAP_SYSLOG > >> drop CAP_SYSLOG > >> read /proc/kmsg forever > > > > This doesn't change the /proc interf

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Kees Cook
On Wed, Apr 24, 2013 at 2:30 PM, Linus Torvalds wrote: > On Wed, Apr 24, 2013 at 1:35 PM, Kees Cook wrote: >> >> That said, I much prefer doing the privilege test at read time since >> that means passing a file descriptor to another process doesn't mean >> the new process can just continue readin

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Kees Cook
On Wed, Apr 24, 2013 at 2:21 PM, Josh Boyer wrote: > On Wed, Apr 24, 2013 at 01:35:17PM -0700, Kees Cook wrote: >> On Wed, Apr 24, 2013 at 10:58 AM, Josh Boyer wrote: >> > On Wed, Apr 24, 2013 at 07:44:33PM +0200, Kay Sievers wrote: >> >> On Tue, Apr 9, 2013 at 6:33 PM, Kees Cook wrote: >> >> >

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Linus Torvalds
On Wed, Apr 24, 2013 at 1:35 PM, Kees Cook wrote: > > That said, I much prefer doing the privilege test at read time since > that means passing a file descriptor to another process doesn't mean > the new process can just continue reading. Bullshit. That's exactly the wrong kind of thinking. If y

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Josh Boyer
On Wed, Apr 24, 2013 at 01:35:17PM -0700, Kees Cook wrote: > On Wed, Apr 24, 2013 at 10:58 AM, Josh Boyer wrote: > > On Wed, Apr 24, 2013 at 07:44:33PM +0200, Kay Sievers wrote: > >> On Tue, Apr 9, 2013 at 6:33 PM, Kees Cook wrote: > >> > On Tue, Apr 9, 2013 at 8:48 AM, Josh Boyer wrote: > >> >>

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Kees Cook
On Wed, Apr 24, 2013 at 10:58 AM, Josh Boyer wrote: > On Wed, Apr 24, 2013 at 07:44:33PM +0200, Kay Sievers wrote: >> On Tue, Apr 9, 2013 at 6:33 PM, Kees Cook wrote: >> > On Tue, Apr 9, 2013 at 8:48 AM, Josh Boyer wrote: >> >> The dmesg_restrict sysctl currently covers the syslog method for acc

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Josh Boyer
On Wed, Apr 24, 2013 at 01:58:35PM -0400, Josh Boyer wrote: > On Wed, Apr 24, 2013 at 07:44:33PM +0200, Kay Sievers wrote: > > On Tue, Apr 9, 2013 at 6:33 PM, Kees Cook wrote: > > > On Tue, Apr 9, 2013 at 8:48 AM, Josh Boyer wrote: > > >> The dmesg_restrict sysctl currently covers the syslog meth

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Josh Boyer
On Wed, Apr 24, 2013 at 07:44:33PM +0200, Kay Sievers wrote: > On Tue, Apr 9, 2013 at 6:33 PM, Kees Cook wrote: > > On Tue, Apr 9, 2013 at 8:48 AM, Josh Boyer wrote: > >> The dmesg_restrict sysctl currently covers the syslog method for access > >> dmesg, however /dev/kmsg isn't covered by the sam

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Kay Sievers
On Tue, Apr 9, 2013 at 6:33 PM, Kees Cook wrote: > On Tue, Apr 9, 2013 at 8:48 AM, Josh Boyer wrote: >> 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 dme

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-24 Thread Josh Boyer
On Tue, Apr 09, 2013 at 11:48:20AM -0400, Josh Boyer wrote: > 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 fo

Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-09 Thread Kees Cook
On Tue, Apr 9, 2013 at 8:48 AM, Josh Boyer wrote: > 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

[PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg

2013-04-09 Thread Josh Boyer
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 re