diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-03-05 16:42:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:29 -0500 |
commit | d554ed895dc8f293cc712c71f14b101ace82579a (patch) | |
tree | fd29ba33d640e156e2ca4267ffbdb9dc566fd3d6 /fs/binfmt_aout.c | |
parent | 221e3ebf6d5f2625373573155924e39f196c5d3d (diff) |
fs: use rlimit helpers
Make sure compiler won't do weird things with limits. E.g. fetching them
twice may return 2 different values after writable limits are implemented.
I.e. either use rlimit helpers added in commit 3e10e716abf3 ("resource:
add helpers for fetching rlimits") or ACCESS_ONCE if not applicable.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_aout.c')
-rw-r--r-- | fs/binfmt_aout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index fdd397099172..61dd00a6c7b4 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -247,7 +247,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) | |||
247 | * size limits imposed on them by creating programs with large | 247 | * size limits imposed on them by creating programs with large |
248 | * arrays in the data or bss. | 248 | * arrays in the data or bss. |
249 | */ | 249 | */ |
250 | rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; | 250 | rlim = rlimit(RLIMIT_DATA); |
251 | if (rlim >= RLIM_INFINITY) | 251 | if (rlim >= RLIM_INFINITY) |
252 | rlim = ~0; | 252 | rlim = ~0; |
253 | if (ex.a_data + ex.a_bss > rlim) | 253 | if (ex.a_data + ex.a_bss > rlim) |