Go to file
Mohana Datta Yelugoti c9e090ccf3 testbench: check array size in component parsing
There may be a situation where size of all elements of the
snd_tplg_vendor_array is greater than the private data size.

If we take a look at array structure
struct snd_soc_tplg_vendor_array {
	__le32 size;	/* size in bytes of the array, including all elements */
	__le32 type;	/* SND_SOC_TPLG_TUPLE_TYPE_ */
	__le32 num_elems;	/* number of elements in array */
	union {
		struct snd_soc_tplg_vendor_uuid_elem uuid[0];
		struct snd_soc_tplg_vendor_value_elem value[0];
		struct snd_soc_tplg_vendor_string_elem string[0];
	};
} __attribute__((packed));

and assume of private data size is size.

If num_elems * sizeof(..._elem) > size occurs, this is bad
because, we first try to allocate _size_ bytes via malloc to array
pointer. Since the num_elems * sizeof(..._elem) is greater than
size, we get a segmentation fault when we try to memcpy the
remaining size in the subsequent functions (read tplg_read_array()).

We fix this problem by checking for whether array size falls
within the bounds of private data size.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-13 16:30:41 +00:00
.github/ISSUE_TEMPLATE github: fix link to bug tracking docs 2020-01-09 11:24:06 +00:00
doc audio-stream: dox: add full api documentation 2020-03-28 13:04:55 +01:00
keys Move signing key pair from rimage/ up one level 2020-05-13 10:16:04 +01:00
rimage@7317f2af39 Revert accidental rimage downgrade in "topology: mirror CML topologies for TGL" 2020-07-20 10:39:54 +01:00
scripts zephyr: kconfig: rename CONFIG_SMP -> CONFIG_MULTICORE 2020-07-24 19:55:05 +01:00
smex rimage: Update to version with changed headers location 2020-05-29 11:15:22 +01:00
src zephyr: panic: use zephyr panic APIs when Zephyr is enabled. 2020-08-07 14:26:52 +01:00
test treewide: Remove references to .free and .avail members of audio_stream. 2020-08-03 21:53:14 +01:00
tools testbench: check array size in component parsing 2020-08-13 16:30:41 +00:00
zephyr zephyr: Update README to add instruction for debug loggin on qmeu 2020-07-23 14:58:25 +01:00
.gitignore .gitignore: remove .tarball-version 2020-07-10 15:41:18 +01:00
.gitmodules Add rimage as a git submodule 2020-05-13 10:16:04 +01:00
.travis.yml .travis.yml: build ROM for "buildonly" platforms too 2020-06-23 12:03:15 +01:00
CMakeLists.txt CMakeLists.txt: change generated config.h default to autoconfig.h 2020-06-22 13:01:26 +01:00
CODEOWNERS Remove rimage from source tree 2020-05-13 10:16:04 +01:00
Kconfig Revert "idc: set budget for IDC task" 2020-07-29 15:50:42 -05:00
LICENCE Remove rimage from source tree 2020-05-13 10:16:04 +01:00
README.md README.md: remove misleading "Prerequisites" and "Build Instructions" 2020-07-31 19:07:19 +02:00

README.md

Sound Open Firmware

Status

Build Status Gitter chat IRC chat

Documentation

See docs

Running the tests

See unit testing documentation

Deployment

TODO: Add additional notes about how to deploy this on a live system

Contributing

See Contributing to the Project

License

This project is licensed under the BSD Clause 3 - see the LICENCE file for details