Loading arch/arm64/boot/dts/qcom/dm-verity-boot.dtsi 0 → 100644 +28 −0 Original line number Diff line number Diff line /* Copyright (c) 2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ dm_verity { dmname="disabled"; version="1"; data_device="/dev/sda6"; hash_device="/dev/sda6"; data_block_size="4096"; hash_block_size="4096"; number_of_data_blocks="262144"; hash_start_block="262145"; algorithm="sha256"; // root hash: 64 bytes long digest= "b0fe12d7da6e23a1e19b5a69252c7aaf7b249191eb13bba3f566d630b3f2828a"; salt="a2df040e00f02c3b2a19e90e5aa76fe1a303f4e08584aaf40e87f088a32b7709"; // restart_on_corruption ignore_corruption ignore_zero_blocks opt="restart_on_corruption"; }; arch/arm64/boot/dts/qcom/sa8155.dtsi +2 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,8 @@ read-only; ranges; }; /include/ "dm-verity-boot.dtsi" }; &ipa_hw { Loading drivers/md/dm-ioctl.c +35 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ */ #include "dm-core.h" #include "dm-ioctrl.h" #include <linux/module.h> #include <linux/vmalloc.h> Loading Loading @@ -2056,3 +2057,37 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid) return r; } int __init dm_ioctrl(uint cmd, struct dm_ioctl *param) { int r = 0; int ioctl_flags; ioctl_fn fn = NULL; size_t input_param_size; /* * Nothing more to do for the version command. */ if (cmd == DM_VERSION_CMD) return 0; DMDEBUG("dm_ctl_ioctl: command 0x%x", cmd); fn = lookup_ioctl(cmd, &ioctl_flags); if (!fn) { DMWARN("dm_ctl_ioctl: unknown command 0x%x", cmd); return -ENOTTY; } input_param_size = param->data_size; param->data_size = sizeof(*param); r = fn(NULL, param, input_param_size); if (unlikely(param->flags & DM_BUFFER_FULL_FLAG) && unlikely(ioctl_flags & IOCTL_FLAGS_NO_PARAMS)) DMERR("ioctl %d but has IOCTL_FLAGS_NO_PARAMS set", cmd); return r; } EXPORT_SYMBOL(dm_ioctrl); drivers/md/dm-ioctrl.h 0 → 100644 +20 −0 Original line number Diff line number Diff line /* Copyright (c) 2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef DM_IOCTRL_INTERNAL_H #define DM_IOCTRL_INTERNAL_H #include <linux/dm-ioctl.h> int dm_ioctrl(uint cmd, struct dm_ioctl *param); #endif init/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o mounts-$(CONFIG_BLK_DEV_DM) += do_mounts_dm.o mounts-$(CONFIG_BLK_DEV_DM) += do_mounts_verity.o # dependencies on generated files need to be listed explicitly $(obj)/version.o: include/generated/compile.h Loading Loading
arch/arm64/boot/dts/qcom/dm-verity-boot.dtsi 0 → 100644 +28 −0 Original line number Diff line number Diff line /* Copyright (c) 2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ dm_verity { dmname="disabled"; version="1"; data_device="/dev/sda6"; hash_device="/dev/sda6"; data_block_size="4096"; hash_block_size="4096"; number_of_data_blocks="262144"; hash_start_block="262145"; algorithm="sha256"; // root hash: 64 bytes long digest= "b0fe12d7da6e23a1e19b5a69252c7aaf7b249191eb13bba3f566d630b3f2828a"; salt="a2df040e00f02c3b2a19e90e5aa76fe1a303f4e08584aaf40e87f088a32b7709"; // restart_on_corruption ignore_corruption ignore_zero_blocks opt="restart_on_corruption"; };
arch/arm64/boot/dts/qcom/sa8155.dtsi +2 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,8 @@ read-only; ranges; }; /include/ "dm-verity-boot.dtsi" }; &ipa_hw { Loading
drivers/md/dm-ioctl.c +35 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ */ #include "dm-core.h" #include "dm-ioctrl.h" #include <linux/module.h> #include <linux/vmalloc.h> Loading Loading @@ -2056,3 +2057,37 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid) return r; } int __init dm_ioctrl(uint cmd, struct dm_ioctl *param) { int r = 0; int ioctl_flags; ioctl_fn fn = NULL; size_t input_param_size; /* * Nothing more to do for the version command. */ if (cmd == DM_VERSION_CMD) return 0; DMDEBUG("dm_ctl_ioctl: command 0x%x", cmd); fn = lookup_ioctl(cmd, &ioctl_flags); if (!fn) { DMWARN("dm_ctl_ioctl: unknown command 0x%x", cmd); return -ENOTTY; } input_param_size = param->data_size; param->data_size = sizeof(*param); r = fn(NULL, param, input_param_size); if (unlikely(param->flags & DM_BUFFER_FULL_FLAG) && unlikely(ioctl_flags & IOCTL_FLAGS_NO_PARAMS)) DMERR("ioctl %d but has IOCTL_FLAGS_NO_PARAMS set", cmd); return r; } EXPORT_SYMBOL(dm_ioctrl);
drivers/md/dm-ioctrl.h 0 → 100644 +20 −0 Original line number Diff line number Diff line /* Copyright (c) 2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef DM_IOCTRL_INTERNAL_H #define DM_IOCTRL_INTERNAL_H #include <linux/dm-ioctl.h> int dm_ioctrl(uint cmd, struct dm_ioctl *param); #endif
init/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o mounts-$(CONFIG_BLK_DEV_DM) += do_mounts_dm.o mounts-$(CONFIG_BLK_DEV_DM) += do_mounts_verity.o # dependencies on generated files need to be listed explicitly $(obj)/version.o: include/generated/compile.h Loading