Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 19 Sep 2011 11:29:28 -0700
From: Andi Kleen <andi@...stfloor.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Balbir Singh <bsingharora@...il.com>,  Vasiliy Kulikov <segoon@...nwall.com>,  Shailabh Nagar <nagar@...ibm.com>,  linux-kernel@...r.kernel.org,  security@...nel.org,  Eric Paris <eparis@...hat.com>,  Stephen Wilson <wilsons@...rt.ca>,  KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,  David Rientjes <rientjes@...gle.com>,  Andrew Morton <akpm@...ux-foundation.org>,  Balbir Singh <balbir@...ux.vnet.ibm.com>,  kernel-hardening@...ts.openwall.com
Subject: Re: [Security] [PATCH 2/2] taskstats: restrict access to user

Linus Torvalds <torvalds@...ux-foundation.org> 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@...ux.intel.com -- Speaking for myself only

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.