<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Device Mapper using CAAM</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051132#M234450</link>
    <description>&lt;P&gt;I found this section useful on this page:&lt;/P&gt;&lt;P&gt;10.5.3 DM-Crypt using CAAM backed keys&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2025 22:23:33 GMT</pubDate>
    <dc:creator>ddresser</dc:creator>
    <dc:date>2025-02-25T22:23:33Z</dc:date>
    <item>
      <title>Device Mapper using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2050994#M234442</link>
      <description>&lt;P&gt;Hello, I am trying to implement device mapper using CAAM.&amp;nbsp;&lt;BR /&gt;After configured the kernel adding all the required config options (AN12714 appendix A) and build it with the required tools (CORE_IMAGE_EXTRA_INSTALL+="coreutils keyutils lvm2 e2fsprogs-mke2fs util-linux"), I followed the Usage section (3.2) of the AN12714.&lt;/P&gt;&lt;P&gt;In /proc/crypto I have the tagged key registered:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;name         : tk(cbc(aes))
driver       : tk-cbc-aes-caam
module       : kernel
priority     : 3000
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : yes
blocksize    : 16
min keysize  : 36
max keysize  : 164
ivsize       : 16
chunksize    : 16
walksize     : 16&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"dmsetup targets" returns:&lt;/P&gt;&lt;P&gt;crypt v1.24.0&lt;BR /&gt;multipath v1.14.0&lt;BR /&gt;striped v1.6.0&lt;BR /&gt;linear v1.4.0&lt;BR /&gt;error v1.5.0&lt;/P&gt;&lt;P&gt;I also added the logon key into the keyring but when I try to create a new device mapper:&lt;/P&gt;&lt;P&gt;dmsetup -v create encrypted --table "0 $(blockdev --getsz /dev/loop0) crypt capi:tk(cbc(aes))-plain :36:logon:logkey: 0 /dev/loop0 0 1 sector_size:512"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the "Error decoding and setting key" error:&lt;/P&gt;&lt;P&gt;[18500.454877] device-mapper: table: 252:0: crypt: Error decoding and setting key (-EINVAL)&lt;BR /&gt;[18500.463005] device-mapper: ioctl: error adding target to table&lt;BR /&gt;device-mapper: reload ioctl on encrypted (252:0) failed: Invalid argument&lt;BR /&gt;Command failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I register don't use the tk-cbc-aes key everything works:&amp;nbsp;&lt;/P&gt;&lt;P&gt;dmsetup -v create encrypted --table "0 $(blockdev --getsz /dev/loop0) crypt aes-xts-plain64 e8cfa3dbfe373b536be43c5637387786c01be00ba5f730aacb039e86f3eb72f3 0 /dev/loop0 0"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 16:47:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2050994#M234442</guid>
      <dc:creator>P3r3gr1nus</dc:creator>
      <dc:date>2025-02-25T16:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Device Mapper using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051132#M234450</link>
      <description>&lt;P&gt;I found this section useful on this page:&lt;/P&gt;&lt;P&gt;10.5.3 DM-Crypt using CAAM backed keys&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 22:23:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051132#M234450</guid>
      <dc:creator>ddresser</dc:creator>
      <dc:date>2025-02-25T22:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Device Mapper using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051253#M234463</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;That is correct to follow up the Linux User Guide. The AN12714 is old and actually should be deprecated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 02:49:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051253#M234463</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2025-02-26T02:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Device Mapper using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051913#M234496</link>
      <description>&lt;P&gt;Following the IMX User Guide addressed by&amp;nbsp;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/245849" target="_self"&gt;&lt;SPAN class=""&gt;ddresser&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;, I found that the encryption with the red key works but in order to use the black key sotred in the keyring you need to have the secure boot as stated here:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;10.5.3.1 DM-Crypt with Trusted keys backed by CAAM&lt;BR /&gt;The key de-capsulated from Red-Blob is different for different CAAM states:&lt;BR /&gt;• If System is booted in secure boot with Chain-of-trust established, CAAM state is secure state.&lt;BR /&gt;• If system is booted in non-secure (or compromised) state, CAAM state is non-secure state.&lt;BR /&gt;Note:&lt;BR /&gt;Data that was written in secure state using the trusted key, is not read back from non-trusted or compromised&lt;BR /&gt;system.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is the reason of the error message.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 15:51:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Device-Mapper-using-CAAM/m-p/2051913#M234496</guid>
      <dc:creator>P3r3gr1nus</dc:creator>
      <dc:date>2025-02-26T15:51:42Z</dc:date>
    </item>
  </channel>
</rss>

