Commit graph

343 commits

Author SHA1 Message Date
Andrei Borzenkov
29862fdc3a xnu: fix memory leak
Found by: Coverity scan.
CID: 96663
2016-01-12 21:52:51 +03:00
Andrei Borzenkov
9daf7aae8b truecrypt: fix memory leak
Found by: Coverity scan.
CID: 156611
2016-01-12 21:52:51 +03:00
Andrei Borzenkov
31f6506c57 loader/multiboot: fix unintended sign extension
Found by: Coveruty scan.
CID: 73700, 73763
2016-01-09 19:58:51 +03:00
Vladimir Serbinenko
5919626c90 sparc64: Fix assembly to let compiler to fill in memory references.
This fixes the use of not fully relocatable (they assume that variables are
under 4G limit in virtual memory) references.
2015-12-31 13:07:16 +01:00
Andrei Borzenkov
f4c143789a Replace numbers with grub_memory_type_t enums 2015-11-27 19:52:16 +03:00
Vladimir Serbinenko
e0bd66c314 multiboot: Don't rely on particular ordering of options. 2015-11-12 11:54:38 +01:00
Vladimir Serbinenko
95ba04606f multiboot_mbi: Fix handling of --quirk-bad-kludge. 2015-11-12 11:54:13 +01:00
Fu Wei
a771a7b9f6 xen_boot: Remove useless file_name_index variable. 2015-11-12 11:33:55 +01:00
Vladimir Serbinenko
25a9b8f208 fdt.mod: Move license tag to the right file. 2015-11-09 16:15:30 +01:00
Fu Wei
372400b419 fdt.mod: Add missing license tag. 2015-11-09 15:27:59 +01:00
Fu Wei
83cb45e982 arm64: Add support for xen boot protocol. 2015-10-29 15:24:20 +01:00
Vladimir Serbinenko
4d0cb75538 arm64: Move FDT functions to separate module 2015-10-29 14:06:45 +01:00
Bernhard Übelacker
61c778f640 loader/linux: Make trailer initrd entry aligned again.
Regression from commit:
  loader/linux: do not pad initrd with zeroes at the end
  a8c473288d

Wimboot fails since the change above because it expects the "trailer"
initrd element on an aligned address.
This issue shows only when newc_name is used and the last initrd
entry has a not aligned size.
2015-07-20 19:07:20 +03:00
Andrei Borzenkov
c058e85615 chainloader: fix resoource leak
Found by: Coverity scan.
CID: 96651
2015-06-26 09:25:30 +03:00
Andrei Borzenkov
806bb7999d loader/bsd: fix memory leak
Found by: Coverity scan.
CID: 96662, 96665
2015-06-26 09:25:30 +03:00
Andrei Borzenkov
867c9b7bec loader/bsd: free memory leaks
Found by: Coverity scan.
CID: 96671, 96658, 96653
2015-06-20 23:38:19 +03:00
Andrei Borzenkov
4a857e63c1 loader/bsd: free memory leaks
Found by: Coverity scan.
CID: 96682
2015-06-20 23:38:18 +03:00
Andrei Borzenkov
eb33e61b31 multiboot: fix memory leak
Found by: Coverity scan.
CID: 96684
2015-06-20 23:38:18 +03:00
Andrei Borzenkov
20211c0077 loader/bsd: fix memory leak
Found by: Coverity scan.
CID: 96686
2015-06-20 23:38:18 +03:00
Andrei Borzenkov
e261fcf4c6 xnu: fix use after free
Found by: Coverity scan.
CID: 96706
2015-06-20 23:38:18 +03:00
Andrei Borzenkov
c069460259 efi/chainloader: fix use after free
Found by: Coverity scan.
CID: 96714
2015-06-20 23:38:17 +03:00
Vladimir Serbinenko
c856be6bca multiboot1: never place modules in low memory.
While in theory permitted by the spec, modules rarely fit in low memory
anyway and not every kernel is able to handle modules in low memory anyway.
At least VMWare is known not to be able to handle modules at arbitrary
locations.
2015-05-27 08:41:39 +02:00
Andrei Borzenkov
a8c473288d loader/linux: do not pad initrd with zeroes at the end
Syslinux memdisk is using initrd image and needs to know uncompressed
size in advance. For gzip uncompressed size is at the end of compressed
stream. Grub padded each input file to 4 bytes at the end, which means
syslinux got wrong size.

Linux initramfs loader apparently does not care about trailing alignment.
So change code to align beginning of each file instead which atomatically
gives us the correct size for single file.

Reported-By: David Shaw <dshaw@jabberwocky.com>
2015-05-07 20:24:24 +03:00
Vladimir Serbinenko
e5b4ba8c2b linux.c: Ensure that initrd is page-aligned. 2015-05-07 16:23:39 +02:00
Vladimir Serbinenko
9f731abc7f Revert parts accidentally committed 2 commits ago. 2015-05-07 16:21:34 +02:00
Fu Wei
f8451af825 arm64: Export useful functions from linux.c
Signed-off-by: Fu Wei <fu.wei@linaro.org>
2015-05-07 15:11:04 +02:00
Sarah Newman
7d39938474 grub-core/loader/i386/xen.c: Initialized initrd_ctx so we don't free a random pointer from the stack.
Signed-off-by: Sarah Newman <srn@prgmr.com>
2015-03-28 07:14:17 +03:00
Vladimir Serbinenko
7ea452a142 Add missing grub_ prefix in memcpy invocation 2015-02-23 22:29:33 +01:00
Daniel Kiper
8e5bc2f4d3 multiboot2: Fix information request tag size calculation
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
2015-02-14 19:26:04 +03:00
Andrei Borzenkov
fbb4aa1c05 loader/xnu: fix memory leak.
Foound by: Coverity scan.
2015-01-27 22:12:06 +03:00
Vladimir Serbinenko
9ee5ae1fae Document intentional fallthroughs.
Found by: Coverity scan.
2015-01-27 17:17:58 +01:00
Vladimir Serbinenko
a05a6e6f92 xnu: Add missing error check.
Found by: Coveriy scan.
2015-01-26 09:45:55 +01:00
Vladimir Serbinenko
e12c3bed90 plan9: Add missing grub_device_close.
Found by: Coverity scan.
2015-01-26 09:45:37 +01:00
Vladimir Serbinenko
ef02b4ca93 multiboot: Simplify to avoid confusing assignment.
Found by: Coverity scan.
2015-01-26 09:43:52 +01:00
Vladimir Serbinenko
1e0d718371 bsd: Add missing null-pointer check.
Found by: Coverity scan.
2015-01-26 09:42:42 +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
59d4036594 Replace explicit sizeof divisions by ARRAY_SIZE. 2015-01-21 17:37:31 +01: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
9a67e1ac8e Use full initializer for initrd_ctx to avoid fatal warnings with older GCC
struct ... foo = { 0, } is valid initializer, but older GCC emits
warning which is fatal error due to -Werror=missing-field-initializer.
So simply use full initializer to avoid these errors. This was fixed
probably in GCC 4.7.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
2014-10-14 20:12:15 +04:00
Andrey Borzenkov
954fe77163 cleanup: grub_cpu_to_XXX_compile_time for constants
This tries to catch all cases where grub_cpu_to_XXX was used for constant
expressions (including sizeof).
2014-09-22 20:47:10 +04:00
Peter Jones
631a820038 Initialized initrd_ctx so we don't free a random pointer from the stack.
Currently, if "linux" fails, the "goto fail;" in grub_cmd_initrd sends us
into grub_initrd_close() without grub_initrd_init() being called, and thus
it never clears initrd_ctx->components.  grub_initrd_close() then frees that
address, which is stale data from the stack.  If the stack happens to have a
stale *address* there that matches a recent allocation, then you'll get a
double free later.

So initialize the memory up front.

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-09-21 10:36:42 +04:00
Stephane Rochoy
15bd333e10 * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to
EFI system table.
2014-06-22 01:35:52 +02:00
Vladimir Serbinenko
8063ce197f Replace few instances of memcmp/memcpy in the code that should be grub_memcmp/grub_memcpy. 2014-04-04 07:58:42 +02:00
Fu Wei
68f17b2b30 * grub-core/loader/arm64/linux.c: Remove redundant "0x". 2014-03-26 08:13:07 +01:00
Vladimir Serbinenko
86402b4e0f * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields.
* grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Fill addr field.

	Suggested by: Markus Müller.
2014-02-28 10:50:05 +01:00
Vladimir Serbinenko
4a70fed815 * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit
location to 640K.
2014-02-28 09:48:57 +01:00
Vladimir Serbinenko
61c8482b20 Fix several translatable strings.
Suggested by: D. Prévot.
2014-01-24 18:20:27 +01:00
Andrey Borzenkov
f371dd5da8 fix include loop on MinGW due to libintl.h pulling stdio.h
In file included from ./include/grub/dl.h:23:0,
                 from grub-core/lib/libgcrypt-grub/cipher/rfc2268.c:3:
./include/grub/list.h:34:18: warning: conflicting types for 'grub_list_push' [en
abled by default]
 void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
                  ^
./include/grub/symbol.h:68:25: note: in definition of macro 'EXPORT_FUNC'
 # define EXPORT_FUNC(x) x
                         ^
In file included from ./include/grub/fs.h:30:0,
                 from ./include/grub/file.h:25,
                 from ./grub-core/lib/posix_wrap/stdio.h:23,
                 from c:\mingw\include\libintl.h:314,
                 from ./include/grub/i18n.h:33,
                 from ./include/grub/misc.h:27,
                 from ./include/grub/list.h:25,
                 from ./include/grub/dl.h:28,
                 from grub-core/lib/libgcrypt-grub/cipher/rfc2268.c:3:
./include/grub/partition.h:106:3: note: previous implicit declaration of 'grub_l
ist_push' was here
   grub_list_push (GRUB_AS_LIST_P (&grub_partition_map_list),
   ^
list.h needs just ATTRIBUTE_ERROR from misc.h; split compiler features
into separate file grub/compiler.h and include it instead.
2014-01-18 21:22:57 +04:00
Leif Lindholm
4d21c10199 arm64: set correct length of device path end entry
The length of the Device Path End entry in the grub_linux_boot()
function was incorrectly set to 0. This triggers an assert failure
in debug builds of Tianocore.

Set it to sizeof (grub_efi_device_path_t).
2014-01-07 17:52:50 +00:00
Vladimir Serbinenko
da98622662 Declare GRUB_EFI_VENDOR_APPLE_GUID. 2013-12-24 14:14:19 +01:00