From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com From: Andi Kleen References: <1308917362-4795-1-git-send-email-segoon@openwall.com> <20110630075716.GB3377@albatros> Date: Mon, 19 Sep 2011 11:29:28 -0700 In-Reply-To: (Linus Torvalds's message of "Mon, 19 Sep 2011 09:40:19 -0700") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [kernel-hardening] Re: [Security] [PATCH 2/2] taskstats: restrict access to user To: Linus Torvalds Cc: Balbir Singh , Vasiliy Kulikov , Shailabh Nagar , linux-kernel@vger.kernel.org, security@kernel.org, Eric Paris , Stephen Wilson , KOSAKI Motohiro , David Rientjes , Andrew Morton , Balbir Singh , kernel-hardening@lists.openwall.com List-ID: Linus Torvalds writes: > rc = parse(info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK], mask); > diff --git a/kernel/tsacct.c b/kernel/tsacct.c > index 24dc60d9fa1f..110ca5a03bd6 100644 > --- a/kernel/tsacct.c > +++ b/kernel/tsacct.c > @@ -78,6 +78,7 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) > > #define KB 1024 Needs to be 1024ULL, because the counters are 64bit. > #define MB (1024*KB) > +#define KB_MASK (~(KB-1)) Otherwise you lose the upper 32bits here. -Andi -- ak@linux.intel.com -- Speaking for myself only