linux/drivers/of
Grant Likely a87fa1d81a of: Fix overflow bug in string property parsing functions
The string property read helpers will run off the end of the buffer if
it is handed a malformed string property. Rework the parsers to make
sure that doesn't happen. At the same time add new test cases to make
sure the functions behave themselves.

The original implementations of of_property_read_string_index() and
of_property_count_strings() both open-coded the same block of parsing
code, each with it's own subtly different bugs. The fix here merges
functions into a single helper and makes the original functions static
inline wrappers around the helper.

One non-bugfix aspect of this patch is the addition of a new wrapper,
of_property_read_string_array(). The new wrapper is needed by the
device_properties feature that Rafael is working on and planning to
merge for v3.19. The implementation is identical both with and without
the new static inline wrapper, so it just got left in to reduce the
churn on the header file.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Darren Hart <darren.hart@intel.com>
Cc: <stable@vger.kernel.org>  # v3.3+: Drop selftest hunks that don't apply
2014-11-04 10:19:48 +00:00
..
testcase-data of: Fix overflow bug in string property parsing functions 2014-11-04 10:19:48 +00:00
Kconfig of/selftest: Use the resolver to fixup phandles 2014-10-04 21:24:35 +01:00
Makefile of: Introduce Device Tree resolve support. 2014-10-04 21:24:26 +01:00
address.c of/pci: Fix the conversion of IO ranges into IO resources 2014-09-30 17:08:40 -06:00
base.c of: Fix overflow bug in string property parsing functions 2014-11-04 10:19:48 +00:00
device.c of: rename of_aliases_mutex to just of_mutex 2014-07-07 13:42:52 +01:00
dynamic.c of: Disabling OF functions that use sysfs if CONFIG_SYSFS disabled 2014-09-08 15:57:25 +01:00
fdt.c of/fdt: fix memory range check 2014-09-25 11:55:50 +01:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
irq.c of/irq: Fix lookup to use 'interrupts-extended' property first 2014-08-16 09:03:58 +01:00
of_mdio.c net: phy: adjust fixed_phy_register() return value 2014-10-07 13:06:45 -04:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
of_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
of_pci.c of/pci: Add support for parsing PCI host bridge resources from DT 2014-09-30 17:08:57 -06:00
of_pci_irq.c of_pci_irq: kill useless variable in of_irq_parse_pci() 2014-05-27 12:13:34 +01:00
of_private.h of: Transactional DT support. 2014-07-23 17:29:15 -06:00
of_reserved_mem.c drivers: of: add return value to of_reserved_mem_device_init() 2014-10-29 16:33:14 -07:00
pdt.c of: device_node kobject lifecycle fixes 2014-03-19 14:58:40 +00:00
platform.c of: amba: use of_dma_configure for AMBA devices 2014-09-22 11:26:59 +01:00
resolver.c of: Introduce Device Tree resolve support. 2014-10-04 21:24:26 +01:00
selftest.c of: Fix overflow bug in string property parsing functions 2014-11-04 10:19:48 +00:00