Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758448Ab3DXVlu (ORCPT ); Wed, 24 Apr 2013 17:41:50 -0400 Received: from mail-oa0-f51.google.com ([209.85.219.51]:62298 "EHLO mail-oa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758416Ab3DXVls (ORCPT ); Wed, 24 Apr 2013 17:41:48 -0400 MIME-Version: 1.0 In-Reply-To: References: <20130322145448.f44f9d10a36620c1c11535b7@linux-foundation.org> <20130322221444.GJ15821@hansolo.jdub.homelinux.org> <1256775981.281402.1364864751771.JavaMail.root@redhat.com> <20130409005050.GE18176@hansolo.jdub.homelinux.org> <20130409154820.GE32476@hansolo.jdub.homelinux.org> <20130424175835.GF15272@hansolo.jdub.homelinux.org> Date: Wed, 24 Apr 2013 14:41:47 -0700 X-Google-Sender-Auth: 0pJ3nds0pjhLxi2RUS8itNRxx48 Message-ID: Subject: Re: [PATCH v2] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg From: Kees Cook To: Linus Torvalds Cc: Josh Boyer , Kay Sievers , Andrew Morton , Eric Paris , Christian Kujau , "# 3.4.x" , LKML , Karel Zak Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 32 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 reading. > > Bullshit. > > That's exactly the wrong kind of thinking. If you had privileges to > open something, and you pass it off, it's *your* choice. Yes, this is what I was pointing out originally. The semantics of /proc/kmsg do exactly that: check at open time, which is much cleaner. Solving the permissions checking delta between the syslog via syscall and syslog via /proc/kmsg was the original intent of the code so that capabilities could be dropped after open. And when /dev/kmsg came along, it didn't follow either convention. I just want to see the behavior standardized. -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/