On 2015-05-27 01:08, Phil Sutter wrote:
Hi,

On Tue, May 26, 2015 at 07:29:34PM +0100, Gordan Bobic wrote:
A bit of extra info, with cryptodev_verbosity=2, on 0.9 when the error
occurs:
cryptodev: sshd[1205]: invalid session ID=0xAADBA6A0

With 1.7:
cryptodev: sshd[1520] (fill_kcop_from_cop:647): invalid session
ID=0xEC91F39A
cryptodev: sshd[1520] (cryptodev_ioctl:857): Error copying from user

But the test code (i.e. the various *_comp programs) succeeds?

Thank you for that hint:
# cd tests
# make
./cipher
./hmac
./async_cipher
./async_hmac
./cipher-aead-srtp
ioctl(CIOCGSESSION): Invalid argument
make: *** [check] Error 1

In dmesg:
cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at 80f553e0 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0180 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd06c0 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0e40 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0780 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0b40 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd03c0 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at b4db8b00 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at b4db8ec0 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at b4db82c0 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at b4db8a40 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0840 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0600 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0480 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0240 cryptodev: cipher[13263] (cryptodev_open:480): allocated new item at a2bd0c00 cryptodev: cipher[13263] (cryptodev_open:485): Cryptodev handle initialised, 16 elements in queue
cryptodev: cipher[13263] (crypto_create_session:284): got alignmask 0
cryptodev: cipher[13263] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: cipher[13263] (crypto_create_session:284): got alignmask 0
cryptodev: cipher[13263] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher[13263] (crypto_destroy_session:341): Removed session 0xB286F3D7 cryptodev: cipher[13263] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher[13263] (crypto_create_session:284): got alignmask 0
cryptodev: cipher[13263] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher[13263] (crypto_destroy_session:341): Removed session 0x781F7717 cryptodev: cipher[13263] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher[13263] (crypto_create_session:284): got alignmask 0
cryptodev: cipher[13263] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher[13263] (crypto_destroy_session:341): Removed session 0x89FD4E64 cryptodev: cipher[13263] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0c00 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0240 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0480 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0600 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0840 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at b4db8a40 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at b4db82c0 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at b4db8ec0 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at b4db8b00 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd03c0 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0b40 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0780 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0e40 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd06c0 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at a2bd0180 cryptodev: cipher[13263] (cryptodev_release:519): freeing item at 80f553e0 cryptodev: cipher[13263] (crypto_destroy_session:341): Removed session 0x8AD52BF7 cryptodev: cipher[13263] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher[13263] (cryptodev_release:541): Cryptodev handle deinitialised, 16 elements freed cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd09c0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd00c0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at 80f553e0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0180 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd06c0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0e40 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0780 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0b40 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd03c0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at b4db8b00 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at b4db8ec0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at b4db82c0 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at b4db8a40 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0840 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0600 cryptodev: hmac[13264] (cryptodev_open:480): allocated new item at a2bd0480 cryptodev: hmac[13264] (cryptodev_open:485): Cryptodev handle initialised, 16 elements in queue
cryptodev: hmac[13264] (crypto_create_session:284): got alignmask 0
cryptodev: hmac[13264] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: hmac[13264] (crypto_create_session:284): got alignmask 0
cryptodev: hmac[13264] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: hmac[13264] (crypto_create_session:284): got alignmask 0
cryptodev: hmac[13264] (crypto_create_session:287): preallocating for 32 user pages cryptodev: hmac[13264] (crypto_destroy_session:341): Removed session 0xF8E56E61 cryptodev: hmac[13264] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: hmac[13264] (crypto_create_session:284): got alignmask 0
cryptodev: hmac[13264] (crypto_create_session:287): preallocating for 32 user pages cryptodev: hmac[13264] (crypto_destroy_session:341): Removed session 0xDD177B60 cryptodev: hmac[13264] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0480
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0600
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0840
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at b4db8a40
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at b4db82c0
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at b4db8ec0
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at b4db8b00
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd03c0
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0b40
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0780
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0e40
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd06c0
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd0180
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at 80f553e0
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd00c0
cryptodev: hmac[13264] (cryptodev_release:519): freeing item at a2bd09c0
cryptodev: hmac[13264] (crypto_destroy_session:341): Removed session 0xD0CC54B3 cryptodev: hmac[13264] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: hmac[13264] (crypto_destroy_session:341): Removed session 0x3B07224F cryptodev: hmac[13264] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: hmac[13264] (cryptodev_release:541): Cryptodev handle deinitialised, 16 elements freed cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd0240 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd0c00 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at 9af693a0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at 9af69160 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd09c0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd00c0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at 80f553e0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd0180 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd06c0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd0e40 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd0780 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd0b40 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at a2bd03c0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at b4db8b00 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at b4db8ec0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:480): allocated new item at b4db82c0 cryptodev: cipher-aead-srt[13267] (cryptodev_open:485): Cryptodev handle initialised, 16 elements in queue cryptodev: cipher-aead-srt[13267] (cryptodev_cipher_init:140): Failed to load cipher ctr(aes) cryptodev: cipher-aead-srt[13267] (crypto_create_session:253): Failed to load cipher for ctr(aes) cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at b4db82c0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at b4db8ec0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at b4db8b00 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd03c0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd0b40 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd0780 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd0e40 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd06c0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd0180 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at 80f553e0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd00c0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd09c0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at 9af69160 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at 9af693a0 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd0c00 cryptodev: cipher-aead-srt[13267] (cryptodev_release:519): freeing item at a2bd0240 cryptodev: cipher-aead-srt[13267] (cryptodev_release:541): Cryptodev handle deinitialised, 16 elements freed

This is unsurprising, since mv_cesa doesn't support ctr(aes). It doesn't support gcm(aes), either. But cipher-aead doesn't report any errors, but dmesg shows
some failures:

cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at b98240e0 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at b9824320 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at b9824260 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at b98243e0 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at 80fcbee0 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at 80fcbd60 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2f56e0 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed140 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed080 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed680 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed5c0 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed2c0 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed200 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed500 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at bf2ed440 cryptodev: cipher-aead[13404] (cryptodev_open:480): allocated new item at a2bd0480 cryptodev: cipher-aead[13404] (cryptodev_open:485): Cryptodev handle initialised, 16 elements in queue
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0xAFC4B57A cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x1555730D cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x03E23A0C cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0xDC5065E3 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0xDCA8AEBA cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x1FF3FD44 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x0C1B3789 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x7024A518 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (tls_auth_n_crypt:464): MAC verification failed (tag_len: 20) cryptodev: cipher-aead[13404] (crypto_auth_run:746): error in __crypto_auth_run_zc() cryptodev: cipher-aead[13404] (cryptodev_ioctl:876): Error in crypto_auth_run cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x2D4DF663 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x4F9EA350 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0xB89E1E10 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages
cryptodev: cipher-aead[13404] (crypto_create_session:284): got alignmask
0
cryptodev: cipher-aead[13404] (crypto_create_session:287): preallocating for 32 user pages cryptodev: cipher-aead[13404] (adjust_sg_array:93): reallocating from 32 to 32 pages cryptodev: cipher-aead[13404] (tls_auth_n_crypt:464): MAC verification failed (tag_len: 20) cryptodev: cipher-aead[13404] (crypto_auth_run:746): error in __crypto_auth_run_zc() cryptodev: cipher-aead[13404] (cryptodev_ioctl:876): Error in crypto_auth_run cryptodev: cipher-aead[13404] (crypto_destroy_session:341): Removed session 0x967226D0 cryptodev: cipher-aead[13404] (crypto_destroy_session:344): freeing space for 32 user pages cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at a2bd0480 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed440 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed500 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed200 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed2c0 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed5c0 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed680 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed080 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2ed140 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at bf2f56e0 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at 80fcbd60 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at 80fcbee0 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at b98243e0 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at b9824260 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at b9824320 cryptodev: cipher-aead[13404] (cryptodev_release:519): freeing item at b98240e0 cryptodev: cipher-aead[13404] (cryptodev_release:541): Cryptodev handle deinitialised, 16 elements freed


Are any of those related to the failure I was seeing, as per my original message?

# ./cipher_comp
requested cipher CRYPTO_AES_CBC and mac CRYPTO_SHA1_HMAC, got cipher cbc(aes) with driver mv-cbc-aes and hash with driver
# ./hash_comp
requested mac CRYPTO_SHA1, got hash sha1 with driver mv-sha1
# ./hmac_comp
requested cipher CRYPTO_AES_CBC and mac CRYPTO_SHA1_HMAC, got cipher cbc(aes) with driver mv-cbc-aes and hash hmac(sha1) with driver mv-hmac-sha1
fail for datalen 0x10, MACs do not match!
wrong mac: \xd7\xd1\xa6\xef\x0a\x38\xe1\x09\x45\xe1\x8b\x48\x88\xaa\xa9\x23\x4c\xd4\x67\xd1 right mac: \xd7\xd1\xa6\xef\x0a\x38\xe1\x09\x45\xe1\x8b\x48\x88\xaa\xa9\x23\x4c\xd4\x67\xd1
test_crypto() failed for datalen of 16

Is that a bug in the test? Those hex dumps look the same to me.

What I find really puzzling is that it is only sshd that seems to have the problem, and the problem arises _after_ the connection and crypto have been
initialized since the last login message gets passed back before things
break.

I really
should take a look at the openssl integration code. Last time I did, the
mere fact it always uses a ridiculously small (4k or so) buffer was
enough for me.

Any hints on where the root cause of the problem I am seeing might be would
be most welcome.

Gordan

_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to