|
@@ -53,7 +53,7 @@ static int elf_load_segment ( struct image *image, Elf_Phdr *phdr ) {
|
53
|
53
|
/* Check segment lies within image */
|
54
|
54
|
if ( ( phdr->p_offset + phdr->p_filesz ) > image->len ) {
|
55
|
55
|
DBG ( "ELF segment outside ELF file\n" );
|
56
|
|
- return -ENOEXEC;
|
|
56
|
+ return -ERANGE;
|
57
|
57
|
}
|
58
|
58
|
|
59
|
59
|
/* Find start address: use physical address for preference,
|
|
@@ -65,7 +65,7 @@ static int elf_load_segment ( struct image *image, Elf_Phdr *phdr ) {
|
65
|
65
|
dest = phdr->p_vaddr;
|
66
|
66
|
if ( ! dest ) {
|
67
|
67
|
DBG ( "ELF segment loads to physical address 0\n" );
|
68
|
|
- return -ENOEXEC;
|
|
68
|
+ return -ERANGE;
|
69
|
69
|
}
|
70
|
70
|
buffer = phys_to_user ( dest );
|
71
|
71
|
|
|
@@ -113,7 +113,7 @@ int elf_load ( struct image *image ) {
|
113
|
113
|
if ( phoff > image->len ) {
|
114
|
114
|
DBG ( "ELF program header %d outside ELF image\n",
|
115
|
115
|
phnum );
|
116
|
|
- return -ENOEXEC;
|
|
116
|
+ return -ERANGE;
|
117
|
117
|
}
|
118
|
118
|
copy_from_user ( &phdr, image->data, phoff, sizeof ( phdr ) );
|
119
|
119
|
if ( ( rc = elf_load_segment ( image, &phdr ) ) != 0 )
|