Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753519AbcDZSp0 (ORCPT ); Tue, 26 Apr 2016 14:45:26 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:45184 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830AbcDZSpW (ORCPT ); Tue, 26 Apr 2016 14:45:22 -0400 Date: Tue, 26 Apr 2016 20:44:58 +0200 From: Pavel Machek To: Steven Rostedt Cc: Linus Torvalds , LKML , Andrew Morton , Ingo Molnar , Peter Zijlstra , Borislav Petkov , Greg Kroah-Hartman Subject: Re: printk: Add kernel parameter to disable writes to /dev/kmsg Message-ID: <20160426184458.GB8162@amd> References: <20160425130629.188a901c@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160425130629.188a901c@gandalf.local.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1026 Lines: 24 On Mon 2016-04-25 13:06:29, Steven Rostedt wrote: > Over the weekend my server was acting funny. The display wasn't working > well, and I assumed that a driver was going bad. I went to look at the > kernel dmesg, but the buffer only had the following over and over: > > [226062.401405] systemd-logind[3511]: Removed session 4168. > [226063.381051] systemd-logind[3511]: Removed session 4169. systemd has root. I'm not sure additional parameter to fight it is good idea. What's next? systemd evolves a way to override kernel parameters? :-) > I simply propose a way to let us kernel developers keep user space from > interfering, by adding a new kernel command line parameter that will > disable writing to /dev/kmsg. Any attempt to open the file in write > mode will return a -EPERM error. chmod 400 /dev/kmsg? With udev, it should be possible to make it persistent... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html