freebsd-skq/sys/dev/ofw
Brandon Bergren 26869ad14c [PowerPC] Allow traversal of oversize OF properties.
In standards such as LoPAPR, property names in excess of the usual 31
characters exist.

This breaks property traversal.

While in IEEE 1275-1994, nextprop is defined explicitly to work with a
32-byte region of memory, using a larger buffer should be fine. There is
actually no way to pass a buffer length to the nextprop call in the OF
client interface, so SLOF actually just blindly overflows the buffer.

So we have to defensively make the buffer larger, to avoid memory
corruption when reading out long properties on live OF systems.

Note also that on real-mode OF, things are pretty tight because we are
allocating against a static bounce buffer in low memory, so we can't just
use a huge buffer to work around this without it being wasteful of our
limited amount of 32-bit physical memory.

This allows a patched ofwdump to operate properly on SLOF (i.e. pseries)
systems, as well as any other PowerPC systems with overlength properties.

Reviewed by:	jhibbits
MFC after:	2 weeks
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D26669
2020-11-13 16:49:41 +00:00
..
ofw_bus_if.m
ofw_bus_subr.c ofw: clean up empty lines in .c and .h files 2020-09-01 22:01:53 +00:00
ofw_bus_subr.h
ofw_bus.h
ofw_console.c tty: convert tty_lock_assert to tty_assert_locked to hide lock type 2020-04-17 18:34:49 +00:00
ofw_cpu.c ofw: clean up empty lines in .c and .h files 2020-09-01 22:01:53 +00:00
ofw_cpu.h
ofw_disk.c
ofw_fdt.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (11 of many) 2020-02-24 10:41:22 +00:00
ofw_graph.c
ofw_graph.h ofw: clean up empty lines in .c and .h files 2020-09-01 22:01:53 +00:00
ofw_if.m
ofw_pci.h
ofw_standard.c ofw: clean up empty lines in .c and .h files 2020-09-01 22:01:53 +00:00
ofw_subr.c
ofw_subr.h
ofwbus.c
ofwpci.c ofw: clean up empty lines in .c and .h files 2020-09-01 22:01:53 +00:00
ofwpci.h
ofwvar.h
openfirm.c
openfirm.h Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00
openfirmio.c [PowerPC] Allow traversal of oversize OF properties. 2020-11-13 16:49:41 +00:00
openfirmio.h [PowerPC] Allow traversal of oversize OF properties. 2020-11-13 16:49:41 +00:00
openpromio.c
openpromio.h