grub/grub-core/commands
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
..
arc Remove nested functions from device iterators. 2013-01-20 15:52:15 +00:00
efi * grub-core/commands/efi/lsefisystab.c (grub_cmd_lsefisystab): Show 2014-06-22 01:34:57 +02:00
i386 Clarify several translatable messages. 2013-12-21 03:21:45 +01:00
ieee1275 * grub-core/commands/gptsync.c: Fix typographic quoting. 2012-03-03 13:05:08 +01:00
mips/loongson * grub-core/commands/i386/pc/drivemap.c: Add TRANSLATORS comments. 2012-03-02 15:09:10 +01:00
xen Correct some translatable strings. 2013-12-21 03:03:31 +01:00
acpi.c * grub-core/commands/acpi.c: Use grub_addr_t rather than long when 2013-12-15 14:27:04 +01:00
acpihalt.c ACPIhalt: Add more ACPI opcodes. 2014-09-21 18:58:14 +02:00
blocklist.c Rewrite blocklist functions in order to get progress when 2013-11-01 23:28:03 +01:00
boot.c Add new ports: i386-xen and x86_64-xen. This allows running GRUB in 2013-11-09 21:29:11 +01:00
boottime.c Clarify several translatable messages. 2013-12-21 03:21:45 +01:00
cacheinfo.c Improve gettext support. Stylistic fixes and error handling fixes while 2012-02-08 19:26:01 +01:00
cat.c * grub-core/commands/cat.c: Show UTF-8 characters. 2013-05-08 11:09:08 +02:00
cmp.c Improve gettext support. Stylistic fixes and error handling fixes while 2012-02-08 19:26:01 +01:00
configfile.c * grub-core/commands/configfile.c (GRUB_MOD_INIT): Correct 2012-10-12 15:34:33 +01:00
date.c * grub-core/commands/date.c (GRUB_MOD_INIT): Remove non-uniform 2012-03-03 13:09:14 +01:00
echo.c Implement automatic module license checking according to new GNU 2011-04-11 23:01:51 +02:00
eval.c * grub-core/script/execute.c (grub_script_execute_sourcecode): Split 2013-06-07 18:40:37 +02:00
extcmd.c Implement automatic module license checking according to new GNU 2011-04-11 23:01:51 +02:00
file.c ARM64 grub-file and grub-mkconfig support. 2013-12-23 18:17:09 +01:00
file32.c Implement grub_file tool and use it to implement generating of config 2013-12-17 14:39:48 +01:00
file64.c Implement grub_file tool and use it to implement generating of config 2013-12-17 14:39:48 +01:00
fileXX.c fix include loop on MinGW due to libintl.h pulling stdio.h 2014-01-18 21:22:57 +04:00
gptsync.c cleanup: grub_cpu_to_XXX_compile_time for constants 2014-09-22 20:47:10 +04:00
halt.c Add noreturn attributes and remove unreachable code. 2011-12-13 15:13:51 +01:00
hashsum.c * grub-core/commands/hashsum.c: Remove unneeded memset (zalloc already 2013-11-12 00:58:46 +01:00
hdparm.c * grub-core/commands/hdparm.c (le16_to_char): Always byte-swap strings. 2012-06-06 12:22:32 +02:00
help.c * include/grub/list.h (FOR_LIST_ELEMENTS_SAFE): New macro. 2012-07-02 11:19:22 +02:00
hexdump.c Improve gettext support. Stylistic fixes and error handling fixes while 2012-02-08 19:26:01 +01:00
iorw.c Replace grub_target_addr with more appropriate types. 2012-02-27 14:13:24 +01:00
keylayouts.c * grub-core/commands/keylayouts.c: Ignore unknown keys. 2014-09-21 18:49:49 +02:00
keystatus.c Fix USB devices not being detected when requested 2013-03-19 20:35:21 +01:00
legacycfg.c Replace few instances of memcmp/memcpy in the code that should be grub_memcmp/grub_memcpy. 2014-04-04 07:58:42 +02:00
loadenv.c * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check. 2014-06-22 03:51:50 +04:00
ls.c * grub-core/commands/testspeed.c: New command testspeed. 2013-05-05 18:16:48 +02:00
lsacpi.c * grub-core/commands/lsacpi.c: Fix types on 64-bit platform. 2013-02-06 17:37:29 +01:00
lsmmap.c Pass-through unknown E820 types. It required reorganisation of mmap 2013-10-14 16:33:44 +02:00
lspci.c Remove nested functions from PCI iterators. 2013-01-13 01:10:41 +00:00
macbless.c * grub-core/commands/macbless.c: Rename FILE and DIR to avoid 2014-01-18 19:26:40 +01:00
memrw.c Replace grub_target_addr with more appropriate types. 2012-02-27 14:13:24 +01:00
menuentry.c * grub-core/commands/menuentry.c: Fix typo in TRANSLATORS comments 2012-05-04 01:20:38 +02:00
minicmd.c * grub-core/commands/minicmd.c (grub_mini_cmd_dump): Handle LLP case. 2013-12-16 15:28:07 +01:00
nativedisk.c Add new ports: i386-xen and x86_64-xen. This allows running GRUB in 2013-11-09 21:29:11 +01:00
parttool.c * configure.ac: Fix spelling. 2013-12-23 13:32:35 +00:00
password.c Improve gettext support. Stylistic fixes and error handling fixes while 2012-02-08 19:26:01 +01:00
password_pbkdf2.c Another round of string clarification and adding TRANSLATORS comments. 2012-02-26 17:28:05 +01:00
pcidump.c Clarify several translatable messages. 2013-12-21 01:41:16 +01:00
probe.c * grub-core/commands/probe.c: Add missing grub_device_close. 2013-04-28 13:54:32 +02:00
read.c Implement automatic module license checking according to new GNU 2011-04-11 23:01:51 +02:00
reboot.c Add noreturn attributes and remove unreachable code. 2011-12-13 15:13:51 +01:00
regexp.c * grub-core/commands/regexp.c (set_matches): Move setvar out of its 2013-03-03 15:24:02 +01:00
search.c Remove nested functions from device iterators. 2013-01-20 15:52:15 +00:00
search_file.c * grub-core/commands/search_file.c (SEARCH_TARGET): Remove obsolete 2012-02-03 11:46:18 +01:00
search_label.c * grub-core/commands/search_file.c (SEARCH_TARGET): Remove obsolete 2012-02-03 11:46:18 +01:00
search_uuid.c * grub-core/commands/search_file.c (SEARCH_TARGET): Remove obsolete 2012-02-03 11:46:18 +01:00
search_wrap.c * grub-core/commands/search_wrap.c (grub_cmd_search): Handle old 2012-04-19 11:32:59 +02:00
setpci.c Rewrite spkmodem to use PIT for timing. Double the speed. 2013-01-17 20:06:52 +01:00
sleep.c Lift 255x255 erminal sie restriction to 65535x65535. Also change from 2013-10-19 23:59:32 +02:00
syslinuxcfg.c Fix several translatable strings. 2014-01-24 18:20:27 +01:00
terminal.c Fix USB devices not being detected when requested 2013-03-19 20:35:21 +01:00
test.c Fix test -a and -o precedence. 2013-05-04 13:38:59 +02:00
testload.c Rewrite blocklist functions in order to get progress when 2013-11-01 23:28:03 +01:00
testspeed.c * grub-core/commands/testspeed.c: Reuse formatting string to decrease 2013-05-10 16:25:36 +02:00
time.c Improve string. Gettextize. 2012-02-12 15:25:25 +01:00
tr.c Decrease number of strings to translate. 2013-12-18 07:26:13 +01:00
true.c * grub-core/commands/acpihalt.c: Add TRANSLATORS comments. 2012-03-03 12:59:28 +01:00
usbtest.c Fix USB devices not being detected when requested 2013-03-19 20:35:21 +01:00
verify.c fix memory corruption in pubkey filter over network 2014-12-05 21:17:08 +03:00
videoinfo.c * grub-core/commands/videoinfo.c: Use "paletted" rather than "packed 2013-05-07 14:44:05 +02:00
videotest.c * grub-core/commands/videotest.c: Reduce flickering and draw 6 squares 2013-05-02 14:34:13 +02:00
wildcard.c Remove nested functions from filesystem directory iterators. 2013-01-21 01:33:46 +00:00
xnu_uuid.c * grub-core/commands/xnu_uuid.c: Remove variable length arrays. 2013-11-12 01:19:34 +01:00