grub/grub-core/normal
Peter Jones 3f05d693d1 malloc: Use overflow checking primitives where we do complex allocations
This attempts to fix the places where we do the following where
arithmetic_expr may include unvalidated data:

  X = grub_malloc(arithmetic_expr);

It accomplishes this by doing the arithmetic ahead of time using grub_add(),
grub_sub(), grub_mul() and testing for overflow before proceeding.

Among other issues, this fixes:
  - allocation of integer overflow in grub_video_bitmap_create()
    reported by Chris Coulson,
  - allocation of integer overflow in grub_png_decode_image_header()
    reported by Chris Coulson,
  - allocation of integer overflow in grub_squash_read_symlink()
    reported by Chris Coulson,
  - allocation of integer overflow in grub_ext2_read_symlink()
    reported by Chris Coulson,
  - allocation of integer overflow in read_section_as_string()
    reported by Chris Coulson.

Fixes: CVE-2020-14309, CVE-2020-14310, CVE-2020-14311

Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-07-29 16:55:47 +02:00
..
auth.c core: use GRUB_TERM_ definitions when handling term characters 2017-08-07 19:28:22 +02:00
autofs.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
charset.c malloc: Use overflow checking primitives where we do complex allocations 2020-07-29 16:55:47 +02:00
cmdline.c malloc: Use overflow checking primitives where we do complex allocations 2020-07-29 16:55:47 +02:00
color.c Replace explicit sizeof divisions by ARRAY_SIZE. 2015-01-21 17:37:31 +01:00
completion.c normal/completion: Fix possible NULL pointer dereference 2020-03-10 21:40:23 +01:00
context.c normal: fix memory leak 2015-06-20 23:38:19 +03:00
crypto.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
dyncmd.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
main.c normal/main: Search for specific config files for netboot 2020-02-18 15:12:06 +01:00
menu.c kern/term: Accept ESC, F4 and holding SHIFT as user interrupt keys 2020-04-21 22:13:44 +02:00
menu_entry.c malloc: Use overflow checking primitives where we do complex allocations 2020-07-29 16:55:47 +02:00
menu_text.c calloc: Use calloc() at most places 2020-07-29 16:55:47 +02:00
misc.c Change fs functions to add fs_ prefix 2019-04-09 10:03:29 +10:00
term.c calloc: Use calloc() at most places 2020-07-29 16:55:47 +02:00