AnsweredAssumed Answered

key blob module on iMX6UL

Question asked by Julien Panis on Oct 3, 2018
Latest reply on Oct 10, 2018 by jamesbone

Hello,

 

I try running the following NXP example on iMX6UL board (Debian - Linux 4.9.11) :

Generate Blob Under Linux 

 

The driver (key_blob_module.ko) and the test tools (kb_test) are compiled with gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf toolchain.

 

Once the driver is insmod'ed, I run the test tool and I get the following kernel message :

[10970.490974] Unable to handle kernel paging request at virtual address a0011ae0
[10970.499570] pgd = 9c914000
[10970.501012] [a0011ae0] *pgd=00000000
[10970.503365] Internal error: Oops: 5 [#5] PREEMPT SMP ARM
[10970.507406] Modules linked in: key_blob_module(O) alg_test(O+) ip_tables [last unloaded: key_blob_modul]
[10970.515899] CPU: 0 PID: 536 Comm: kb_test Tainted: P      D    O    4.9.11-02286-gaa81171-dirty #3
[10970.523592] Hardware name: Freescale i.MX6 UltraLite (Device Tree)
[10970.528505] task: 9c559080 task.stack: 9c5d6000
[10970.531798] PC is at dma_cache_maint_page+0x50/0x12c
[10970.535506] LR is at mem_map+0x0/0x4
[10970.537823] pc : [<80113420>]    lr : [<80fd3480>]    psr: 60080013
               sp : 9c5d7df8  ip : 9fbf7000  fp : 80f030d4
[10970.546733] r10: 00101000  r9 : 000a0d57  r8 : 80117bb8
[10970.550693] r7 : 00000002  r6 : 00000000  r5 : 00000050  r4 : 00020d57
[10970.555955] r3 : 00000002  r2 : 00000050  r1 : 00080000  r0 : 0041aae0
[10970.561222] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[10970.567092] Control: 10c53c7d  Table: 9c91406a  DAC: 00000051
[10970.571571] Process kb_test (pid: 536, stack limit = 0x9c5d6210)
[10970.576311] Stack: (0x9c5d7df8 to 0x9c5d8000)
[10970.579408] 7de0:                                                       80f06704 80fd3480
[10970.586343] 7e00: 80117bb8 00000000 a0011ae0 00000050 00000002 80fd3480 9cace140 00101000
[10970.593275] 7e20: 00000000 80113524 80117bb8 00101000 00000000 a0011ae0 9c4b9010 00000000
[10970.600205] 7e40: f0000020 80113638 9c4b9010 801135d4 00000050 806dd9d4 00000002 00000000
[10970.607135] 7e60: 00000000 00000000 00000000 00000000 9c01da5c 9c0f57b4 804df948 00000000
[10970.614066] 7e80: 00000000 80938fd8 9c01da5c 809343e0 9c446940 00000020 9c446940 9c4b9010
[10970.620996] 7ea0: 00000000 8093925c 00000000 9c4b9010 00000000 00000020 7f03ed80 7ebc3c38
[10970.627927] 7ec0: 9c5d6000 00000000 00000000 7f03e134 00000000 a0d57000 00000020 7f03eb34
[10970.634858] 7ee0: 9c630840 00000000 7ebc3c38 00000000 00000051 9c630840 c0084b00 7f03e3e0
[10970.641789] 7f00: 00000020 00000050 00000000 7ebc3c38 9c9f0ae8 80211868 582b0b69 1312d000
[10970.648719] 7f20: 582b0b69 1312d000 00000000 00000000 000000be 9c6399c0 00000000 9c2f8030
[10970.655650] 7f40: 00000002 00000061 9c6399c8 00000000 00000000 80200608 00000000 00000000
[10970.662584] 7f60: 00000001 9c6399c0 9c6399c0 9c630840 00000003 9c630840 c0084b00 7ebc3c38
[10970.669515] 7f80: 9c5d6000 00000000 00000000 80212124 00000020 00020d54 7ebc3efc 00000036
[10970.676446] 7fa0: 80107944 80107780 00000020 00020d54 00000003 c0084b00 7ebc3c38 00020d50
[10970.683377] 7fc0: 00000020 00020d54 7ebc3efc 00000036 7ebc3efc 7ebc3ef3 76ff8000 00000000
[10970.690309] 7fe0: 00020d0c 7ebc3c34 00010889 76f71716 20080030 00000003 af76ad6f f7ffd9ff
[10970.697280] [<80113420>] (dma_cache_maint_page) from [<80113524>] (__dma_page_cpu_to_dev+0x28/0x94)
[10970.705103] [<80113524>] (__dma_page_cpu_to_dev) from [<80113638>] (arm_dma_map_page+0x64/0x68)
[10970.712574] [<80113638>] (arm_dma_map_page) from [<806dd9d4>] (sm_keystore_slot_export+0x150/0x3bc)
[10970.720409] [<806dd9d4>] (sm_keystore_slot_export) from [<7f03e134>] (kb_encap+0xd0/0x114 [key_blob_mod)
[10970.729037] [<7f03e134>] (kb_encap [key_blob_module]) from [<7f03e3e0>] (kb_ioctl+0x148/0x1b4 [key_blob)
[10970.737997] [<7f03e3e0>] (kb_ioctl [key_blob_module]) from [<80211868>] (do_vfs_ioctl+0x9c/0x924)
[10970.745637] [<80211868>] (do_vfs_ioctl) from [<80212124>] (SyS_ioctl+0x34/0x5c)
[10970.751713] [<80212124>] (SyS_ioctl) from [<80107780>] (ret_fast_syscall+0x0/0x3c)
[10970.758039] Code: e040000c e58de004 e08192c0 e0494004 (e79c2284)
[10970.762901] ---[ end trace dbcdbffbe30a56bb ]---

 

Any idea about what could be wrong ? Apparently the problem comes from "dma_cache_maint_page" function...

 

Julien

Outcomes