Re: kernel tainted while exporting shash context using af_alg interface

2015-11-01 Thread Harsh Jain
Hi, I tried patch on my setup and its working fine. Thanks Stephan, Herbert for your support. Regards Harsh Jain On Fri, Oct 30, 2015 at 4:40 PM, Stephan Mueller wrote: > Am Freitag, 30. Oktober 2015, 14:02:27 schrieb Harsh Jain: > > Hi Harsh, > >>Hi Stephan, >> >>If we add sendmsg() in between

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-30 Thread Stephan Mueller
Am Freitag, 30. Oktober 2015, 14:02:27 schrieb Harsh Jain: Hi Harsh, >Hi Stephan, > >If we add sendmsg() in between 2 accept calls then the setkey problem >will happen? > >handle->opfd = accept(handle->tfmfd, NULL, 0); >sendmsg() >handle->opfd = accept(handle->opfd, NULL, 0); >sendmsg() >handle->

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-30 Thread Harsh Jain
Hi Stephan, If we add sendmsg() in between 2 accept calls then the setkey problem will happen? handle->opfd = accept(handle->tfmfd, NULL, 0); sendmsg() handle->opfd = accept(handle->opfd, NULL, 0); sendmsg() handle->opfd = accept(handle->opfd, NULL, 0); If yes, Then may be it is expected behavio

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-28 Thread Stephan Mueller
Am Mittwoch, 28. Oktober 2015, 16:24:34 schrieb Harsh Jain: Hi Harsh, >Hi Stephan, > >I tried your patch on my machine. Kernel is not crashing. The openssl >break with this. Can you share HMAC program which you are suspecting >it will not work or do you already have some test written in >libkcapi

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-28 Thread Harsh Jain
Hi Stephan, I tried your patch on my machine. Kernel is not crashing. The openssl break with this. Can you share HMAC program which you are suspecting it will not work or do you already have some test written in libkcapi/test.sh which will fail. Regards Harsh Jain On Wed, Oct 28, 2015 at 6:25 A

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-27 Thread Stephan Mueller
Am Mittwoch, 28. Oktober 2015, 01:09:58 schrieb Stephan Mueller: Hi Harsh, > > > However, any error in user space should not crash the kernel. So, a fix > should be done. But I think your code is not correct as it solidifies a > broken user space code. After thinking a bit again, I think your

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-27 Thread Stephan Mueller
Am Montag, 26. Oktober 2015, 14:51:01 schrieb Harsh Jain: Hi Harsh, > Hi Stephan, > > I tried 1 more patch. This time result is correct. Find attached patch > file. Is there any side effect of this patch. The strace is enlightening. The user space code does an accept on an already accepted FD

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-26 Thread Harsh Jain
Hi Stephan, I tried 1 more patch. This time result is correct. Find attached patch file. Is there any side effect of this patch. Regards Harsh Jain On Mon, Oct 26, 2015 at 11:49 AM, Harsh Jain wrote: > Hi Stephan, > > I also tried test program in libkcapi and it works. libkcapi opens > socket

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-25 Thread Harsh Jain
Hi Stephan, I also tried test program in libkcapi and it works. libkcapi opens socket of type "hmac(sha1)" .Openssl opens multiple "sha1" type socket and uses the partial results to calculate hmac. "crypto_ahash_init()" function initialises the *tfm variable in crypto_shash structure.It gets cal

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-25 Thread Stephan Mueller
Am Sonntag, 25. Oktober 2015, 11:56:27 schrieb Harsh Jain: Hi Harsh, >Hi, > > >When trying to calculate HMAC(SHA1) with openssl using af-alg engine >kernel crashes.Find below the command used and kernel. I have added >some debug print in logs. > >Command used : ./openssl dgst -engine af_alg -sha1

kernel tainted while exporting shash context using af_alg interface

2015-10-24 Thread Harsh Jain
Hi, When trying to calculate HMAC(SHA1) with openssl using af-alg engine kernel crashes.Find below the command used and kernel. I have added some debug print in logs. Command used : ./openssl dgst -engine af_alg -sha1 -hmac "key" r.txt kernel version : 3.17.8 Initial Investigation : In shash_de