projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1e81f9
)
exec: only build read_code when needed
author
Christoph Hellwig
<hch@lst.de>
Mon, 8 Jun 2020 04:42:40 +0000
(21:42 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Mon, 8 Jun 2020 18:05:58 +0000
(11:05 -0700)
Only build read_code when binary formats that use it are built into the
kernel.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Link:
http://lkml.kernel.org/r/20200515143646.3857579-26-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c
patch
|
blob
|
history
diff --git
a/fs/exec.c
b/fs/exec.c
index 93ff1c4c7ebb1084a30741fb38495c57008baf67..88260ec0ac34310b092dd2303d95191656c872c4 100644
(file)
--- a/
fs/exec.c
+++ b/
fs/exec.c
@@
-1053,6
+1053,8
@@
out:
}
EXPORT_SYMBOL_GPL(kernel_read_file_from_fd);
+#if defined(CONFIG_HAVE_AOUT) || defined(CONFIG_BINFMT_FLAT) || \
+ defined(CONFIG_BINFMT_ELF_FDPIC)
ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len)
{
ssize_t res = vfs_read(file, (void __user *)addr, len, &pos);
@@
-1061,6
+1063,7
@@
ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len)
return res;
}
EXPORT_SYMBOL(read_code);
+#endif
/*
* Maps the mm_struct mm into the current task struct.