History log of /src/common/include/prop/proplib.h |
Revision | | Date | Author | Comments |
1.7 |
| 13-Sep-2009 |
pooka | branches: 1.7.48; Wipe out the last vestiges of POOL_INIT with one swift stroke. In most cases, use a proper constructor. For proplib, give a local equivalent of POOL_INIT for the kernel object implementation. This way the code structure can be preserved, and a local link set is not hazardous anyway (unless proplib is split to several modules, but that'll be the day).
tested by booting a kernel in qemu and compile-testing i386/ALL
|
1.6 |
| 28-Apr-2008 |
martin | Remove clause 3 and 4 from TNF licenses
|
1.5 |
| 17-Aug-2007 |
pavel | branches: 1.5.8; struct plistref does not reference other proplib data types, so split it in its own header file to be included by dkio.h. Fixes breakage due to pollution from proplib.h in programs which include ioctl.h. Tested and OK by dogcow@.
|
1.4 |
| 22-Sep-2006 |
thorpej | branches: 1.4.2; 1.4.4; 1.4.12; Alter the protocol impemented by prop_kern to allow for bi-directional plist-based messages and to eliminate looping previously required to receive a plist from the kernel:
- prop_dictionary_copyin_ioctl() and prop_dictionary_copyout_ioctl() now take the cmd argument rather than the file open flag. The read-ness or write-ness of an ioctl command is checked by these routines to ensure that information is being passed to/from the userland component properly.
- prop_dictionary_copyout_ioctl() now allocates the memory for the XML plist on behalf of the userland component by way of uvm_mmap(). The XML plist is copied out to the newly-mapped anonymous region, and the pointer returned via the plistref.
- prop_dictionary_recv_ioctl() is responsible for munmap()'ing the region after parsing the XML plist into internal represenatation.
- A new prop_dictionary_sendrecv_ioctl() is added, allowing user space code to send a dictionary to the kernel and receive one back as a reply.
Update users of prop_kern for the API changes (Bluetooth).
This constitutes an ABI / protocol change -- but this will also be put into NetBSD 4.0 so that the first proplib release will implement the new scheme.
|
1.3 |
| 21-Aug-2006 |
thorpej | Several changes to proplib: - Arrays can now be externalized and internalized in the same way dictionaries can. - Add new "externalize to file" and "internalize from file" functions to make reading a property list from a file and writing a property list to a file more convenient. - Many assertions in the object implementations are gone. Instead, calling an accessor for one object type with a different object type as an argument will return a suitable "invalid" value. - prop_object_type() now returns a new PROP_TYPE_UNKNOWN value if called with a NULL object. - Externalized property lists now contain a reference to the Apple XML plist DTD. - Add a new prop_ingest(3) facility, which provides a convenient way to translate a dictionary into an arbitrary binary representation.
|
1.2 |
| 05-Jul-2006 |
thorpej | branches: 1.2.2; Add kernel and user space parts of a protocol for sending property lists to / from the kernel using ioctls.
|
1.1 |
| 27-Apr-2006 |
thorpej | Initial commit of proplib, a library for manipulating property lists and converting to/from an XML external representation (based on Apple XML property lists). Works in the kernel and user space.
|
1.2.2.1 |
| 23-Aug-2006 |
tron | Pull up following revision(s) (requested by thorpej in ticket #43): common/include/prop/prop_ingest.h: revision 1.1 common/lib/libprop/prop_number.c: revision 1.4 common/include/prop/prop_array.h: revision 1.3 common/lib/libprop/prop_object_impl.h: revision 1.4 common/include/prop/prop_dictionary.h: revision 1.4 distrib/sets/lists/comp/mi: revision 1.911 common/include/prop/Makefile: revision 1.2 common/lib/libprop/prop_bool.c: revision 1.4 distrib/sets/lists/base/shl.mi: revision 1.365 common/lib/libprop/prop_data.c: revision 1.3 lib/libprop/shlib_version: revision 1.4 lib/libprop/Makefile: revision 1.6 common/lib/libprop/prop_object.c: revision 1.4 common/lib/libprop/prop_object.3: revision 1.4 common/include/prop/proplib.h: revision 1.3 common/lib/libprop/Makefile.inc: revision 1.3 common/include/prop/prop_object.h: revision 1.4 common/lib/libprop/prop_array.c: revision 1.4 common/lib/libprop/prop_array.3: revision 1.4 common/lib/libprop/prop_string.c: revision 1.3 common/lib/libprop/prop_dictionary.3: revision 1.4 common/lib/libprop/prop_ingest.c: revision 1.1 common/lib/libprop/prop_ingest.3: revision 1.1 common/lib/libprop/prop_dictionary.c: revision 1.9 Several changes to proplib: - Arrays can now be externalized and internalized in the same way dictionaries can. - Add new "externalize to file" and "internalize from file" functions to make reading a property list from a file and writing a property list to a file more convenient. - Many assertions in the object implementations are gone. Instead, calling an accessor for one object type with a different object type as an argument will return a suitable "invalid" value. - prop_object_type() now returns a new PROP_TYPE_UNKNOWN value if called with a NULL object. - Externalized property lists now contain a reference to the Apple XML plist DTD. - Add a new prop_ingest(3) facility, which provides a convenient way to translate a dictionary into an arbitrary binary representation.
|
1.4.12.1 |
| 30-Sep-2007 |
wrstuden | Catch up on netbsd-4 as of a few days ago.
|
1.4.4.1 |
| 27-Sep-2007 |
xtraeme | Pull up following revision(s) (requested by joerg in ticket #904): sbin/veriexecctl/veriexecctl.c: revision 1.29 (via patch) common/lib/libprop/prop_string.c: revision 1.9 (via patch) distrib/sets/lists/comp/mi: revision 1.1063 (via patch) common/lib/libprop/prop_kern.c: revision 1.8 (via patch) common/include/prop/prop_string.h: revision 1.2 (via patch) common/include/prop/prop_ingest.h: revision 1.2 (via patch) usr.sbin/btdevctl/btdevctl.c: revision 1.5 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.14 (via patch) common/lib/libprop/prop_rb.c: revision 1.7 (via patch) common/include/prop/prop_array.h: revision 1.5 (via patch) common/lib/libprop/prop_stack.h: revision 1.1 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.16 (via patch) common/lib/libprop/prop_number.3: revision 1.7 (via patch) common/lib/libprop/prop_stack.h: revision 1.2 (via patch) common/lib/libprop/prop_stack.c: revision 1.1 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.17 (via patch) common/lib/libprop/prop_dictionary_util.c: revision 1.2 (via patch) common/lib/libprop/prop_dictionary_util.3: revision 1.2 (via patch) common/lib/libprop/prop_dictionary.c: revision 1.18 (via patch) common/lib/libprop/prop_stack.c: revision 1.2 (via patch) common/lib/libprop/prop_object_impl.h: revision 1.18 (via patch) common/lib/libprop/prop_dictionary.c: revision 1.19 (via patch) common/include/prop/prop_bool.h: revision 1.3 (via patch) common/include/prop/prop_dictionary.h: revision 1.7 (via patch) common/include/prop/prop_data.h: revision 1.2 (via patch) sys/sys/dkio.h: revision 1.14 (via patch) usr.sbin/btdevctl/sdp.c: revision 1.4 (via patch) common/include/prop/Makefile: revision 1.3 (via patch) common/include/prop/prop_number.h: revision 1.5 (via patch) common/lib/libprop/prop_object.c: revision 1.14 (via patch) common/lib/libprop/prop_object.c: revision 1.15 (via patch) common/lib/libprop/prop_object.c: revision 1.16 (via patch) common/lib/libprop/prop_bool.3: revision 1.3 (via patch) common/lib/libprop/prop_data.3: revision 1.4 (via patch) common/lib/libprop/prop_object.3: revision 1.6 (via patch) common/lib/libprop/prop_data.c: revision 1.7 (via patch) common/lib/libprop/prop_data.c: revision 1.8 (via patch) common/lib/libprop/prop_data.c: revision 1.9 (via patch) common/lib/libprop/prop_dictionary.c: revision 1.20 (via patch) usr.sbin/btdevctl/print.c: revision 1.9 (via patch) sbin/veriexecctl/veriexecctl_parse.y: revision 1.22 (via patch) common/lib/libprop/prop_number.c: revision 1.12 (via patch) common/include/prop/proplib.h: revision 1.5 (via patch) common/lib/libprop/prop_number.c: revision 1.13 (via patch) common/lib/libprop/prop_number.c: revision 1.14 (via patch) common/include/prop/prop_object.h: revision 1.5 (via patch) common/lib/libprop/prop_array.3: revision 1.5 (via patch) common/include/prop/prop_object.h: revision 1.6 (via patch) common/lib/libprop/prop_string.3: revision 1.4 (via patch) common/lib/libprop/prop_bool.c: revision 1.10 (via patch) common/lib/libprop/Makefile.inc: revision 1.6 (via patch) common/lib/libprop/prop_ingest.c: revision 1.2 (via patch) common/lib/libprop/prop_bool.c: revision 1.11 (via patch) common/lib/libprop/prop_array.c: revision 1.10 (via patch) common/lib/libprop/prop_ingest.3: revision 1.3 (via patch) common/lib/libprop/prop_bool.c: revision 1.12 (via patch) common/lib/libprop/prop_array.c: revision 1.11 (via patch) common/lib/libprop/prop_string.c: revision 1.7 (via patch) common/lib/libprop/prop_dictionary.3: revision 1.8 (via patch) common/lib/libprop/prop_array.c: revision 1.9 (via patch) usr.sbin/btdevctl/db.c: revision 1.4 (via patch) common/lib/libprop/prop_string.c: revision 1.8 (via patch) common/include/prop/plistref.h: revision 1.1 (via patch) Consider '\r' to be white space. Discussed with and also kept as local change by freza. With this change, DOS style line endings work.
boolean_t -> bool TRUE -> true FALSE -> false
libprop is currently using a recursive parser. While this is fine for userland, deeply nested arrays and dictionaries can easily overflow the kernel stack and thereby force a panic.
Fix the internalizer and prop_object_release to use a separate call stack and alter the dictionary and array handling to not recurse on the C stack. The default stack has an inline depth of 16 elements, which should keep the overhead reasonable.
This issue was found by Pavel Cahyna and Jachym Holecek.
Additionally add a limit for prop_object_copyin_ioctl to prevent user programs from temporary allocating unbound amount of kernel memory.
Allow malloc to fail so that tight loops of userland processes can't force panics by exhausting the kernel map.
Tested with the sample exploit of Jachym, his test suite and reviewed by himself (initial patch), Christos Zoulas and Jason Thorpe. struct plistref does not reference other proplib data types, so split it in its own header file to be included by dkio.h. Fixes breakage due to pollution from proplib.h in programs which include ioctl.h. Tested and OK by dogcow@.
Attempt at fixing build failures after proplib was converted to bool: FALSE -> false, TRUE -> true, boolean_t -> bool, int -> bool when appropriate, include stdbool.h . proplib.h no longer provides boolean_t, so it is necessary to change to bool. From Tom Spindler (dogcow@).
Avoid using unbound amount of stack frames in prop_object_equal by using a dynamic stack as well. Reorder arguments for the internalizer as the iteration is always present and should go before possibly NULL arguments. Reviewed by mjf@ and adrianp@
|
1.4.2.2 |
| 22-Sep-2006 |
thorpej | Alter the protocol impemented by prop_kern to allow for bi-directional plist-based messages and to eliminate looping previously required to receive a plist from the kernel:
- prop_dictionary_copyin_ioctl() and prop_dictionary_copyout_ioctl() now take the cmd argument rather than the file open flag. The read-ness or write-ness of an ioctl command is checked by these routines to ensure that information is being passed to/from the userland component properly.
- prop_dictionary_copyout_ioctl() now allocates the memory for the XML plist on behalf of the userland component by way of uvm_mmap(). The XML plist is copied out to the newly-mapped anonymous region, and the pointer returned via the plistref.
- prop_dictionary_recv_ioctl() is responsible for munmap()'ing the region after parsing the XML plist into internal represenatation.
- A new prop_dictionary_sendrecv_ioctl() is added, allowing user space code to send a dictionary to the kernel and receive one back as a reply.
Update users of prop_kern for the API changes (Bluetooth).
This constitutes an ABI / protocol change -- but this will also be put into NetBSD 4.0 so that the first proplib release will implement the new scheme.
|
1.4.2.1 |
| 22-Sep-2006 |
thorpej | file proplib.h was added on branch newlock2 on 2006-09-22 04:20:24 +0000
|
1.5.8.1 |
| 18-May-2008 |
yamt | sync with head.
|
1.7.48.2 |
| 21-Apr-2020 |
martin | Ooops, restore accidently removed files from merge mishap
|
1.7.48.1 |
| 21-Apr-2020 |
martin | Sync with HEAD
|