usbarmory / caam-keyblob

NXP Cryptographic Acceleration and Assurance Module (CAAM) - Linux driver
Other
43 stars 11 forks source link

imx8mmevk caam-keyblob #8

Closed OmarAberkan closed 5 years ago

OmarAberkan commented 5 years ago

Hello, first of all many thanks for publishing this tool. I tried to install the kernel module on a imx8mmevk, i followed all steps in the description. Like you said earlier it needs some modifications to work on the imx8. I don't know if you are interested to implement this, but can you at least give me some hints about what i could do to make this kernel module work?

This is all the information i can give you.

OmarAberkan commented 5 years ago

dmesg:

[ 99.976812] caam_keyblob caam-keyblob: caam_keyblob: initialized [ 99.977366] Synchronous External Abort: synchronous external abort (0x96000210) at 0xffff000009cad014 [ 99.977375] Internal error: : 96000210 [#1] PREEMPT SMP [ 99.982609] Modules linked in: caam_keyblob(O+) [ 99.987150] CPU: 3 PID: 4314 Comm: insmod Tainted: G O 4.14.78-05595-g94da7bd-dirty #1 [ 99.996194] Hardware name: FSL i.MX8MM EVK board (DT) [ 100.001245] task: ffff800075210000 task.stack: ffff000019e08000 [ 100.007171] PC is at caam_keyblob_probe+0x98/0x1a8 [caam_keyblob] [ 100.013267] LR is at caam_keyblob_probe+0x94/0x1a8 [caam_keyblob] [ 100.019359] pc : [] lr : [] pstate: 60000145 [ 100.026751] sp : ffff000019e0bab0 [ 100.030065] x29: ffff000019e0bab0 x28: ffff000019e0d000 [ 100.035376] x27: 0000000000000124 x26: ffff000008146330 [ 100.040687] x25: 0000000000000009 x24: ffff000000da2058 [ 100.045999] x23: 0000000000000000 x22: 0000000000000000 [ 100.051311] x21: 0000000000000000 x20: ffff80007a899000 [ 100.056624] x19: ffff800074fd6500 x18: 0140000000000000 [ 100.061938] x17: 000000000042a2c8 x16: ffff00000814a0e8 [ 100.067250] x15: ffff0000094f2038 x14: 0000000000000000 [ 100.072562] x13: ffff0000096c0158 x12: ffff00000931b000 [ 100.077875] x11: 0000000000000000 x10: 0000000000000001 [ 100.083187] x9 : 0000000000000001 x8 : ffff008009cad000 [ 100.088499] x7 : 0040000000000001 x6 : ffff000009cae000 [ 100.093813] x5 : ffff80007fffd278 x4 : ffff000009cae000 [ 100.099125] x3 : ffff000009cadfff x2 : 00000000000020cd [ 100.104438] x1 : ffff000009dfffff x0 : ffff000009cad014 [ 100.109753] Process insmod (pid: 4314, stack limit = 0xffff000019e08000) [ 100.116453] Call trace: [ 100.118900] Exception stack(0xffff000019e0b970 to 0xffff000019e0bab0) [ 100.125341] b960: ffff000009cad014 ffff000009dfffff [ 100.133169] b980: 00000000000020cd ffff000009cadfff ffff000009cae000 ffff80007fffd278 [ 100.140999] b9a0: ffff000009cae000 0040000000000001 ffff008009cad000 0000000000000001 [ 100.148826] b9c0: 0000000000000001 0000000000000000 ffff00000931b000 ffff0000096c0158 [ 100.156655] b9e0: 0000000000000000 ffff0000094f2038 ffff00000814a0e8 000000000042a2c8 [ 100.164484] ba00: 0140000000000000 ffff800074fd6500 ffff80007a899000 0000000000000000 [ 100.172313] ba20: 0000000000000000 0000000000000000 ffff000000da2058 0000000000000009 [ 100.180141] ba40: ffff000008146330 0000000000000124 ffff000019e0d000 ffff000019e0bab0 [ 100.187970] ba60: ffff000000da01a4 ffff000019e0bab0 ffff000000da01a8 0000000060000145 [ 100.195801] ba80: 0000000000000000 0000000000000000 0000ffffffffffff ffff000019e0b808 [ 100.203627] baa0: ffff000019e0bab0 ffff000000da01a8 [ 100.208510] [] caam_keyblob_probe+0x98/0x1a8 [caam_keyblob] [ 100.215651] [] platform_drv_probe+0x50/0xb8 [ 100.221398] [] driver_probe_device+0x224/0x2e0 [ 100.227405] [] driver_attach+0xac/0xb0 [ 100.232890] [] bus_for_each_dev+0x60/0xa0 [ 100.238460] [] driver_attach+0x20/0x28 [ 100.243771] [] bus_add_driver+0x1c8/0x230 [ 100.249344] [] driver_register+0x60/0xf8 [ 100.254830] [] platform_driver_register+0x44/0x50 [ 100.261275] [] keyblob_driver_init+0x14/0x1000 [caam_keyblob] [ 100.268586] [] do_one_initcall+0x38/0x120 [ 100.274159] [] do_init_module+0x58/0x1d0 [ 100.279644] [] load_module+0x1b1c/0x2190 [ 100.285129] [] SyS_finit_module+0xc0/0xd0 [ 100.290701] Exception stack(0xffff000019e0bec0 to 0xffff000019e0c000) [ 100.297141] bec0: 0000000000000003 00000000004193f0 0000000000000000 0000000000000003 [ 100.304968] bee0: 0000000000000000 60ceffffffffffff ffffffffffffffff ffffffffffffffff [ 100.312800] bf00: 0000000000000111 0000000000000fff 0101010101010101 0000000000000010 [ 100.320627] bf20: 0000000000000000 ffffffffffff0000 0000000000000000 000000000000072a [ 100.328457] bf40: 0000ffffa72fbb10 000000000042a2c8 0000000000000000 0000000013e2f200 [ 100.336284] bf60: 00000000004193f0 0000000000000000 0000000000000000 0000ffffd2736b18 [ 100.344115] bf80: 0000000000000000 0000000000000000 0000000000000002 0000000000000000 [ 100.351942] bfa0: 0000000000000000 0000ffffd2736930 0000000000410734 0000ffffd2736930 [ 100.359773] bfc0: 0000ffffa72fbb34 0000000080000000 0000000000000003 0000000000000111 [ 100.367600] bfe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 100.375430] [] __sys_trace_return+0x0/0x4 [ 100.381003] Code: d2820001 f2a04180 95cbf45c 91005000 (b9400000) [ 100.387098] ---[ end trace 32d7e8848c9f0170 ]---

OmarAberkan commented 5 years ago

root@omar:~# caam_tool enc key key.blob caam_tool: encrypting 5 bytes from key caam_tool: caam_kb_data &{Text:0x1036e000 TextLen:5 Blob:0x103100c0 BlobLen:53 Keymod:0x1030e0f0 KeymodLen:16} caam_tool: issuing ioctl c0184900 on /dev/caam_kb caam_tool: error, inappropriate ioctl for device

abarisani commented 5 years ago

Unfortunately we don't have an i.MX8 board and adapting the module would require much more than looking at these traces. We need the time with actual hardware. For now we don't have resources to do this, but we may in the future. Thanks.