From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030230Ab3LTOEu (ORCPT ); Fri, 20 Dec 2013 09:04:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33739 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030198Ab3LTOEs (ORCPT ); Fri, 20 Dec 2013 09:04:48 -0500 Date: Fri, 20 Dec 2013 09:04:17 -0500 From: Richard Guy Briggs To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Oleg Nesterov Subject: Re: [PATCH] pid: change task_struct::pid to read-only Message-ID: <20131220140417.GE14884@madcap2.tricolour.ca> References: <8aa73d2b884439496f87d5f34c12ba9b4b40f7e5.1377032086.git.rgb@redhat.com> <20131217095801.GF21999@twins.programming.kicks-ass.net> <20131220044826.GF14944@madcap2.tricolour.ca> <20131220085846.GA21999@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220085846.GA21999@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/20, Peter Zijlstra wrote: > On Thu, Dec 19, 2013 at 11:48:26PM -0500, Richard Guy Briggs wrote: > > On 13/12/17, Peter Zijlstra wrote: > > > On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: > > > > task->pid is only ever assigned once (well ok, twice). For system health and > > > > secure logging confidence, make it const to make it much more intentional when > > > > it is being changed. > > > > --- > > > > > > > > Peter, as you had suggested, does this approach work for you in terms of making > > > > task_struct::pid a lot more difficult to accidentally change to try to preserve > > > > its integrity? > > > > > > Yeah, looks good to me. > > > > Ok, who would carry this patch? You? AKPM? Me? > > Andrew seems to be the him who carries PID stuff. I don't think I can make > a case that its scheduler related. > > > Any opinions about Oleg's macro idea? > > I'm undecided.. on the one hand the macro makes it too easy to change > const stuff, on the other hand it makes it explicit and easily > greppable. My first reaction was it makes it too easy. Easy, but much more clear in its intentions. greppable hadn't occured to me. I figure the accompanying comment covers intent. - RGB -- Richard Guy Briggs Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545