summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 8adcc5eaa175..15fb4d56cc43 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -922,8 +922,7 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size,
pos = 0;
while (pos < i_size) {
- bytes = kernel_read(file, pos, (char *)(*buf) + pos,
- i_size - pos);
+ bytes = kernel_read(file, *buf + pos, i_size - pos, &pos);
if (bytes < 0) {
ret = bytes;
goto out;
@@ -931,7 +930,6 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size,
if (bytes == 0)
break;
- pos += bytes;
}
if (pos != i_size) {
@@ -1524,6 +1522,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm)
int prepare_binprm(struct linux_binprm *bprm)
{
int retval;
+ loff_t pos = 0;
bprm_fill_uid(bprm);
@@ -1534,7 +1533,7 @@ int prepare_binprm(struct linux_binprm *bprm)
bprm->cred_prepared = 1;
memset(bprm->buf, 0, BINPRM_BUF_SIZE);
- return kernel_read(bprm->file, 0, bprm->buf, BINPRM_BUF_SIZE);
+ return kernel_read(bprm->file, bprm->buf, BINPRM_BUF_SIZE, &pos);
}
EXPORT_SYMBOL(prepare_binprm);