aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2009-12-14 21:00:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 11:53:24 -0500
commitea637639591def87a54cea811cbac796980cb30d (patch)
tree7ea3e4baf2ffade539ae30192521d331f8e863fa /fs/proc/base.c
parent5dc37642cbce34619e4588a9f0bdad1d2f870956 (diff)
nommu: fix malloc performance by adding uninitialized flag
The NOMMU code currently clears all anonymous mmapped memory. While this is what we want in the default case, all memory allocation from userspace under NOMMU has to go through this interface, including malloc() which is allowed to return uninitialized memory. This can easily be a significant performance penalty. So for constrained embedded systems were security is irrelevant, allow people to avoid clearing memory unnecessarily. This also alters the ELF-FDPIC binfmt such that it obtains uninitialised memory for the brk and stack region. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Greg Ungerer <gerg@snapgear.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/base.c')
0 files changed, 0 insertions, 0 deletions
t">.wsize = sizeof(struct nfsctl_export) }, [NFSCTL_GETFD] = { .name = ".getfd", .wsize = sizeof(struct nfsctl_fdparm), .rsize = NFS_FHSIZE }, [NFSCTL_GETFS] = { .name = ".getfs", .wsize = sizeof(struct nfsctl_fsparm), .rsize = sizeof(struct knfsd_fh) }, }; long asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res) { struct file *file; void __user *p = &arg->u; int version; int err; if (copy_from_user(&version, &arg->ca_version, sizeof(int))) return -EFAULT; if (version != NFSCTL_VERSION) return -EINVAL; if (cmd < 0 || cmd >= ARRAY_SIZE(map) || !map[cmd].name) return -EINVAL; file = do_open(map[cmd].name, map[cmd].rsize ? O_RDWR : O_WRONLY); if (IS_ERR(file)) return PTR_ERR(file); err = file->f_op->write(file, p, map[cmd].wsize, &file->f_pos); if (err >= 0 && map[cmd].rsize) err = file->f_op->read(file, res, map[cmd].rsize, &file->f_pos); if (err >= 0) err = 0; fput(file); return err; }