commit | 0dcc75e67a019b491b3447e54dcc6931b79de714 | [log] [tgz] |
---|---|---|
author | Pierre-Clément Tosi <ptosi@google.com> | Tue May 02 13:43:55 2023 +0000 |
committer | Pierre-Clément Tosi <ptosi@google.com> | Tue May 02 17:38:28 2023 +0000 |
tree | 6f8b627904b8829f7ee0497f73d9f07b108510c3 | |
parent | a0bfc86ab920ba10b7d29a2f567d6d31d6dbadca [diff] |
libs: libfdt: Fix Fdt::header() using bad pointer Fix a bug where a reference to the DT was erroneously obtained through &self (instead of self) which was causing Fdt::totalsize() to return a wrong value (probably read from the stack where &self pointed to), in turn making Fdt::as_slice() return the wrong region of memory. This UB seems to have consistently resulted in fdt.totalsize() == 0 i.e. fdt.as_slice() == &[] and has gone unnoticed until now. Avoid casting pointers with as in as_{mut_,}ptr(). Bug: 280425124 Test: atest MicrodroidHostTests Change-Id: Ie31f6c6f19e756ee843d1fd2f11f106590e99395
This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.