lkml.org 
[lkml]   [2009]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/16] IA64: use ACCESS_ONCE for rlimits

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> So the rule is: if you access unlocked values, you use ACCESS_ONCE().
> You don't say "but it can't matter". Because you simply don't know.

Most of the time we are being lax about it, especially when it's some
global value we are accessing, which can only be changed as a sysadmin
via a sysctl or so.

[ For example we access pid_max in kernel/pid.c, outside of any lock and
without ACCESS_ONCE() - but that particular case is not a big deal
because changes to pid_max via a sysctl are so rare and are
privileged, and because the effects of any race there are benign. ]

But this patch series is about setrlimit, which makes the per task
rlimit value pretty SMP-volatile (a parallel, unprivileged setrlimit can
race with usage of the value elsewhere) - and the rlimits have security
relevance as well so some extra care in accessing them outside of locks
is prudent IMO.

Ingo


\
 
 \ /
  Last update: 2009-11-19 03:31    [from the cache]
©2003-2011 Jasper Spaans