Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66f6a6dc authored by Tom Marshall's avatar Tom Marshall
Browse files

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
parent a026a176
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;