Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Linux/AM3352: Crypto driver crash on big files

$
0
0

Part Number:AM3352

Tool/software: Linux

Champs,

Customer reported the crash and I am able to reproduce it on BBB using the latest SDK (kernel 4.14). Steps to reproduce are as follows:

1. Boot the target with the OOB PSDK 5 SD card

2. Place a large (>60 MB) bin file on the target FS

3. Run:

root@am335x-evm:~# HMAC_KEY="12345678901234567890123456789012"
root@am335x-evm:~# FILE="xac"
root@am335x-evm:~# dd if="$FILE" bs=16 skip=3 2> /dev/null | openssl dgst -sha256 -hmac $HMAC_KEY -engine cryptodev| sed 's/^.* //'

after a few minutes run it crashes with the following trace:

[ 136.289013] NET: Registered protocol family 15
[ 136.876866] Initializing XFRM netlink socket
[ 192.679623] ------------[ cut here ]------------
[ 192.684549] WARNING: CPU: 0 PID: 873 at /oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work-shared/am335x-evm/kernel-source/mm/page_alloc.c:3877 __alloc_pages_nodemask+0x1cc/0xd40
[ 192.706040] Modules linked in: xfrm_user xfrm4_tunnel ipcomp xfrm_ipcomp esp4 ah4 af_key xfrm_algo sha512_generic sha512_arm sha256_generic sha1_generic sha1_arm_neon sha1_arm md5 aes_arm_bs crypto_simd cryptd des_generic cbc bc_example(O) pru_rproc usb_f_acm u_serial pruss_intc pruss usb_f_ecm musb_dsps phy_am335x musb_hdrc phy_am335x_control phy_generic g_multi usb_f_mass_storage usb_f_rndis u_ether libcomposite udc_core snd_soc_simple_card snd_soc_simple_card_utils pm33xx wkup_m3_ipc wkup_m3_rproc remoteproc pvrsrvkm(O) omap_aes_driver crypto_engine omap_crypto omap_sham ti_emif_sram pruss_soc_bus musb_am335x rtc_omap omap_wdt sch_fq_codel uio_module_drv(O) uio usbserial usbcore usb_common cryptodev(O)
[ 192.773478] CPU: 0 PID: 873 Comm: openssl Tainted: G O 4.14.40-g4796173fc5 #1
[ 192.781792] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 192.796026] Backtrace:
[ 192.798541] [<c010ba48>] (dump_backtrace) from [<c010bd2c>] (show_stack+0x18/0x1c)
[ 192.809712] r7:00000009 r6:00000000 r5:c0a9d190 r4:00000000
[ 192.817549] [<c010bd14>] (show_stack) from [<c0829588>] (dump_stack+0x24/0x28)
[ 192.827090] [<c0829564>] (dump_stack) from [<c0128ab4>] (__warn+0xe8/0x100)
[ 192.836216] [<c01289cc>] (__warn) from [<c0128b84>] (warn_slowpath_null+0x28/0x30)
[ 192.845960] r9:01080020 r8:0000000e r7:c0d4db74 r6:01080020 r5:00000000 r4:c0d031d0
[ 192.855869] [<c0128b5c>] (warn_slowpath_null) from [<c01cbaf0>] (__alloc_pages_nodemask+0x1cc/0xd40)
[ 192.867156] [<c01cb924>] (__alloc_pages_nodemask) from [<c01cc67c>] (__get_free_pages+0x18/0x30)
[ 192.878386] r10:03c00000 r9:03c00010 r8:db0a9910 r7:00000040 r6:d8dc0000 r5:00000000
[ 192.888474] r4:db107800
[ 192.891076] [<c01cc664>] (__get_free_pages) from [<bf0b52c4>] (omap_sham_handle_queue+0x7a4/0xa9c [omap_sham])
[ 192.905223] [<bf0b4b20>] (omap_sham_handle_queue [omap_sham]) from [<bf0b5624>] (omap_sham_update+0x68/0xa8 [omap_sham])
[ 192.918329] r10:dc70aa70 r9:d8d76000 r8:00000003 r7:d8dc0000 r6:00000000 r5:db121000
[ 192.928432] r4:db107800
[ 192.931055] [<bf0b55bc>] (omap_sham_update [omap_sham]) from [<bf0035b4>] (cryptodev_hash_update+0x3c/0xc8 [cryptodev])
[ 192.945879] r5:db121000 r4:db12105c
[ 192.949540] [<bf003578>] (cryptodev_hash_update [cryptodev]) from [<bf0020c4>] (hash_n_crypt+0xe8/0x144 [cryptodev])
[ 192.963693] r4:db121000
[ 192.966304] [<bf001fdc>] (hash_n_crypt [cryptodev]) from [<bf00262c>] (crypto_run+0x204/0x520 [cryptodev])
[ 192.980153] r7:03c00010 r6:00000000 r5:db121000 r4:d8d77ddc
[ 192.988002] [<bf002428>] (crypto_run [cryptodev]) from [<bf001988>] (cryptodev_ioctl+0x448/0xa9c [cryptodev])
[ 193.000149] r8:00000003 r7:d8d77ddc r6:00000051 r5:d8d7e480 r4:be8c639c
[ 193.009113] [<bf001540>] (cryptodev_ioctl [cryptodev]) from [<c023411c>] (do_vfs_ioctl+0xa8/0x930)
[ 193.020395] r9:d8d76000 r8:00000003 r7:c01c6368 r6:00000003 r5:db7fe3c0 r4:be8c639c
[ 193.030453] [<c0234074>] (do_vfs_ioctl) from [<c02349e0>] (SyS_ioctl+0x3c/0x60)
[ 193.040102] r10:00000000 r9:d8d76000 r8:be8c639c r7:c01c6368 r6:00000003 r5:db7fe3c0
[ 193.050194] r4:db7fe3c0
[ 193.052784] [<c02349a4>] (SyS_ioctl) from [<c0107d20>] (ret_fast_syscall+0x0/0x54)
[ 193.064112] r9:d8d76000 r8:c0107f04 r7:00000036 r6:be8c63d8 r5:be8c63d4 r4:00000000
[ 193.071907] ---[ end trace f7279e358f60fc67 ]---
[ 193.080628] omap_sham_copy_sgs: Couldn't allocate pages for unaligned cases.
[ 193.089946] cryptodev: openssl[873] (waitfor:286): error from async request: -12
[ 193.099522] cryptodev: openssl[873] (hash_n_crypt:98): CryptoAPI failure: -12
Error Signing Data
failed

I also monitored LowFree number in /proc/meminfo and it continuously decreases during the run and does not increase back even if I stop the the process before the crash. Customer is also suspecting memory leak. 

Your insights are greatly appreciated!

Michael


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>