Restricted size of patchable boot images to 32 MB and prevented
stream filtering on such boot images.
This commit is contained in:
parent
d3fefe4735
commit
c8ed18695f
@ -1178,10 +1178,10 @@ int iso_patch_eltoritos(Ecma119Image *t)
|
|||||||
continue;
|
continue;
|
||||||
original = t->bootsrc[idx]->stream;
|
original = t->bootsrc[idx]->stream;
|
||||||
size = (size_t) iso_stream_get_size(original);
|
size = (size_t) iso_stream_get_size(original);
|
||||||
|
if (size > Libisofs_elto_max_patchablE)
|
||||||
/* >>> BOOT ts B00428 :
|
return ISO_PATCH_OVERSIZED_BOOT;
|
||||||
check whether size is not too large for buffering */;
|
if (iso_stream_get_input_stream(original, 0) != NULL)
|
||||||
|
return ISO_PATCH_FILTERED_BOOT;
|
||||||
buf = calloc(1, size);
|
buf = calloc(1, size);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return ISO_OUT_OF_MEM;
|
return ISO_OUT_OF_MEM;
|
||||||
|
@ -168,4 +168,11 @@ int iso_patch_eltoritos(Ecma119Image *t);
|
|||||||
#define Libisofs_grub2_elto_patch_offsT 5
|
#define Libisofs_grub2_elto_patch_offsT 5
|
||||||
|
|
||||||
|
|
||||||
|
/* Maximum size of a boot image which is marked by
|
||||||
|
el_torito_set_isolinux_options() for patching (boot info table,
|
||||||
|
GRUB2 boot info, maybe others).
|
||||||
|
*/
|
||||||
|
#define Libisofs_elto_max_patchablE (32 * 1024 * 1024)
|
||||||
|
|
||||||
|
|
||||||
#endif /* LIBISO_ELTORITO_H */
|
#endif /* LIBISO_ELTORITO_H */
|
||||||
|
@ -8312,6 +8312,14 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len,
|
|||||||
(NOTE, HIGH, -409) */
|
(NOTE, HIGH, -409) */
|
||||||
#define ISO_NOT_REPRODUCIBLE 0xB030FE67
|
#define ISO_NOT_REPRODUCIBLE 0xB030FE67
|
||||||
|
|
||||||
|
/** May not write boot info into filtered stream of boot image
|
||||||
|
(FAILURE, HIGH, -410) */
|
||||||
|
#define ISO_PATCH_FILTERED_BOOT 0xE830FE66
|
||||||
|
|
||||||
|
/** Boot image to large to buffer for writing boot info
|
||||||
|
(FAILURE, HIGH, -411) */
|
||||||
|
#define ISO_PATCH_OVERSIZED_BOOT 0xE830FE65
|
||||||
|
|
||||||
|
|
||||||
/* Internal developer note:
|
/* Internal developer note:
|
||||||
Place new error codes directly above this comment.
|
Place new error codes directly above this comment.
|
||||||
|
@ -531,6 +531,10 @@ const char *iso_error_to_msg(int errcode)
|
|||||||
return "Unreadable file, premature EOF, or failure to seek for interval reader";
|
return "Unreadable file, premature EOF, or failure to seek for interval reader";
|
||||||
case ISO_NOT_REPRODUCIBLE:
|
case ISO_NOT_REPRODUCIBLE:
|
||||||
return "Cannot arrange content of data files in surely reproducible way";
|
return "Cannot arrange content of data files in surely reproducible way";
|
||||||
|
case ISO_PATCH_FILTERED_BOOT:
|
||||||
|
return "May not write boot info into filtered stream of boot image";
|
||||||
|
case ISO_PATCH_OVERSIZED_BOOT:
|
||||||
|
return "Boot image to large to buffer for writing boot info";
|
||||||
default:
|
default:
|
||||||
return "Unknown error";
|
return "Unknown error";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user