Commit Graph

16 Commits

Author SHA1 Message Date
Peter Jones f725fa7cb2 calloc: Use calloc() at most places
This modifies most of the places we do some form of:

  X = malloc(Y * Z);

to use calloc(Y, Z) instead.

Among other issues, this fixes:
  - allocation of integer overflow in grub_png_decode_image_header()
    reported by Chris Coulson,
  - allocation of integer overflow in luks_recover_key()
    reported by Chris Coulson,
  - allocation of integer overflow in grub_lvm_detect()
    reported by Chris Coulson.

Fixes: CVE-2020-14308

Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-07-29 16:55:47 +02:00
Cristian Ciocaltea 088f7f56e5 uboot: Add the missing disk write operation support
uboot_disk_write() is currently lacking the write support
to storage devices because, historically, those devices did not
implement block_write() in U-Boot.

The solution has been tested using a patched U-Boot loading
and booting GRUB in a QEMU vexpress-a9 environment.
The disk write operations were triggered with GRUB's save_env
command.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-01-22 15:23:51 +01:00
Vladimir Serbinenko d08c968514 Refactor arm-uboot code to make it genereic.
arm-coreboot startup code can be very similar to arm-uboot but current code has
U-Boot specific references. So split U-Boot part from generic part.
2017-05-08 17:47:57 +02:00
Vladimir Serbinenko bbc52c228f Enable cache on ARM U-Boot port.
Without it the port is reidiculously slow.
2013-12-23 05:01:58 +01:00
Vladimir Serbinenko 5ad9f728eb Workaround buggy timer in raspberry pie by using our own timer
implementation.
2013-12-22 02:48:42 +01:00
Ian Campbell 80b865bdc8 * grub-core/kern/uboot/init.c: Fix units of uboot timer. 2013-12-15 17:59:40 +01:00
Vladimir Serbinenko 40b5739ff9 * grub-core/kern/uboot/init.c (uboot_timer_ms): Fix overflow after 71
minutes.
2013-12-04 08:26:39 +01:00
Vladimir Serbinenko 16a22c3851 * grub-core/kern/uboot/init.c: Move grub_uboot_machine_type and
grub_uboot_boot_data to asm part.
2013-11-13 06:28:15 +01:00
Vladimir Serbinenko 33690255c5 Fix grub_machine_fini bitrot.
Reported by: Glenn Washburn.
2013-11-10 13:33:26 +01:00
Vladimir 'phcoder' Serbinenko 5bac5d9ad6 * grub-core/partmap/dfly.c: New partition map. 2013-05-16 16:18:37 +02:00
Leif Lindholm b385e0723b Leif's API fixes 2013-05-03 15:07:39 +02:00
Leif Lindholm bb9f92b9b1 Leif's build fixes 2013-05-03 14:41:08 +02:00
Vladimir 'phcoder' Serbinenko c86c39abef Add uboot net 2013-04-12 16:55:38 +02:00
Vladimir 'phcoder' Serbinenko 4e13e84e56 Fix timer units 2013-04-12 16:51:33 +02:00
Vladimir 'phcoder' Serbinenko b624c94856 Simplify init assembly 2013-04-12 16:50:58 +02:00
Leif Lindholm 389b31cd71 Initial import of Leif's work 2013-04-07 02:41:07 +02:00