Re: error in libkcapi 1.0.3 for aead aio

2018-02-28 Thread Harsh Jain


On 28-02-2018 14:28, Stephan Mueller wrote:
> Am Mittwoch, 28. Februar 2018, 08:34:21 CET schrieb Harsh Jain:
>
> Hi Harsh,
>
>> Try with gdb. AIO(-x 10) works fine with step by step debugging.  Also
>> verified by adding print in "af_alg_async_cb" for received err value. 
>> Driver is sending -74 here.
> I am unable to reproduce the issue. Both commands with sync and async 
> operation work fine with me and using 1.0.3.
Ok. I will try to root cause it or will get some debug info.
>
> Ciao
> Stephan
>
>



Re: error in libkcapi 1.0.3 for aead aio

2018-02-28 Thread Stephan Mueller
Am Mittwoch, 28. Februar 2018, 08:34:21 CET schrieb Harsh Jain:

Hi Harsh,

> Try with gdb. AIO(-x 10) works fine with step by step debugging.  Also
> verified by adding print in "af_alg_async_cb" for received err value. 
> Driver is sending -74 here.

I am unable to reproduce the issue. Both commands with sync and async 
operation work fine with me and using 1.0.3.

Ciao
Stephan




Re: error in libkcapi 1.0.3 for aead aio

2018-02-27 Thread Stephan Müller
Am Sonntag, 25. Februar 2018, 06:25:06 CET schrieb Harsh Jain:

Hi Harsh,

> Hi Stephan,
> 
> 1 of the test mentioned in test.sh is failing for AEAD AIO operation even
> thought driver is returning EBADMSG(as expected) to af_alg with latest
> cryptodev tree.
> 
> Debug log and strace attached.
> 
> Command :
> 
> strace -o strace.log ../bin/kcapi   -x 10   -c "gcm(aes)" -i
> 7815d4b06ae50c9c56e87bd7 -k ea38ac0c9b9998c80e28fb496a2b88d9 -a
> "853f98a750098bec1aa7497e979e78098155c877879556bb51ddeb6374cbaefc" -t
> "c4ce58985b7203094be1d134c1b8ab0b" -q "b03692f86d1b8b39baf2abb255197c98"

I am not seeing that the driver reports -EBADMSG in the strace log. If you see 
the following line, you will spot the issue:

io_getevents(140715452821504, 1, 1, {{(nil), 0x24a41c0, 4294967222, 0}}, NULL) 
= 1

The 4th parameter is struct io_event that is returned from the kernel. It 
contains as 3rd value "4294967222". This value ought to be the return code of 
the crypto operation. If the value is positive, it returns the number of 
processed bytes. If it is negative, it holds the error code.

I am not sure you expect a value close to 2^32 bytes as return code -- from 
the io_submit syscall where you send 48 bytes and from the command above I 
assume that this return value is wrong.
> 
> Thanks & Regards
> 
> Harsh Jain


Ciao
Stephan




error in libkcapi 1.0.3 for aead aio

2018-02-24 Thread Harsh Jain
Hi Stephan,

1 of the test mentioned in test.sh is failing for AEAD AIO operation even 
thought driver is returning EBADMSG(as expected) to af_alg with latest 
cryptodev tree.

Debug log and strace attached.

Command :

strace -o strace.log ../bin/kcapi   -x 10   -c "gcm(aes)" -i 
7815d4b06ae50c9c56e87bd7 -k ea38ac0c9b9998c80e28fb496a2b88d9 -a 
"853f98a750098bec1aa7497e979e78098155c877879556bb51ddeb6374cbaefc" -t 
"c4ce58985b7203094be1d134c1b8ab0b" -q "b03692f86d1b8b39baf2abb255197c98"

Thanks & Regards

Harsh Jain

execve("../bin/kcapi", ["../bin/kcapi", "-x", "10", "-c", "gcm(aes)", "-i", 
"7815d4b06ae50c9c56e87bd7", "-k", "ea38ac0c9b9998c80e28fb496a2b88d9", "-a", 
"853f98a750098bec1aa7497e979e7809"..., "-t", 
"c4ce58985b7203094be1d134c1b8ab0b", "-q", "b03692f86d1b8b39baf2abb255197c98"], 
[/* 22 vars */]) = 0
brk(0)  = 0x12a1000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f1f6471f000
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=86613, ...}) = 0
mmap(NULL, 86613, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1f64709000
close(3)= 0
open("/lib64/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\316\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=174528, ...}) = 0
mmap(NULL, 2268928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f1f642d7000
mprotect(0x7f1f642fc000, 2097152, PROT_NONE) = 0
mmap(0x7f1f644fc000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f1f644fc000
close(3)= 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\16\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=19776, ...}) = 0
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f1f640d3000
mprotect(0x7f1f640d5000, 2097152, PROT_NONE) = 0
mmap(0x7f1f642d5000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f1f642d5000
close(3)= 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\34\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2118128, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f1f64708000
mmap(NULL, 3932672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f1f63d12000
mprotect(0x7f1f63ec8000, 2097152, PROT_NONE) = 0
mmap(0x7f1f640c8000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b6000) = 0x7f1f640c8000
mmap(0x7f1f640ce000, 16896, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1f640ce000
close(3)= 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f1f64706000
arch_prctl(ARCH_SET_FS, 0x7f1f64706740) = 0
mprotect(0x7f1f640c8000, 16384, PROT_READ) = 0
mprotect(0x7f1f642d5000, 4096, PROT_READ) = 0
mprotect(0x7f1f644fc000, 16384, PROT_READ) = 0
mprotect(0x6dc000, 4096, PROT_READ) = 0
mprotect(0x7f1f6472, 4096, PROT_READ) = 0
munmap(0x7f1f64709000, 86613)   = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
close(3)= 0
brk(0)  = 0x12a1000
brk(0x12c2000)  = 0x12c2000
brk(0)  = 0x12c2000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0
mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1f5d7e9000
close(3)= 0
brk(0)  = 0x12c2000
getuid()= 0
getgid()= 0
geteuid()   = 0
getegid()   = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f1f6471e000
read(3, "MemTotal:   16415288 kB\nMemF"..., 1024) = 1024
close(3)= 0
munmap(0x7f1f6471e000, 4096)= 0
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f1f63d47250}, 
{SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f1f63d47250}, 
{SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f1f63d47250}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7f1f63d47250}, {SIG_DFL, [], 
0}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7f1f63d47250}, {SIG_DFL, [], 
SA_RESTORER, 0x7f1f63d47250}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [],