grub/grub-core/net
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
..
drivers ofnet: Fix build regression in grub_ieee1275_parse_bootpath() 2018-11-28 13:48:45 +01:00
arp.c Add Virtual LAN support. 2017-05-03 13:03:50 +02:00
bootp.c calloc: Use calloc() at most places 2020-07-29 16:55:47 +02:00
dns.c malloc: Use overflow checking primitives where we do complex allocations 2020-07-29 16:55:47 +02:00
ethernet.c Add Virtual LAN support. 2017-05-03 13:03:50 +02:00
http.c misc: Make grub_strtol() "end" pointers have safer const qualifiers 2020-02-28 12:41:29 +01:00
icmp.c arp, icmp: Fix handling in case of oversized or invalid packets. 2015-03-27 12:18:25 +01:00
icmp6.c net: fix ipv6 routing 2016-02-25 22:38:52 +03:00
ip.c net/dhcp: Make grub_net_process_dhcp() take an interface 2019-03-12 20:04:07 +01:00
net.c calloc: Use calloc() at most places 2020-07-29 16:55:47 +02:00
netbuff.c arp, icmp: Fix handling in case of oversized or invalid packets. 2015-03-27 12:18:25 +01:00
tcp.c tcp: fix memory leaks 2016-01-16 20:59:50 +03:00
tftp.c tftp: Normalize slashes in TFTP paths 2019-12-06 20:26:36 +01:00
udp.c * grub-core/disk/ahci.c: Add needed explicit cast. 2013-08-21 21:02:14 +02:00