Re: [PATCH 03/16] IA64: use ACCESS_ONCE for rlimits
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH 03/16] IA64: use ACCESS_ONCE for rlimits
- From: Ingo Molnar <mingo@xxxxxxx>
- Date: Thu, 19 Nov 2009 03:28:16 +0100
- Cc: "Luck, Tony" <tony.luck@xxxxxxxxx>, Jiri Slaby <jslaby@xxxxxxxxxx>, "jirislaby@xxxxxxxxx" <jirislaby@xxxxxxxxx>, "nhorman@xxxxxxxxxxxxx" <nhorman@xxxxxxxxxxxxx>, "sfr@xxxxxxxxxxxxxxxx" <sfr@xxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "akpm@xxxxxxxxxxxxxxxxxxxx" <akpm@xxxxxxxxxxxxxxxxxxxx>, "marcin.slusarz@xxxxxxxxx" <marcin.slusarz@xxxxxxxxx>, "tglx@xxxxxxxxxxxxx" <tglx@xxxxxxxxxxxxx>, "mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "hpa@xxxxxxxxx" <hpa@xxxxxxxxx>, James Morris <jmorris@xxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>
- In-reply-to: <alpine.LFD.2.00.0911181138120.2261@xxxxxxxxxxxxxxxxxxxxx>
- List-id: <linux-ia64.vger.kernel.org>
- References: <4B040A03.2020508@xxxxxxxxx> <1258555922-2064-3-git-send-email-jslaby@xxxxxxxxxx> <57C9024A16AD2D4C97DC78E552063EA3E38E71DD@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <alpine.LFD.2.00.0911181138120.2261@xxxxxxxxxxxxxxxxxxxxx>
- User-agent: Mutt/1.5.20 (2009-08-17)
* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]