]> git.proxmox.com Git - grub2.git/log
grub2.git
8 years agoehci: Fix memory coherence
Vladimir Serbinenko [Tue, 23 Feb 2016 11:06:48 +0000 (12:06 +0100)]
ehci: Fix memory coherence

This is a no-op on x86 but necessarry on ARM and may be necessarry on MIPS.

8 years agoarm-uboot: Make self-relocatable to allow loading at any address
Vladimir Serbinenko [Thu, 18 Feb 2016 23:43:36 +0000 (00:43 +0100)]
arm-uboot: Make self-relocatable to allow loading at any address

8 years agoAllow _start == 0 with relocatable images
Vladimir Serbinenko [Thu, 18 Feb 2016 19:58:38 +0000 (20:58 +0100)]
Allow _start == 0 with relocatable images

8 years agoProvide __bss_start and _end symbols in grub-mkimage.
Vladimir Serbinenko [Thu, 18 Feb 2016 19:57:21 +0000 (20:57 +0100)]
Provide __bss_start and _end symbols in grub-mkimage.

For this ensure that all bss sections are merged.

We need this to correctly prelink non-PE relocatable images.

8 years agoEncapsulate image layout into a separate structure.
Vladimir Serbinenko [Fri, 19 Feb 2016 00:49:53 +0000 (01:49 +0100)]
Encapsulate image layout into a separate structure.

Currently we pass around a lot of pointer. Instead put all relevant data
into one structure.

8 years agomkimagexx: Split PE and generic part for relocations.
Vladimir Serbinenko [Thu, 18 Feb 2016 19:54:37 +0000 (20:54 +0100)]
mkimagexx: Split PE and generic part for relocations.

As a preparation for U-Boot relocations, split emitting PE-relocations
from parsing source ELF-relocations.

8 years agomkimage.c: Split into separate files.
Vladimir Serbinenko [Thu, 18 Feb 2016 19:26:44 +0000 (20:26 +0100)]
mkimage.c: Split into separate files.

util/grub-mkimagexx.c is included in a special way into mkimage.c.
Interoperation between defines makes this very tricky. Instead
just have a clean interface and compile util/grub-mkimage*.c separately
from mkimage.c

8 years agobsd: Ensure that kernel is loaded before loading module.
Vladimir Serbinenko [Fri, 26 Feb 2016 13:56:22 +0000 (14:56 +0100)]
bsd: Ensure that kernel is loaded before loading module.

kernel_type may be set to the type of failed kernel. This patching-up is
easier than to reflow kernel loading routines.

8 years agocat: Don't switch terminal mode when there is nothing to highlight.
Vladimir Serbinenko [Fri, 26 Feb 2016 11:26:56 +0000 (12:26 +0100)]
cat: Don't switch terminal mode when there is nothing to highlight.

This just pollutes serial console.

8 years agoUse console rather than serial_efi0 on arm64-efi in tests
Vladimir Serbinenko [Fri, 26 Feb 2016 10:56:28 +0000 (11:56 +0100)]
Use console rather than serial_efi0 on arm64-efi in tests

8 years agoefidisk: fix misplaced parenthesis in b00e4c2
Andrei Borzenkov [Sat, 27 Feb 2016 12:16:48 +0000 (15:16 +0300)]
efidisk: fix misplaced parenthesis in b00e4c2

8 years agoefidisk: prevent errors from diskfilter scan of removable drives
Andrei Borzenkov [Fri, 26 Feb 2016 18:44:37 +0000 (21:44 +0300)]
efidisk: prevent errors from diskfilter scan of removable drives

Map EFI_NO_MEDIA to GRUB_ERR_OUT_OF_RANGE that is ignored by diskfilter. This
actually matches pretty close (we obviously attempt to read outside of media)
and avoids adding more error codes.

This affects only internally initiated scans. If read/write from removable is
explicitly requested, we still return an error and text explanation is more
clear for user than generic error.

Reported and tested by Andreas Loew <Andreas.Loew@gmx.net>

8 years agoRegenerate checksums
Vladimir Serbinenko [Fri, 26 Feb 2016 10:37:47 +0000 (11:37 +0100)]
Regenerate checksums

8 years agoMakefile: Don't delete default_payload.elf if it doesn't exist.
Vladimir Serbinenko [Fri, 26 Feb 2016 10:12:35 +0000 (11:12 +0100)]
Makefile: Don't delete default_payload.elf if it doesn't exist.

8 years agonet: fix ipv6 routing
Josef Bacik [Wed, 10 Feb 2016 21:21:00 +0000 (13:21 -0800)]
net: fix ipv6 routing

ipv6 routing in grub2 is broken, we cannot talk to anything outside our local
network or anything that doesn't route in our global namespace.  This patch
fixes this by doing a couple of things

1) Read the router information off of the router advertisement.  If we have a
router lifetime we need to take the source address and create a route from it.

2) Changes the routing stuff slightly to allow you to specify a gateway _and_ an
interface.  Since the router advertisements come in on the link local address we
need to associate it with the global address on the card.  So when we are
processing the router advertisement, either use the SLAAC interface we create
and add the route to that interface, or loop through the global addresses we
currently have on our interface and associate it with one of those addresses.
We need to have a special case here for the default route so that it gets used,
we do this by setting the masksize to 0 to mean it encompasses all networks.
The routing code will automatically select the best route so if there is a
closer match we will use that.

With this patch I can now talk to ipv6 addresses outside of my local network.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
8 years agoieee1275: fix signed comparison
Vladimir Serbinenko [Tue, 23 Feb 2016 07:57:31 +0000 (08:57 +0100)]
ieee1275: fix signed comparison

8 years agosearch: actually skip floppy with --no-floppy
Andrei Borzenkov [Tue, 23 Feb 2016 20:14:41 +0000 (23:14 +0300)]
search: actually skip floppy with --no-floppy

grub_device_iterate() ignores device when iterator returns 1, not 0.

Reported by Carlos E. R. <robin.listas@telefonica.net>

8 years agomultiboot2: zero reserved field in memory map
Andrei Borzenkov [Tue, 23 Feb 2016 06:12:14 +0000 (09:12 +0300)]
multiboot2: zero reserved field in memory map

Documentation says, bootloader should set reserved field to zero.

Reported by Wink Saville <wink@saville.com>

8 years agoImprove EHCI logging
Vladimir Serbinenko [Mon, 22 Feb 2016 02:32:50 +0000 (03:32 +0100)]
Improve EHCI logging

Add dprintf's on common error paths and remove some entries which are too
noisy.

8 years agousb_keyboard: Remove useless include
Vladimir Serbinenko [Mon, 22 Feb 2016 02:25:50 +0000 (03:25 +0100)]
usb_keyboard: Remove useless include

This prevents non-PCI machines from having USB.

8 years agoRefresh before abort
Vladimir Serbinenko [Sat, 20 Feb 2016 08:12:15 +0000 (09:12 +0100)]
Refresh before abort

This ensures that abort message is actually visible to the user.

8 years agoieee1275: prevent buffer over-read
Eric Snowberg [Mon, 15 Feb 2016 18:53:45 +0000 (10:53 -0800)]
ieee1275: prevent buffer over-read

Prevent buffer over-read in grub_machine_mmap_iterate. This was
causing phys_base from being calculated properly. This then
caused the wrong value to be placed in ramdisk_image within
struct linux_hdrs. Which prevented the ramdisk from loading on
boot.

Newer SPARC systems contain more than 8 available memory entries.

For example on a T5-8 with 2TB of memory, the memory layout could
look like this:

T5-8 Memory
reg                      00000000 30000000 0000003f b0000000
                         00000800 00000000 00000040 00000000
                         00001000 00000000 00000040 00000000
                         00001800 00000000 00000040 00000000
                         00002000 00000000 00000040 00000000
                         00002800 00000000 00000040 00000000
                         00003000 00000000 00000040 00000000
                         00003800 00000000 00000040 00000000
available                00003800 00000000 0000003f ffcae000
                         00003000 00000000 00000040 00000000
                         00002800 00000000 00000040 00000000
                         00002000 00000000 00000040 00000000
                         00001800 00000000 00000040 00000000
                         00001000 00000000 00000040 00000000
                         00000800 00000000 00000040 00000000
                         00000000 70000000 0000003f 70000000
                         00000000 6eef8000 00000000 00002000
                         00000000 30400000 00000000 3eaf6000
name                     memory

Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
8 years agomenu_entry: Disable cursor during update_screen()
Thomas Huth [Fri, 29 Jan 2016 14:26:58 +0000 (15:26 +0100)]
menu_entry: Disable cursor during update_screen()

When running grub in a VGA console of a KVM pseries guest on PowerPC,
you can see the cursor sweeping over the whole line when entering a
character in editor mode. This is visible because grub always refreshes
the whole line when entering a character in editor mode, and drawing
characters is quite a slow operation with the firmware used for the
powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing
the screen contents during update_screen().

Signed-off-by: Thomas Huth <thuth@redhat.com>
8 years agodefault_payload.elf: Always rebuild and remove before build.
Vladimir Serbinenko [Wed, 17 Feb 2016 17:19:18 +0000 (18:19 +0100)]
default_payload.elf: Always rebuild and remove before build.

It's difficult to know all dependencies. Since it's manual and cheap
target anyway, simply always rebuild it.

8 years agodefault_payload.elf: Include password_pbkdf2.
Vladimir Serbinenko [Wed, 17 Feb 2016 17:11:51 +0000 (18:11 +0100)]
default_payload.elf: Include password_pbkdf2.

Withoout this module we may end up in a system where no password is
accepted.

8 years agodefault_payload.elf: Add modules from $(EXTRA_PAYLOAD_MODULES).
Vladimir Serbinenko [Wed, 17 Feb 2016 17:10:31 +0000 (18:10 +0100)]
default_payload.elf: Add modules from $(EXTRA_PAYLOAD_MODULES).

This allows coreboot building system to add extra modules depending
on user config.

8 years agomm: Avoid integer overflow.
Vladimir Serbinenko [Wed, 17 Feb 2016 17:09:44 +0000 (18:09 +0100)]
mm: Avoid integer overflow.

8 years agoRemove -Wno-maybe-uninitialized as it may not be present.
Vladimir Serbinenko [Wed, 17 Feb 2016 16:58:05 +0000 (17:58 +0100)]
Remove -Wno-maybe-uninitialized as it may not be present.

8 years agoFix warnings when compiling with -O3
Vladimir Serbinenko [Wed, 17 Feb 2016 16:56:41 +0000 (17:56 +0100)]
Fix warnings when compiling with -O3

8 years agoAdd wbinvd around bios call.
Vladimir Serbinenko [Sun, 10 Jan 2016 12:48:26 +0000 (13:48 +0100)]
Add wbinvd around bios call.

Via C3 has problems with cache coherency when transitioning between the modes,
so flush it around bios calls.

8 years agoOBP available region contains grub. Start at grub_phys_end.
Eric Snowberg [Fri, 12 Feb 2016 22:16:03 +0000 (23:16 +0100)]
OBP available region contains grub. Start at grub_phys_end.

This prevents a problem where grub was being overwritten since
grub_phys_start does not start at a zero offset within the memory
map.

8 years agoAdd Thinkpad T410s button cmos address.
Andreas Freimuth [Fri, 12 Feb 2016 18:19:11 +0000 (19:19 +0100)]
Add Thinkpad T410s button cmos address.

8 years agoTODO: Remove obsolete link
Vladimir Serbinenko [Fri, 12 Feb 2016 16:51:52 +0000 (17:51 +0100)]
TODO: Remove obsolete link

8 years agolz4: Fix pointer overflow
Toomas Soome [Fri, 12 Feb 2016 15:31:23 +0000 (16:31 +0100)]
lz4: Fix pointer overflow

8 years agogrub-shell: Update 32-bit OVMF binary name.
Vladimir Serbinenko [Fri, 12 Feb 2016 15:08:04 +0000 (16:08 +0100)]
grub-shell: Update 32-bit OVMF binary name.

8 years agorelocator: Fix integer underflow.
Daniel Kiper [Fri, 12 Feb 2016 14:58:22 +0000 (15:58 +0100)]
relocator: Fix integer underflow.

8 years agoChange -v to -V for version of shell utils.
Vladimir Serbinenko [Fri, 12 Feb 2016 14:46:05 +0000 (15:46 +0100)]
Change -v to -V for version of shell utils.

8 years agoxnu: Add new kernel path to autoconfig.
Vladimir Serbinenko [Fri, 12 Feb 2016 14:42:26 +0000 (15:42 +0100)]
xnu: Add new kernel path to autoconfig.

8 years agoarm64: Use cpu timer for timekeeping.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:43:02 +0000 (12:43 +0100)]
arm64: Use cpu timer for timekeeping.

8 years agopowerpc: Trim header in tests.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:42:04 +0000 (12:42 +0100)]
powerpc: Trim header in tests.

8 years agodefault_payload: Include syslinuxcfg, all filesystems and xnu.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:41:28 +0000 (12:41 +0100)]
default_payload: Include syslinuxcfg, all filesystems and xnu.

8 years agoxnu: Supply random seed.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:40:10 +0000 (12:40 +0100)]
xnu: Supply random seed.

Now we're able to load kernels up to El Capitan.

8 years agoAdd RNG module.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:39:38 +0000 (12:39 +0100)]
Add RNG module.

8 years agoyylex: use grub_fatal for exit.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:34:54 +0000 (12:34 +0100)]
yylex: use grub_fatal for exit.

lexer calls yylex_fatal on fatal internal errors. yylex_fatal itself is
declared as noreturn and calls exit. Returning from noreturn function has
unpredictable consequences.

8 years agoprintf: Fix and test %% behaviour in presence of subsequenbt args.
Vladimir Serbinenko [Fri, 12 Feb 2016 11:33:41 +0000 (12:33 +0100)]
printf: Fix and test %% behaviour in presence of subsequenbt args.

8 years agoSplit pmtimer wait and tsc measurement from pmtimer tsc calibration.
Vladimir Serbinenko [Fri, 12 Feb 2016 10:40:51 +0000 (11:40 +0100)]
Split pmtimer wait and tsc measurement from pmtimer tsc calibration.

8 years agoMake grub_cpu_is_tsc_supported generally available.
Vladimir Serbinenko [Fri, 12 Feb 2016 10:38:51 +0000 (11:38 +0100)]
Make grub_cpu_is_tsc_supported generally available.

8 years agoMake grub_acpi_find_fadt accessible generically
Vladimir Serbinenko [Fri, 12 Feb 2016 10:35:48 +0000 (11:35 +0100)]
Make grub_acpi_find_fadt accessible generically

8 years agoMake unaligned types public.
Vladimir Serbinenko [Fri, 12 Feb 2016 08:11:06 +0000 (09:11 +0100)]
Make unaligned types public.

This simplifies code which has to handle those types.

8 years agoFix emu compilation error on arm.
Vladimir Serbinenko [Fri, 12 Feb 2016 08:10:08 +0000 (09:10 +0100)]
Fix emu compilation error on arm.

8 years agoxnu: Include relocated EFI in heap size.
Vladimir Serbinenko [Thu, 11 Feb 2016 11:30:45 +0000 (12:30 +0100)]
xnu: Include relocated EFI in heap size.

8 years agoxnu: supply ramsize to the kernel.
Vladimir Serbinenko [Thu, 11 Feb 2016 10:58:28 +0000 (11:58 +0100)]
xnu: supply ramsize to the kernel.

Without this info recent kernels crash as they allocate no heap.

8 years agosupport modules without symbol table
Andrei Borzenkov [Wed, 3 Feb 2016 17:34:55 +0000 (20:34 +0300)]
support modules without symbol table

all_video module does not have any code or data and exists solely for
.moddeps section to pull in dependencies. This makes all symbols unneeded.

While in current binutils (last released version as of this commit is 2.26)
``strip --strip-unneeded'' unintentionally adds section symbols for each
existing section, this behavior was considered a bug and changed in commit
14f2c699ddca1e2f706342dffc59a6c7e23e844c to completely strip symbol table
in this case.

Older binutils (verified with 2.17) and some other toolchains (at least
elftoolchain r3223M), both used in FreeBSD, remove symbol table in all_video
as well.

Relax run-time check and do not return error for modules without symbol table.
Add additional checks to module verifier to make sure such modules

a) have non-empty .moddeps section. Without either externally visible symbols
or .moddeps modules are completely useless and should not be built.

b) do not have any relocations.

Closes: 46986
v2: add run-time check for empty symbol table if relocations are present as
    suggested by Vladimir.

8 years ago10_linux: avoid multi-device root= kernel argument
Andrei Borzenkov [Mon, 1 Feb 2016 17:13:48 +0000 (20:13 +0300)]
10_linux: avoid multi-device root= kernel argument

If root filesystem is multidev btrfs, do not attempt to pass all devices as
kernel root= argument. This results in splitting command line in GRUB due to
embedded newline and even if we managed to quote it, kernel does not know how
to interpret it anyway. Multidev btrfs requires user space device scanning,
so passing single device would not work too.

This still respects user settings GRUB_DISABLE_LINUX_UUID. Not sure what we
should do in this case.

Closes: 45709
8 years agoError out if mtools invocation fails.
Vladimir Serbinenko [Fri, 22 Jan 2016 18:28:08 +0000 (19:28 +0100)]
Error out if mtools invocation fails.

8 years agoarm64: Add support for relocations needed for linaro gcc
Vladimir Serbinenko [Fri, 22 Jan 2016 18:09:37 +0000 (19:09 +0100)]
arm64: Add support for relocations needed for linaro gcc

8 years agoefiemu: Fix compilation failure
Vladimir Serbinenko [Fri, 22 Jan 2016 13:10:30 +0000 (14:10 +0100)]
efiemu: Fix compilation failure

8 years agoDocument cpuid -p
Vladimir Serbinenko [Fri, 22 Jan 2016 12:50:53 +0000 (13:50 +0100)]
Document cpuid -p

8 years agoefiemu: Handle persistent RAM and unknown possible future additions.
Robert Elliott [Fri, 22 Jan 2016 12:32:30 +0000 (13:32 +0100)]
efiemu: Handle persistent RAM and unknown possible future additions.

8 years agoDocument expr1 expr2 syntax for test command
Vladimir Serbinenko [Fri, 22 Jan 2016 12:27:36 +0000 (13:27 +0100)]
Document expr1 expr2 syntax for test command

8 years agoRestore terminal settings on grub-emu exit.
Michael Chang [Fri, 22 Jan 2016 10:05:32 +0000 (11:05 +0100)]
Restore terminal settings on grub-emu exit.

8 years agoxen_boot: Remove obsolete module type distinctions.
Vladimir Serbinenko [Fri, 22 Jan 2016 09:18:47 +0000 (10:18 +0100)]
xen_boot: Remove obsolete module type distinctions.

8 years agoarm: Ignore qemu clock bug
Vladimir Serbinenko [Fri, 8 Jan 2016 15:22:47 +0000 (16:22 +0100)]
arm: Ignore qemu clock bug

8 years agoi386-ieee1275: Increase maximum heap size to accomodate highres graphi tests
Vladimir Serbinenko [Fri, 8 Jan 2016 15:22:19 +0000 (16:22 +0100)]
i386-ieee1275: Increase maximum heap size to accomodate highres graphi tests

8 years agoRemove pragmas related to -Wunreachable-code
Colin Watson [Wed, 20 Jan 2016 15:56:55 +0000 (15:56 +0000)]
Remove pragmas related to -Wunreachable-code

-Wunreachable-code has been a no-op since GCC 4.5; GRUB hasn't been
compiled with it since 2012; and GCC 6 produces "error:
'-Wunreachable-code' is not an option that controls warnings" for these.

Fixes Debian bug #812047.

8 years agoloader/bsd: Fix signed/unsigned comparison
Colin Watson [Sat, 16 Jan 2016 20:40:55 +0000 (20:40 +0000)]
loader/bsd: Fix signed/unsigned comparison

8 years agoahci, ehci: Fix typos
Colin Watson [Sat, 16 Jan 2016 20:37:15 +0000 (20:37 +0000)]
ahci, ehci: Fix typos

8 years agogrub-probe: fix memory leak
Andrei Borzenkov [Sat, 16 Jan 2016 18:47:28 +0000 (21:47 +0300)]
grub-probe: fix memory leak

Found by: Coverity scan.
CID: 73783

8 years agotftp: fix memory leaks in open
Andrei Borzenkov [Sat, 16 Jan 2016 18:27:57 +0000 (21:27 +0300)]
tftp: fix memory leaks in open

If protocol open fails, file is immediately freed, so data was leaked.

Found by: Coverity scan.
CID: 96659

8 years agotcp: fix memory leaks
Andrei Borzenkov [Sat, 16 Jan 2016 17:59:50 +0000 (20:59 +0300)]
tcp: fix memory leaks

Found by: Coverity scan.
CID: 96639, 96647

8 years agonet: fix memory leaks
Andrei Borzenkov [Sat, 16 Jan 2016 17:48:33 +0000 (20:48 +0300)]
net: fix memory leaks

Found by: Coverity scan.
CID: 96638, 96648

8 years agolegacycfg: fix memory leaks and add NULL check
Andrei Borzenkov [Sat, 16 Jan 2016 17:34:02 +0000 (20:34 +0300)]
legacycfg: fix memory leaks and add NULL check

Memory leaks found by Coverity scan.
CID: 96642, 96645

8 years agoloader: Unintended sign extension
Andrei Borzenkov [Wed, 13 Jan 2016 17:15:07 +0000 (20:15 +0300)]
loader: Unintended sign extension

CID: 96707, 96699, 96693, 96691, 96711, 96709, 96708, 96703, 96702,
96700, 96698, 96696, 96695, 96692, 96710, 96705

8 years agoscript: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 19:50:30 +0000 (22:50 +0300)]
script: fix memory leak

Found by: Coverity scan.
CID: 96637

8 years agonormal: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 19:36:53 +0000 (22:36 +0300)]
normal: fix memory leak

Found by: Coverity scan.
CID: 96641, 96670, 96667

8 years agoxnu: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 18:43:43 +0000 (21:43 +0300)]
xnu: fix memory leak

Found by: Coverity scan.
CID: 96663

8 years agotruecrypt: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 18:41:48 +0000 (21:41 +0300)]
truecrypt: fix memory leak

Found by: Coverity scan.
CID: 156611

8 years agogfxmenu: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 18:33:34 +0000 (21:33 +0300)]
gfxmenu: fix memory leak

Found by: Coverity scan.
CID: 96657

8 years agoefiemu: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 18:25:40 +0000 (21:25 +0300)]
efiemu: fix memory leak

Found by: Coverity scan.
CID: 156610

8 years agoefidisk: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 18:16:34 +0000 (21:16 +0300)]
efidisk: fix memory leak

Found by: Coverity scan.
CID: 96644

8 years agoverify: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 18:10:12 +0000 (21:10 +0300)]
verify: fix memory leak

Found by: Coverity scan.
CID: 96643

8 years agopassword_pbkdf2: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 17:53:26 +0000 (20:53 +0300)]
password_pbkdf2: fix memory leak

Found by: Coverity scan.
CID: 96656

8 years agoparttool: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 17:41:44 +0000 (20:41 +0300)]
parttool: fix memory leak

Found by: Coverity scan.
CID: 96652

8 years agonativedisk: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 17:37:43 +0000 (20:37 +0300)]
nativedisk: fix memory leak

Based on Coverity scan.
CID: 96660

Extended to also cover other error return places.

8 years agoacpi: fix memory leak
Andrei Borzenkov [Tue, 12 Jan 2016 17:26:30 +0000 (20:26 +0300)]
acpi: fix memory leak

Found by: Coverity scan.
CID: 96673

8 years agogrub-install: include ehci in list of native modules
Andrei Borzenkov [Sun, 10 Jan 2016 13:08:06 +0000 (16:08 +0300)]
grub-install: include ehci in list of native modules

This matches behavior of "nativedisk" command.

Reported and tested by Smith Henry <sh37092@gmail.com>

8 years agogrub-mkimage: remove redundant NULL check
Andrei Borzenkov [Sun, 10 Jan 2016 08:51:34 +0000 (11:51 +0300)]
grub-mkimage: remove redundant NULL check

Found by: Coverity scan.
CID: 73737

8 years agonet: remove dead and redundant code
Andrei Borzenkov [Sun, 10 Jan 2016 08:33:13 +0000 (11:33 +0300)]
net: remove dead and redundant code

server cannot be NULL at this point (we return error earlier if it is).
Also structure is zalloc'ed, so no need to explicitly initialize
members to 0.

Found by: Coverity scan.
CID: 73837

8 years agohostdisk: fix device detection
Andrei Borzenkov [Sun, 10 Jan 2016 07:41:04 +0000 (10:41 +0300)]
hostdisk: fix device detection

Condition was apparently reversed so GRUB assumed all devices were
files. This later made it skip BLKFLSBUF ioctl on Linux which caused
various page cache coherency issues. Observed were

- failure to validate blocklist install (read content did not match
  just written)

- failure to detect Linux MD on disk after online hot addition
  (GRUB got stale superblock)

Closes: 46691
8 years agosetup: fix NULL pointer dereference
Andrei Borzenkov [Sat, 9 Jan 2016 18:25:22 +0000 (21:25 +0300)]
setup: fix NULL pointer dereference

Check return value of grub_guess_root_devices

Found by: Coverity scan.
CID: 73638, 73751

8 years agomkimage: fix unintended sign extension
Andrei Borzenkov [Sat, 9 Jan 2016 18:05:44 +0000 (21:05 +0300)]
mkimage: fix unintended sign extension

Found by: Coverity scan.
CID: 73691, 73717

8 years agoutil/getroot: delete dead code
Andrei Borzenkov [Sat, 9 Jan 2016 17:54:54 +0000 (20:54 +0300)]
util/getroot: delete dead code

is_part cannot be non-zero at this point.

Found by: Coveruty scan.
CID: 73838

8 years agoloader/multiboot: fix unintended sign extension
Andrei Borzenkov [Sat, 9 Jan 2016 16:58:51 +0000 (19:58 +0300)]
loader/multiboot: fix unintended sign extension

Found by: Coveruty scan.
CID: 73700, 73763

8 years agokern/elf: fix unintended sign extension
Andrei Borzenkov [Sat, 9 Jan 2016 16:41:26 +0000 (19:41 +0300)]
kern/elf: fix unintended sign extension

Found by: Coverity scan.
CID: 73729, 73735, 73758, 73760

8 years agoxfs: fix possible inode corruption in directory scan
Andrei Borzenkov [Sat, 9 Jan 2016 15:55:55 +0000 (18:55 +0300)]
xfs: fix possible inode corruption in directory scan

grub_xfs_iterate_dir did not restore first character after inline
name when match was found. Dependning on XFS format this character
could be inode number and we could return to the same node later in
find_file if processing cycled symlinks.

CID: 86724

8 years agorescue_parser: restructure code to avoid Coverity false positive
Andrei Borzenkov [Sat, 9 Jan 2016 15:15:27 +0000 (18:15 +0300)]
rescue_parser: restructure code to avoid Coverity false positive

If line contains single word, line and argv[0] are aliases, so
no NULL dereference is possible, but Coverity does not know it.
Change code to avoid ambiguity and also remove redundant call to
grub_strchr.

CID: 86725

8 years agogrub-mklayout: check subscript bounds
Andrei Borzenkov [Sat, 9 Jan 2016 11:13:36 +0000 (14:13 +0300)]
grub-mklayout: check subscript bounds

Found by: Coverity scan.
CID: 73686

8 years agogrub-probe: fix memory leak
Andrei Borzenkov [Sat, 9 Jan 2016 10:49:37 +0000 (13:49 +0300)]
grub-probe: fix memory leak

Found by: Coverity scan.
CID: 73783

8 years agogfxmenu: fix memory leak
Andrei Borzenkov [Sat, 9 Jan 2016 10:43:04 +0000 (13:43 +0300)]
gfxmenu: fix memory leak

Found by: Coverity scan.
CID: 73766

8 years agoutil/setup: fix grub_util_path_list leak
Andrei Borzenkov [Sat, 9 Jan 2016 10:28:42 +0000 (13:28 +0300)]
util/setup: fix grub_util_path_list leak

Add helper grub_util_free_path_list and use it where appropriate.

Found by: Coverity scan.
CID: 73727