<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=gb2312"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@ËÎÌå";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:΢ÈíÑźÚ;
panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
{font-family:"\@΢ÈíÑźÚ";
panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:ËÎÌå;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Ô¤Éè¸ñʽ Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:ËÎÌå;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"΢ÈíÑźÚ",sans-serif;
color:windowtext;}
span.HTMLChar
{mso-style-name:"HTML Ô¤Éè¸ñʽ Char";
mso-style-priority:99;
mso-style-link:"HTML Ô¤Éè¸ñʽ";
font-family:ËÎÌå;}
span.hljs-attr
{mso-style-name:hljs-attr;}
span.hljs-string
{mso-style-name:hljs-string;}
span.hljs-subst
{mso-style-name:hljs-subst;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link="#0563C1" vlink="#954F72" style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'>Dear OpenBMC developer(s):<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> I have a problem with IMA/EVM func of OpenBMC. I enabled IMA function, but it doesn't seem to work.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> I change the policy in IMA (appraise func=MMAP_CHECK mask=MAY_EXEC appraise_type=imasig && appraise func=BPRM_CHECK mask=MAY_EXEC appraise_type=imasig), and upload a program (by SSH, without sig), It can run without any blocking. The expectation is that it should be rejected.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> I check /sys/kernel/security/ima/ascii_runtime_measurements, it has the value like ¡°10 XXXXXXXXXXXX ima-sig sha256:YYYYYYYYYYYYYYY /root/home/root/program¡±. <o:p></o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'>After that I use ¡°echo TEST >> program¡± to change the program file, and it can run as usual, and a new item like ¡°10 AAAAAAAAAA ima-sig sha256:BBBBBBBBBBBBBB /root/run/media/rwfs-alt/cow/home/root/program¡±shows in /sys/kernel/security/ima/ascii_runtime_measurements. Every time I change the file and run it, a new item will add to ascii_runtime_measurements. I don¡¯t know why and how to fix it.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'>(XXXX/YYYY/AAAA/BBBB represent hash values or other hexadecimal strings)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> Env: Qemu with AST2600<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> Local.conf of project (what I modified):<o:p></o:p></span></p><pre style='background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'>DISTRO_FEATURES:append = </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>" integrity ima"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p></o:p></span></pre><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p> </o:p></span></p><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'> IMAGE_CLASSES += </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>"ima-evm-rootfs"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p></o:p></span></p><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p> </o:p></span></p><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'> IMA_EVM_KEY_DIR = </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm'>${INTEGRITY_BASE}</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>/data/debug-keys" (replaced by my keys)</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p></o:p></span></p><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'> IMA_EVM_PRIVKEY = </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm'>${IMA_EVM_KEY_DIR}</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>/privkey_ima.pem"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p></o:p></span></p><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'> IMA_EVM_X509 = </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm'>${IMA_EVM_KEY_DIR}</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>/x509_ima.der"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'><o:p></o:p></span></p><p class=MsoNormal align=left style='text-align:left;background:#F7F7F7'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737;border:none windowtext 1.0pt;padding:0cm'> IMA_EVM_ROOT_CA = </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm'>${IMA_EVM_KEY_DIR}</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#DD1144;border:none windowtext 1.0pt;padding:0cm'>/ima-local-ca.pem"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#373737'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> Boot log: Log file in email attachment<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"΢ÈíÑźÚ",sans-serif;color:#3E3A3A'> System Env:<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US style='color:#2E75B6;mso-style-textfill-fill-color:#2E75B6;mso-style-textfill-fill-alpha:100.0%'>root@NULL:~# cat /sys/kernel/security/ima/policy<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x9fa0<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x62656572<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x64626720<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x1021994<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x1cd1<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x42494e4d<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x73636673<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0xf97cff8c<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x43415d53<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x27e0eb<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x63677270<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0x6e736673<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_measure fsmagic=0xde5e81e4<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=MMAP_CHECK mask=MAY_EXEC<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=BPRM_CHECK mask=MAY_EXEC<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=FILE_CHECK mask=^MAY_READ euid=0<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=FILE_CHECK mask=^MAY_READ uid=0<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=MODULE_CHECK<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=FIRMWARE_CHECK<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>measure func=POLICY_CHECK<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x9fa0<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x62656572<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x64626720<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x1021994<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x858458f6<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x1cd1<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x42494e4d<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x73636673<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0xf97cff8c<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x43415d53<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x6e736673<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0xde5e81e4<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x27e0eb<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>dont_appraise fsmagic=0x63677270<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>appraise func=POLICY_CHECK appraise_type=imasig<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>appraise func=MMAP_CHECK mask=MAY_EXEC appraise_type=imasig<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>appraise func=BPRM_CHECK mask=MAY_EXEC appraise_type=imasig (I rewirte the default appraise policy in ima_policy.c in kernel, so I can appraise progs with sig by default)<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US style='color:#2E75B6;mso-style-textfill-fill-color:#2E75B6;mso-style-textfill-fill-alpha:100.0%'>root@NULL:~# fw_printenv<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>baudrate=115200<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>bootargs=console=ttyS4,115200n8 root=/dev/ram rw ima_policy=tcb ima_policy=appraise_tcb<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>bootcmd=run bootspi<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>bootdelay=2<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>bootfile=all.bin<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>bootspi=fdt addr 20100000 && fdt header get fitsize totalsize && cp.b 20100000 ${loadaddr} ${fitsize} && bootm; echo Error loading kernel FIT image<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>currentpartition=0<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>fdtcontroladdr=bcf8a6e8<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>gatewayip=192.168.0.1<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>ipaddr=192.168.0.45<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>loadaddr=0x83000000<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>netmask=255.255.255.0<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>rollback-reason=no_rollback<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>serverip=192.168.0.81<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>stderr=serial@1e784000<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>stdin=serial@1e784000<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>stdout=serial@1e784000<o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>verify=yes <o:p></o:p></span></p><p class=MsoNormal style='background:#F2F2F2'><span lang=EN-US>nextpartition=0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US>Thank you very much for your help<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>