Vladimir Serbinenko
68cf24376c
commands/hdparm: Add missing grub_disk_close.
...
Found by: Coverity scan.
2015-01-24 20:55:06 +01:00
Vladimir Serbinenko
9d999852a2
gptsync: Add missing device_close.
...
Found by: Coverity scan
2015-01-24 20:52:02 +01:00
Vladimir Serbinenko
95a8c9182b
commands/fileXX: Fix memory leak.
...
Found by: Coverity Scan.
2015-01-24 20:50:35 +01:00
Vladimir Serbinenko
b04c6d32ce
commands/file: Change the confusing loop stop condition.
...
Old condition was used to zero-out header variable on exit of the loop.
This is correct but confusing. Replace with in-loop logic.
Found by: Coverity Scan.
2015-01-24 20:47:41 +01:00
Vladimir Serbinenko
e902163e48
commands/acpi: Use ALIGN_UP rather than manual expression.
...
Improves readability and hopefully automatic scanning.
Found by: Coverity Scan.
2015-01-24 20:41:43 +01:00
Vladimir Serbinenko
9ff9d5a54e
uhci: Fix null pointer dereference.
...
Found by: Coverity scan.
2015-01-24 20:38:12 +01:00
Vladimir Serbinenko
7d027b4d3e
efidisk: Return the determined root disk even if partition is unknown.
2015-01-24 19:53:13 +01:00
Andrey Borzenkov
2f73d2733c
accept also hdX as alias to native Xen disk name
...
To be compatible with legacy pv-grub, sort disks by increasing order of handle
value. This allows reusing legacy pv-grub menu.lst which is using hdX names.
Suggested-By: Michael Chang <mchang@suse.com>
Closes: 44026
2015-01-23 19:52:45 +03:00
Felix Janda
3bac4caa2b
Remove direct _llseek code and require long filesystem libc.
2015-01-22 19:54:36 +01:00
Vladimir Serbinenko
6866f2ba37
Remove potential division by 0 in gfxmenu.
2015-01-21 17:42:15 +01:00
Vladimir Serbinenko
44b38e4988
grub_menu_init_page: Avoid returning 0 geometry to avoid divisions by 0.
2015-01-21 17:42:15 +01:00
Vladimir Serbinenko
68581b009f
unix/cputime.c: Cache sc_clk_tck and check it for sanity.
2015-01-21 17:42:15 +01:00
Vladimir Serbinenko
69aee43fa6
* grub-core/kern/efi/mm.c (grub_efi_get_memory_map): Never return a
...
descriptor_size==0 to avoid potential divisions by zero.
2015-01-21 17:42:15 +01:00
Vladimir Serbinenko
ac8bac2496
haiku/getroot.c (grub_util_find_partition_start_os): Avoid division by zero.
2015-01-21 17:42:15 +01:00
Vladimir Serbinenko
4e0a25a4c0
rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid division by zero.
2015-01-21 17:42:14 +01:00
Vladimir Serbinenko
b666e01b9c
* grub-core/loader/i386/xnu.c (guessfsb): Avoid division by 0.
2015-01-21 17:42:14 +01:00
Vladimir Serbinenko
2e62352bc2
* grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure that
...
no division by 0 occurs.
2015-01-21 17:42:14 +01:00
Vladimir Serbinenko
c453760c71
* grub-core/term/gfxterm.c: Avoid division by zero.
2015-01-21 17:42:13 +01:00
Vladimir Serbinenko
e95685dab1
Avoid division by zero in serial.
2015-01-21 17:42:13 +01:00
Vladimir Serbinenko
4816dcac19
* grub-core/video/readers/jpeg.c: Avoid division by zero.
2015-01-21 17:42:13 +01:00
Vladimir Serbinenko
750f4bacd3
* grub-core/disk/diskfilter.c: Validate volumes to avoid division by zero.
2015-01-21 17:42:13 +01:00
Vladimir Serbinenko
475bffeae6
* grub-core/fs/zfs.c: Avoid divisions by zero.
2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
9deb46e363
* grub-core/fs/btrfs.c: Avoid divisions by zero.
2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
065ed900d4
grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Check that hash len is not 0.
2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
111ab3b9cc
osdep/linux/blocklist.c (grub_install_get_blocklist): Check blocksize validity.
2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
4200ad44fe
* grub-core/disk/i386/pc/biosdisk.c: Check disk size sanity.
2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
f1959b1695
* grub-core/disk/ieee1275/nand.c (grub_nand_open): Check block size
...
validity.
2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
935863518f
grub_dmraid_nv_detect: Do not divide by zero.
2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
98f74998d5
* grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem sanity checks.
2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
5ed3a5d049
* grub-core/fs/minix.c: Additional filesystem sanity checks.
2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
47cd2645dd
* grub-core/fs/ext2.c (grub_ext2_mount): Additional checks for superblock validity.
2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
245e21b2b5
grub_ufs_mount: Check that sblock.ino_per_group is not 0.
2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
9201cd79a3
Reject NILFS2 superblocks with over 1GiB blocks.
...
* grub-core/fs/nilfs2.c (grub_nilfs2_valid_sb): Check that
block size is <= 1GiB.
2015-01-21 17:42:10 +01:00
Vladimir Serbinenko
f27ccb584c
grub_ata_setaddress: Check that geometry is sane when using CHS addressing.
2015-01-21 17:42:10 +01:00
Vladimir Serbinenko
1dfe3f973e
* grub-core/disk/AFSplitter.c (AF_merge): Check that mdlen is not 0.
2015-01-21 17:42:10 +01:00
Vladimir Serbinenko
44461d5af2
grub_cmd_play: Avoid division by zero.
2015-01-21 17:42:10 +01:00
Vladimir Serbinenko
30e177a05b
grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past the end of file.
2015-01-21 17:42:06 +01:00
Vladimir Serbinenko
af435524cd
grub_fshelp_read_file: Don't attempt to read past the end of file.
2015-01-21 17:38:04 +01:00
Vladimir Serbinenko
66ce4d1aef
grub_script_lexer_yywrap: Update len synchronously with line.
2015-01-21 17:38:01 +01:00
Vladimir Serbinenko
59d4036594
Replace explicit sizeof divisions by ARRAY_SIZE.
2015-01-21 17:37:31 +01:00
Kris Moore
ba3031f996
Support GELI v6 and v7
2015-01-19 21:56:41 +03:00
Andrei Borzenkov
bac5d1a64a
Fix serial --rtscts option processing
2014-12-09 21:56:39 +03:00
David Kozub
17328db3b3
grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable
...
The unaligned local in __aeabi_uidivmod leads to a store to a 64bit
value at an address that is not divisible by 8 (in grub_divmod64).
The compiler most likely generates a STRD instruction to store it and
this causes an exception.
Fixes Savannah bug #43632 .
This includes improvements done by Leif Lindholm.
2014-12-07 20:16:29 +03:00
Peter Nelson
58f66137a3
* grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse chunks.
2014-12-07 17:57:49 +01:00
Curtis Larsen
06eadf5ebf
fix double free in grub_net_recv_tcp_packet
...
Using the http module to download config files, produces memory errors,
after the config file is downloaded.
The error was traced to the tcp stack in grub-core/net/tcp.c. The wrong
netbuff pointer was being freed in the clean up loop.
Changing the code to free the correct netbuff pointer removes the runtime
error.
Closes 42765.
2014-12-07 11:28:57 +03:00
Andrei Borzenkov
ebb3d958aa
fix memory corruption in pubkey filter over network
...
grub_pubkey_open closed original file after it was read; it set
io->device to NULL to prevent grub_file_close from trying to close device.
But network device itself is stacked (net -> bufio); and bufio preserved
original netfs file which hold reference to device. grub_file_close(io)
called grub_bufio_close which called grub_file_close for original file.
grub_file_close(netfs-file) now also called grub_device_close which
freed file->device->net. So file structure returned by grub_pubkey_open
now had device->net pointed to freed memory. When later file was closed,
it was attempted to be freed again.
Change grub_pubkey_open to behave like other filters - preserve original
parent file and pass grub_file_close down to parent. In this way only the
original file will close device. We really need to move this logic into
core instead.
Also plug memory leaks in error paths on the way.
Reported-By: Robert Kliewer <robert.kliewer@gmail.com>
Closes: bug #43601
2014-12-05 21:17:08 +03:00
Andrei Borzenkov
3173c7501c
grub-core/loader/i386/xen_fileXX.c: memory leak in grub_xen_get_infoXX
...
CID: 73645, 73782
2014-12-01 21:23:54 +03:00
Andrei Borzenkov
03d79a878b
grub-core/fs/zfs/zfsinfo.c: memory leak in print_vdev_info
...
CID: 73635
2014-12-01 20:54:12 +03:00
Andrei Borzenkov
dbbac5a04c
grub-core/lib/syslinux_parse.c: do not free array
...
say->msg is inline array in a structure and should not be freed.
CID: 73610
2014-11-30 18:49:14 +03:00
Andrei Borzenkov
343dad410e
grub-core/disk/lzopio.c: fix double free in error path
...
CID: 73665
2014-11-28 22:37:00 +03:00