summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorTom Marshall <tdm.code@gmail.com>2018-03-06 16:19:18 +0100
committerTom Marshall <tdm.code@gmail.com>2018-03-07 17:59:57 +0100
commit66f6a6dc6767436f7e514d3a759c9c38179060e7 (patch)
treed743b8ec303359c66b431cecaededc192cf202f3 /fs_mgr
parenta026a176ffb99f6f415795a05d39f30b023f5c6f (diff)
downloadsystem_core-66f6a6dc6767436f7e514d3a759c9c38179060e7.tar.gz
system_core-66f6a6dc6767436f7e514d3a759c9c38179060e7.tar.bz2
system_core-66f6a6dc6767436f7e514d3a759c9c38179060e7.zip
fs_mgr: Ignore invalid DT device nodes
With treble, the vendor kernel and ramdisk are supposed to be used. But vendors always find new and interesting ways to break things: $ cat /proc/device-tree/firmware/android/fstab/system/dev; echo /by-name/system_a $ Change-Id: I826a96ebd625b52563d3cc970bf99d9b26dc093e
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr_fstab.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp
index 9b7405a3d..72a65d264 100644
--- a/fs_mgr/fs_mgr_fstab.cpp
+++ b/fs_mgr/fs_mgr_fstab.cpp
@@ -33,6 +33,8 @@
#include "fs_mgr_priv.h"
+using android::base::StartsWith;
+
const std::string kDefaultAndroidDtDir("/proc/device-tree/firmware/android");
struct fs_mgr_flag_values {
@@ -439,6 +441,10 @@ static std::string read_fstab_from_dt() {
LERROR << "dt_fstab: Failed to find device for partition " << dp->d_name;
return {};
}
+ if (!StartsWith(value, "/dev")) {
+ LERROR << "dt_fstab: Invalid device node for partition " << dp->d_name;
+ return {};
+ }
fstab_entry.push_back(value);
std::string mount_point;