u-boot/lib
Alexander Graf 905cb9e172 efi_loader: Ensure efi_dp_find_obj() finds exact matches
When calling efi_dp_find_obj(), we usually want to find the *exact* match
of an object for a given device path. However, I ran into a nasty corner case
where I had the following objects with paths available:

Handle 0x9feffa70
  /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/EndEntire
Handle 0x9feffb58
  /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/HD(1,800,32000,2de808cb00000000,1,1)/EndEntire

and was searching for

  /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/HD(1,800,32000,2de808cb00000000,1,1)/EndEntire

But because our device path search looked for any substring match, it would
return

  /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/EndEntire

because that path is a full substring of the path we were searching for.

So this patch adapts the device path search logic to always look for exact
matches first. The way we distinguish between those cases is by looking at
whether our caller actually deals with remainders.

As a side effect, the code as is from all I can tell now never does a
substring match anymore, because it always gets called with rem=NULL, so
we always only do exact matches now.

Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-16 22:51:19 +01:00
..
at91 lib: at91: Add logo files used via API of DM_VIDEO 2017-09-14 16:02:43 -04:00
bzip2 bzlib: Try another way to fix an unused variable 2016-02-06 13:59:48 +01:00
dhry cmd_dhry.c: Use lldiv for vax_mips calculation as well 2016-03-17 10:14:25 -04:00
efi efi_stub: Use efi_uintn_t 2017-12-05 22:56:17 +01:00
efi_loader efi_loader: Ensure efi_dp_find_obj() finds exact matches 2017-12-16 22:51:19 +01:00
efi_selftest efi_selftest: add missing line feed 2017-12-01 13:38:19 +01:00
libfdt libfdt: migrate fdt_wip.c to a wrapper of scripts/dtc/libfdt/fdt_wip.c 2017-12-04 09:59:02 -05:00
lzma lzma: fix buffer bound check error further 2015-01-14 11:35:43 -05:00
lzo lzo: add a function to check the validity of the header 2017-10-05 21:31:04 -04:00
rsa rsa: Fix build with OpenSSL 1.1.x 2017-05-12 08:37:19 -04:00
tizen exynos: Allow tizen to be built without an LCD 2016-05-25 13:25:18 +09:00
zlib Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
addr_map.c Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
aes.c Rename aes.h to uboot_aes.h 2017-04-12 13:28:27 -04:00
asm-offsets.c ARMv8: get new GD address from gd->new_gd directly 2017-10-08 16:19:56 -04:00
bch.c bch: don't use __BSD_VISIBLE to test for fls 2017-09-03 15:30:31 -04:00
bitrev.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
charset.c efi_loader: new function utf8_to_utf16 2017-12-01 13:22:55 +01:00
circbuf.c lib: circbuf: avoid possible null pointer dereference 2017-05-05 16:45:57 -04:00
crc7.c lib: add crc7 from Linux 2011-01-18 23:38:08 +01:00
crc8.c lib/crc8: Add crc start value 2016-04-11 20:48:26 -04:00
crc16.c lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value 2016-03-14 19:18:42 -04:00
crc32.c crc32: Correct endianness of crc32 result 2013-04-19 10:24:14 -04:00
crc32c.c lib: Add CRC32-C 2017-10-02 20:31:25 -04:00
ctype.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
display_options.c display_options: Refactor to allow obtaining the banner 2017-07-11 10:08:19 -06:00
div64.c lib: div64: sync with Linux 2017-04-13 09:41:10 -04:00
errno_str.c lib: errno: introduce errno_str(): returns errno related message 2014-12-11 13:18:41 -07:00
errno.c Add basic errno support. 2010-09-19 19:29:47 +02:00
fdtdec_common.c lib, fdt: Adding fdtdec_get_uint function 2015-11-05 02:34:14 +01:00
fdtdec_test.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
fdtdec.c Merge branch 'rmobile-mx' of git://git.denx.de/u-boot-sh 2017-11-30 10:39:04 -05:00
gunzip.c gzip: add a function to parse the header 2017-10-05 21:31:04 -04:00
gzip.c Move malloc_cache_aligned() to its own header 2015-09-11 17:15:16 -04:00
hang.c Change my mailaddress 2016-05-02 18:37:09 -04:00
hashtable.c spl: saveenv: adding saveenv support in SPL 2016-10-08 09:33:36 -04:00
initcall.c efi: Display the correct initcall pre-relocation values 2015-08-05 08:42:41 -06:00
Kconfig rtc: add support for s35392a 2017-11-20 09:58:31 +01:00
ldiv.c Add LGPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
linux_compat.c linux_compat: handle __GFP_ZERO in kmalloc() 2015-07-22 07:30:44 -06:00
linux_string.c Make linux kernel string funcs available to tools 2012-12-13 11:46:07 -07:00
list_sort.c kbuild: force to define __UBOOT__ in all the C sources 2014-09-16 12:23:56 -04:00
lmb.c lmb: make local functions static 2014-10-25 07:02:01 -04:00
lz4_wrapper.c Fix sandbox build on Ubuntu 10.04 2015-11-18 15:28:59 -05:00
lz4.c Add support for LZ4 decompression algorithm 2015-10-11 17:12:10 -04:00
Makefile lib: allow building lzo for the SPL 2017-10-05 21:31:04 -04:00
md5.c GCC47: Fix warning in md5.c 2012-04-29 14:14:08 +02:00
membuff.c Add a circular memory buffer implementation 2015-11-19 20:27:50 -07:00
net_utils.c lib: net_utils: enforce '.' as octet separator in string_to_ip 2017-01-14 16:47:11 -05:00
of_live.c dm: Fix error handling when unflattening the DT 2017-07-11 10:08:20 -06:00
panic.c lib: Split panic functions out of vsprintf.c 2015-12-13 17:07:30 -07:00
physmem.c lib/physmem.c: Switch to __weak for arch_phys_memset 2016-04-01 17:17:43 -04:00
qsort.c Include common.h in qsort.c to fix build warning 2011-12-07 08:39:54 +01:00
rand.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
rbtree.c kbuild: force to define __UBOOT__ in all the C sources 2014-09-16 12:23:56 -04:00
rc4.c Add rivest cipher 4 (rc4) implementation 2015-07-21 17:39:28 -06:00
sha1.c rsa: Verify RSA padding programatically 2016-11-21 14:07:30 -05:00
sha256.c rsa: Verify RSA padding programatically 2016-11-21 14:07:30 -05:00
slre.c lib/slre: remove superfluous assignment 2017-05-12 08:37:18 -04:00
smbios.c env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
string.c string: Add strcspn() 2017-06-01 07:03:12 -06:00
strmhz.c replace DIV_ROUND with DIV_ROUND_CLOSEST 2014-11-20 11:28:25 -05:00
strto.c lib: strto: fix incorrect handling of specified base 2017-09-14 21:32:59 -04:00
tables_csum.c x86: Move table csum into separate file 2016-10-19 09:01:50 +02:00
time.c bootstage: Provide a default timer function 2017-06-05 14:13:03 -04:00
tiny-printf.c tiny-printf: Add support for %p format 2017-04-13 09:41:09 -04:00
tpm.c tpm: add more missing va_end() 2017-11-17 07:15:52 -07:00
trace.c common: Make sure arch-specific map_sysmem() is defined 2015-04-18 11:11:09 -06:00
uuid.c env: Rename setenv() to env_set() 2017-08-16 08:22:18 -04:00
vsprintf.c vsprintf.c: add GUID printing 2017-09-12 17:58:00 -04:00