<?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: Unable to store keys in key ring using keyctl</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1545530#M196964</link>
    <description>&lt;P&gt;I found that&amp;nbsp;&lt;FONT face="courier new,courier" color="#993300"&gt;&lt;STRONG&gt;keyctl new_session&lt;/STRONG&gt;&lt;/FONT&gt; worked fine in a terminal login, but I wanted to make a kernel initramfs script to do root filesystem encryption.&lt;/P&gt;&lt;P&gt;I found that it failed within the context of an initramfs script, producing an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;keyctl_session_to_parent: Operation not permitted&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I haven't figured out why it fails in this situation, or how to resolve it. I can create a user key for user root, rather than a session key, but I'd rather create a session key.&lt;/P&gt;&lt;P&gt;Looking in the &lt;A href="https://github.com/torvalds/linux/blob/328c95db01df9d8875f77e49ee4322e60e1337cd/security/keys/keyctl.c#L1621" target="_self"&gt;keyctl_session_to_parent() function in the Linux source&lt;/A&gt;, it looks as though it might fail because (maybe; I haven't confirmed):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The initramfs script is running as PID 1 (init).&lt;/LI&gt;&lt;LI&gt;The parent process is PID 1 (init).&lt;/LI&gt;&lt;LI&gt;The initramfs script is running SUID/SGID.&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Sun, 30 Oct 2022 23:49:27 GMT</pubDate>
    <dc:creator>craigmcqueenir</dc:creator>
    <dc:date>2022-10-30T23:49:27Z</dc:date>
    <item>
      <title>Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1376947#M183535</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am following AN12714[latest version] for encryption storage using CAAM secure keys.&lt;/P&gt;&lt;P&gt;I have successfully generated keys using caam-keygen.&lt;/P&gt;&lt;P&gt;I successfully added a key based on the generated black key in the key retention service using "keyctl"&lt;/P&gt;&lt;P&gt;Following is the output:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;root@imx7-var-som:/# cat /data/caam/randomkey | keyctl padd logon logkey: @s&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;765699361&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but when I check using keyctl then same id doesn't appear&lt;/P&gt;&lt;P&gt;Following is output:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;root@imx7-var-som:/# keyctl list @s&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1 key in keyring:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;24465593: --alswrv 0 65534 keyring: _uid.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what is reason?&lt;/P&gt;&lt;P&gt;My kernel version is &lt;STRONG&gt;5.4.127&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and keyutils version is &lt;STRONG&gt;1.6.1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;dpatil&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>Thu, 25 Nov 2021 09:43:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1376947#M183535</guid>
      <dc:creator>dpatil</dc:creator>
      <dc:date>2021-11-25T09:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1379615#M183815</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/193703"&gt;@dpatil&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; in the app note&amp;nbsp; NXP BSP imx-5.4.47-2.2.0 is mentioned. &lt;BR /&gt;What release (5.4.127) was used in Your case?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Please check Your configuration, using&amp;nbsp; Appendix A (Configuration)&lt;BR /&gt;of the app note.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Yuri.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:06:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1379615#M183815</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2021-12-01T10:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1379637#M183818</link>
      <description>&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;My kernel configuration related to CAAM are as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# CONFIG_CRYPTO_DEV_FSL_CAAM_DMA is not set&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_KEYBLOB_API_DESC=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD=255&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD=2048&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_TK_API=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# CONFIG_CRYPTO_DEV_FSL_CAAM_TK_API_TEST is not set&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_TEST is not set&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CONFIG_CRYPTO_DEV_FSL_CAAM_SM_SLOTSIZE=7&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST is not set&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please find kernel configuration in attachment let me know if anything is missing in kernel configuration&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:58:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1379637#M183818</guid>
      <dc:creator>dpatil</dc:creator>
      <dc:date>2021-12-01T10:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1379649#M183823</link>
      <description>&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;Please find the attached kernel configuration.&lt;/P&gt;&lt;P&gt;Configurations are set as per application note&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhananjay Patil&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 11:14:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1379649#M183823</guid>
      <dc:creator>dpatil</dc:creator>
      <dc:date>2021-12-01T11:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1392872#M185141</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/193703"&gt;@dpatil&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Is it possible to use NXP Linux BSP?&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Yuri.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 05:04:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1392872#M185141</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2021-12-29T05:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1457829#M190343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/193703"&gt;@dpatil&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;on 5.4.XX a session doesn't seem to be created automatically.&lt;/P&gt;&lt;P&gt;This should do the trick:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ keyctl session&lt;/LI-CODE&gt;&lt;P&gt;Another small note to &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/1941"&gt;@Yuri&lt;/a&gt;. Your answer is of poor quality.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 09:24:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1457829#M190343</guid>
      <dc:creator>michael_glembot</dc:creator>
      <dc:date>2022-05-13T09:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1542599#M196762</link>
      <description>&lt;P&gt;Alternatively maybe:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;keyctl new_session&lt;/LI-CODE&gt;&lt;P&gt;That creates a new session in the current process (eg current shell) rather than in a sub-shell.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 09:15:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1542599#M196762</guid>
      <dc:creator>craigmcqueenir</dc:creator>
      <dc:date>2022-10-24T09:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1545530#M196964</link>
      <description>&lt;P&gt;I found that&amp;nbsp;&lt;FONT face="courier new,courier" color="#993300"&gt;&lt;STRONG&gt;keyctl new_session&lt;/STRONG&gt;&lt;/FONT&gt; worked fine in a terminal login, but I wanted to make a kernel initramfs script to do root filesystem encryption.&lt;/P&gt;&lt;P&gt;I found that it failed within the context of an initramfs script, producing an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;keyctl_session_to_parent: Operation not permitted&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I haven't figured out why it fails in this situation, or how to resolve it. I can create a user key for user root, rather than a session key, but I'd rather create a session key.&lt;/P&gt;&lt;P&gt;Looking in the &lt;A href="https://github.com/torvalds/linux/blob/328c95db01df9d8875f77e49ee4322e60e1337cd/security/keys/keyctl.c#L1621" target="_self"&gt;keyctl_session_to_parent() function in the Linux source&lt;/A&gt;, it looks as though it might fail because (maybe; I haven't confirmed):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The initramfs script is running as PID 1 (init).&lt;/LI&gt;&lt;LI&gt;The parent process is PID 1 (init).&lt;/LI&gt;&lt;LI&gt;The initramfs script is running SUID/SGID.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sun, 30 Oct 2022 23:49:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1545530#M196964</guid>
      <dc:creator>craigmcqueenir</dc:creator>
      <dc:date>2022-10-30T23:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to store keys in key ring using keyctl</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1545544#M196969</link>
      <description>&lt;P&gt;Adding it to the user session solved this problem for me. No new session necessary, just:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;cat /data/caam/randomkey | keyctl padd logon logkey: &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/204771"&gt;@US&lt;/a&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 07:26:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Unable-to-store-keys-in-key-ring-using-keyctl/m-p/1545544#M196969</guid>
      <dc:creator>Eximius</dc:creator>
      <dc:date>2022-10-28T07:26:59Z</dc:date>
    </item>
  </channel>
</rss>

