commit | 68980bee7536cdc41cbdae1910e79564bf53458b | [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 09 13:29:35 2023 +0000 |
tree | 7961f14c485c2c739a300b5c80e061759f7cfc61 | |
parent | 99a3d1f212ff6c502d85632d70109eecdd99c4b8 [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 Merged-In: 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.