dm-verity 参数介绍0

这篇文章详细描述了DeviceMapper的Verity目标,它利用内核加密API实现块设备的透明完整性检查,通过在磁盘上存储连续的哈希值来确保数据完整。文章还列出了构造参数和各种选项,如校验算法、盐值、错误恢复等。
摘要由CSDN通过智能技术生成

dm-verity

Device-Mapper’s “verity” target provides transparent integrity checking of block devices using a cryptographic digest provided by the kernel crypto API. This target is read-only.

Device-Mapper的“真实性”目标使用内核加密API提供的加密摘要为块设备提供透明的完整性检查。该目标器为只读状态。

Construction Parameters

<version> <dev> <hash_dev>
<data_block_size> <hash_block_size>
<num_data_blocks> <hash_start_block>
<algorithm> <digest> <salt>
[<#opt_params> <opt_params>]
  • This is the type of the on-disk hash format. 0 is the original format used in the Chromium OS.The salt is appended when hashing, digests are stored continuously and the rest of the block is padded with zeroes. 1 is the current format that should be used for new devices.The salt is prepended when hashing and each digest is padded with zeroes to the power of two.

  • This is the device containing data, the integrity of which needs to be checked. It may be specified as a path, like /dev/sdaX, or a device number, :.

  • <hash_dev>

    This is the device that supplies the hash tree data. It may be specified similarly to the device path and may be the same device. If the same device is used, the hash_start should be outside the configured dm-verity device.

  • <data_block_size>

    The block size on a data device in bytes. Each block corresponds to one digest on the hash device.

  • <hash_block_size>

    The size of a hash block in bytes.

  • <num_data_blocks>

    The number of data blocks on the data device. Additional blocks are inaccessible. You can place hashes to the same partition as data, in this case hashes are placed after <num_data_blocks>.

  • <hash_start_block>

    This is the offset, in <hash_block_size>-blocks, from the start of hash_dev to the root block of the hash tree.

  • The cryptographic hash algorithm used for this device. This should be the name of the algorithm, like “sha1”.

  • The hexadecimal encoding of the cryptographic hash of the root hash block and the salt. This hash should be trusted as there is no other authenticity beyond this point.

  • The hexadecimal encoding of the salt value.

  • <#opt_params>

    Number of optional parameters. If there are no optional parameters, the optional parameters section can be skipped or #opt_params can be zero. Otherwise #opt_params is the number of following arguments. Example of optional parameters section:1 ignore_corruption

  • ignore_corruption

    Log corrupted blocks, but allow read operations to proceed normally.

  • restart_on_corruption

    Restart the system when a corrupted block is discovered. This option is not compatible with ignore_corruption and requires user space support to avoid restart loops.

  • panic_on_corruption

    Panic the device when a corrupted block is discovered. This option is not compatible with ignore_corruption and restart_on_corruption.

  • ignore_zero_blocks

    Do not verify blocks that are expected to contain zeroes and always return zeroes instead. This may be useful if the partition contains unused blocks that are not guaranteed to contain zeroes.

  • use_fec_from_device <fec_dev>

    Use forward error correction (FEC) to recover from corruption if hash verification fails. Use encoding data from the specified device. This may be the same device where data and hash blocks reside, in which case fec_start must be outside data and hash areas. If the encoding data covers additional metadata, it must be accessible on the hash device after the hash blocks. Note: block sizes for data and hash devices must match. Also, if the verity is encrypted the <fec_dev> should be too.

  • fec_roots

    Number of generator roots. This equals to the number of parity bytes in the encoding data. For example, in RS(M, N) encoding, the number of roots is M-N.

  • fec_blocks

    The number of encoding data blocks on the FEC device. The block size for the FEC device is <data_block_size>.

  • fec_start

    This is the offset, in <data_block_size> blocks, from the start of the FEC device to the beginning of the encoding data.

  • check_at_most_once

    Verify data blocks only the first time they are read from the data device, rather than every time. This reduces the overhead of dm-verity so that it can be used on systems that are memory and/or CPU constrained. However, it provides a reduced level of security because only offline tampering of the data device’s content will be detected, not online tampering. Hash blocks are still verified each time they are read from the hash device, since verification of hash blocks is less performance critical than data blocks, and a hash block will not be verified any more after all the data blocks it covers have been verified anyway.

  • root_hash_sig_key_desc <key_description>

    This is the description of the USER_KEY that the kernel will lookup to get the pkcs7 signature of the roothash. The pkcs7 signature is used to validate the root hash during the creation of the device mapper block device. Verification of roothash depends on the config DM_VERITY_VERIFY_ROOTHASH_SIG being set in the kernel. The signatures are checked against the builtin trusted keyring by default, or the secondary trusted keyring if DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING is set. The secondary trusted keyring includes by default the builtin trusted keyring, and it can also gain new certificates at run time if they are signed by a certificate already in the secondary trusted keyring.

  • try_verify_in_tasklet

    If verity hashes are in cache, verify data blocks in kernel tasklet instead of workqueue. This option can reduce IO latency.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值