@@ -409,6 +409,7 @@ static struct elf_phdr *load_elf_phdrs(struct elfhdr *elf_ex,
409
409
{
410
410
struct elf_phdr * elf_phdata = NULL ;
411
411
int retval , size , err = -1 ;
412
+ loff_t pos = elf_ex -> e_phoff ;
412
413
413
414
/*
414
415
* If the size of this structure has changed, then punt, since
@@ -432,8 +433,7 @@ static struct elf_phdr *load_elf_phdrs(struct elfhdr *elf_ex,
432
433
goto out ;
433
434
434
435
/* Read in the program headers */
435
- retval = kernel_read (elf_file , elf_ex -> e_phoff ,
436
- (char * )elf_phdata , size );
436
+ retval = kernel_read (elf_file , elf_phdata , size , & pos );
437
437
if (retval != size ) {
438
438
err = (retval < 0 ) ? retval : - EIO ;
439
439
goto out ;
@@ -698,6 +698,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
698
698
struct elfhdr interp_elf_ex ;
699
699
} * loc ;
700
700
struct arch_elf_state arch_state = INIT_ARCH_ELF_STATE ;
701
+ loff_t pos ;
701
702
702
703
loc = kmalloc (sizeof (* loc ), GFP_KERNEL );
703
704
if (!loc ) {
@@ -750,9 +751,9 @@ static int load_elf_binary(struct linux_binprm *bprm)
750
751
if (!elf_interpreter )
751
752
goto out_free_ph ;
752
753
753
- retval = kernel_read ( bprm -> file , elf_ppnt -> p_offset ,
754
- elf_interpreter ,
755
- elf_ppnt -> p_filesz );
754
+ pos = elf_ppnt -> p_offset ;
755
+ retval = kernel_read ( bprm -> file , elf_interpreter ,
756
+ elf_ppnt -> p_filesz , & pos );
756
757
if (retval != elf_ppnt -> p_filesz ) {
757
758
if (retval >= 0 )
758
759
retval = - EIO ;
@@ -776,9 +777,9 @@ static int load_elf_binary(struct linux_binprm *bprm)
776
777
would_dump (bprm , interpreter );
777
778
778
779
/* Get the exec headers */
779
- retval = kernel_read ( interpreter , 0 ,
780
- ( void * ) & loc -> interp_elf_ex ,
781
- sizeof (loc -> interp_elf_ex ));
780
+ pos = 0 ;
781
+ retval = kernel_read ( interpreter , & loc -> interp_elf_ex ,
782
+ sizeof (loc -> interp_elf_ex ), & pos );
782
783
if (retval != sizeof (loc -> interp_elf_ex )) {
783
784
if (retval >= 0 )
784
785
retval = - EIO ;
@@ -1175,9 +1176,10 @@ static int load_elf_library(struct file *file)
1175
1176
unsigned long elf_bss , bss , len ;
1176
1177
int retval , error , i , j ;
1177
1178
struct elfhdr elf_ex ;
1179
+ loff_t pos = 0 ;
1178
1180
1179
1181
error = - ENOEXEC ;
1180
- retval = kernel_read (file , 0 , ( char * ) & elf_ex , sizeof (elf_ex ));
1182
+ retval = kernel_read (file , & elf_ex , sizeof (elf_ex ), & pos );
1181
1183
if (retval != sizeof (elf_ex ))
1182
1184
goto out ;
1183
1185
@@ -1201,7 +1203,8 @@ static int load_elf_library(struct file *file)
1201
1203
1202
1204
eppnt = elf_phdata ;
1203
1205
error = - ENOEXEC ;
1204
- retval = kernel_read (file , elf_ex .e_phoff , (char * )eppnt , j );
1206
+ pos = elf_ex .e_phoff ;
1207
+ retval = kernel_read (file , eppnt , j , & pos );
1205
1208
if (retval != j )
1206
1209
goto out_free_ph ;
1207
1210
0 commit comments