From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: gilad@benyossef.com, herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [BUG] crypto: ccree: driver does not handle case where cryptlen = authsize =0
Date: Wed, 9 Feb 2022 10:57:24 +0100 [thread overview]
Message-ID: <YgOQBNIdf0UnSH+M@Red> (raw)
Hello
Booting a salvator X with CRYPTO_MANAGER_EXTRA_TESTS lead to:
[ 37.510039] ------------[ cut here ]------------
[ 37.514712] WARNING: CPU: 7 PID: 616 at /home/clabbe/linux-next/kernel/dma/mapping.c:200 __dma_map_sg_attrs+0xb8/0x108
[ 37.525444] Modules linked in: des_generic ofb snd_soc_hdmi_codec dw_hdmi_cec dw_hdmi_i2s_audio rcar_du_drm rcar_lvds crct10dif_ce snd_soc_audio_graph_card simple_bridge snd_soc_simple_card_utils rcar_dw_hdmi dw_hdmi drm_cma_helper cec rcar_csi2 rcar_fdp1 v4l2_mem2mem vsp1 rcar_cmm videobuf2_vmalloc rcar_fcp renesas_usb3 snd_soc_rcar rcar_vin v4l2_fwnode v4l2_async videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common videodev pwm_rcar mc snd_soc_ak4613 max9611 ccree(+) renesas_usbhs phy_rcar_gen3_usb3 libdes usb_dmac gpio_bd9571mwv at24 display_connector drm_kms_helper pwm_bl drm ecb xts cts essiv cmac xcbc ccm
[ 37.581446] CPU: 7 PID: 616 Comm: cryptomgr_test Tainted: G W 5.17.0-rc3-next-20220207-00110-g41bd5fbfc1e4 #5
[ 37.592672] Hardware name: Renesas Salvator-X board based on r8a77950 (DT)
[ 37.599555] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 37.606526] pc : __dma_map_sg_attrs+0xb8/0x108
[ 37.610978] lr : __dma_map_sg_attrs+0x48/0x108
[ 37.615430] sp : ffff80000c1632a0
[ 37.618749] x29: ffff80000c1632a0 x28: ffff0004c2997c00 x27: ffff0004c2997e20
[ 37.625909] x26: 0000000000000000 x25: 0000000000000008 x24: 0000000000000000
[ 37.633068] x23: 0000000000000000 x22: ffff0004cc777840 x21: 0000000000000000
[ 37.640226] x20: 0000000000000000 x19: ffff0004c164c010 x18: ffff80000b3a72f0
[ 37.647385] x17: 0000000000000000 x16: 0000000000000072 x15: 0000000000000010
[ 37.654544] x14: 001fffffffffffff x13: 000000006894887f x12: 818235788794af1b
[ 37.661703] x11: 00000000000ef000 x10: ffff0004c164c518 x9 : ffff800009aa6a38
[ 37.668862] x8 : ffff80000b2759d8 x7 : ffff80000c1633a0 x6 : 0000000000000000
[ 37.676021] x5 : ffff800009aa6a38 x4 : 0000000000000000 x3 : 0000000000000000
[ 37.683179] x2 : 74374306a1f1c500 x1 : 0000000000000000 x0 : 0000000000000000
[ 37.690338] Call trace:
[ 37.692789] __dma_map_sg_attrs+0xb8/0x108
[ 37.696894] dma_map_sg_attrs+0x10/0x28
[ 37.700739] cc_map_sg+0x64/0xf8 [ccree]
[ 37.704711] cc_map_aead_request+0x158/0x920 [ccree]
[ 37.709703] cc_proc_aead+0x148/0xeb8 [ccree]
[ 37.714087] cc_aead_encrypt+0x44/0x68 [ccree]
[ 37.718557] crypto_aead_encrypt+0x44/0x78
[ 37.722669] test_aead_vec_cfg+0x244/0x900
[ 37.726779] test_aead_vec+0x8c/0x190
[ 37.730450] test_aead+0x78/0xe0
[ 37.733687] alg_test_aead+0xa4/0x3e0
[ 37.737358] alg_test.part.29+0xb4/0x398
[ 37.741289] alg_test+0x48/0x78
[ 37.744439] cryptomgr_test+0x48/0x50
[ 37.748109] kthread+0x11c/0x128
[ 37.751347] ret_from_fork+0x10/0x20
[ 37.754939] irq event stamp: 119412
[ 37.758431] hardirqs last enabled at (119411): [<ffff800009188a54>] _raw_spin_unlock_irqrestore+0x8c/0x90
[ 37.768105] hardirqs last disabled at (119412): [<ffff800009179e20>] el1_dbg+0x28/0x90
[ 37.776040] softirqs last enabled at (119376): [<ffff80000125ac20>] cc_send_request+0xa0/0x208 [ccree]
[ 37.785462] softirqs last disabled at (119374): [<ffff80000125abf4>] cc_send_request+0x74/0x208 [ccree]
[ 37.794883] ---[ end trace 0000000000000000 ]---#
When cryptlen and authsize are both 0, the driver try to map a 0 size buffer which display this warning.
Regards
next reply other threads:[~2022-02-09 9:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 9:57 Corentin Labbe [this message]
2022-02-09 17:45 ` [BUG] crypto: ccree: driver does not handle case where cryptlen = authsize =0 Gilad Ben-Yossef
2022-02-17 19:38 ` Gilad Ben-Yossef
2022-02-20 19:26 ` Corentin Labbe
2022-02-21 10:08 ` Gilad Ben-Yossef
2022-02-21 14:05 ` Corentin Labbe
2022-02-22 7:39 ` Gilad Ben-Yossef
2022-02-28 9:11 ` Gilad Ben-Yossef
2022-03-04 13:30 ` Corentin Labbe
2022-03-06 21:49 ` Herbert Xu
2022-03-07 7:59 ` Gilad Ben-Yossef
2022-03-07 10:48 ` Corentin Labbe
2022-03-07 11:14 ` Robin Murphy
2022-03-07 11:49 ` Corentin Labbe
2022-03-07 11:59 ` Gilad Ben-Yossef
2022-03-07 13:47 ` Corentin Labbe
2022-03-07 12:17 ` Gilad Ben-Yossef
2022-03-07 12:35 ` Robin Murphy
2022-03-07 12:47 ` Gilad Ben-Yossef
2022-03-07 13:03 ` Robin Murphy
2022-03-07 13:12 ` Robin Murphy
2022-03-07 13:21 ` Gilad Ben-Yossef
2022-03-07 13:13 ` Gilad Ben-Yossef
2022-03-07 13:45 ` Corentin Labbe
2022-03-07 13:53 ` Gilad Ben-Yossef
2022-03-07 13:56 ` Corentin Labbe
2022-03-07 14:00 ` Gilad Ben-Yossef
2022-03-07 14:05 ` Corentin Labbe
2022-03-08 9:40 ` Corentin Labbe
2022-03-09 6:49 ` Gilad Ben-Yossef
2022-03-07 12:24 ` Gilad Ben-Yossef
2022-03-07 13:43 ` Gilad Ben-Yossef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YgOQBNIdf0UnSH+M@Red \
--to=clabbe.montjoie@gmail.com \
--cc=gilad@benyossef.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).