Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-06 Thread David Miller
From: Herbert Xu 
Date: Thu, 5 May 2016 16:42:49 +0800

> Subject: crypto: testmgr - Use kmalloc memory for RSA input
> 
> As akcipher uses an SG interface, you must not use vmalloc memory
> as input for it.  This patch fixes testmgr to copy the vmalloc
> test vectors to kmalloc memory before running the test.
> 
> This patch also removes a superfluous sg_virt call in do_test_rsa.
> 
> Cc: 
> Reported-by: Anatoly Pugachev 
> Signed-off-by: Herbert Xu 

I'm really surprised this didn't trigger on non-sparc64 systems, but
what do I know :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Tadeusz Struk
On 05/05/2016 02:50 AM, Herbert Xu wrote:
> On Thu, May 05, 2016 at 12:40:18PM +0300, Anatoly Pugachev wrote:
>>
>> sure, based on your cryptodev git, just tried 4.3 (6a13feb , good)
>> kernel in attempt to find (bisect) when RSA code break, already tested
>> 4.5 (44d1b6d , bad) , 4.4 (afd2ff9 , bad).
>> Going to try your patch soon (when I'm back home).
>> So far 4.3 passes RSA stage without OOPS, but for other reason does
>> not boot to login prompt. Boot log exempt (4.3), this is with
>> CONFIG_CRYPTO_RSA=y :
> 
> That jibes with this being a problem with the SG list since it
> was only added in 4.4.

Before 4.4 the rsa sw implementation kmalloced intermediate flat buffer
and copied the data internally.
Thanks,
-- 
TS
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Tadeusz Struk
On 05/05/2016 08:31 AM, Anatoly Pugachev wrote:
> On Thu, May 5, 2016 at 6:00 PM, Tadeusz Struk  wrote:
>> On 05/05/2016 02:40 AM, Anatoly Pugachev wrote:
>>> sure, based on your cryptodev git, just tried 4.3 (6a13feb , good)
>>> kernel in attempt to find (bisect) when RSA code break, already tested
>>> 4.5 (44d1b6d , bad) , 4.4 (afd2ff9 , bad).
>>> Going to try your patch soon (when I'm back home).
>>> So far 4.3 passes RSA stage without OOPS, but for other reason does
>>> not boot to login prompt. Boot log exempt (4.3), this is with
>>> CONFIG_CRYPTO_RSA=y :
>>
>> Anatoly, could you also give this a try please:
>> Thanks
>>
>> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
>> index b86883a..770970ff 100644
>> --- a/crypto/testmgr.c
>> +++ b/crypto/testmgr.c
>> @@ -1805,8 +1805,8 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
>> goto free_req;
>>
>> sg_init_table(src_tab, 2);
>> -   sg_set_buf(_tab[0], vecs->m, 8);
>> -   sg_set_buf(_tab[1], vecs->m + 8, vecs->m_size - 8);
>> +   sg_set_buf(_tab[0], vecs->m, 4);
>> +   sg_set_buf(_tab[1], vecs->m + 4, vecs->m_size - 4);
>> sg_init_one(, outbuf_enc, out_len_max);
>> akcipher_request_set_crypt(req, src_tab, , vecs->m_size,
>>out_len_max);
> 
> 
> Tadeusz,
> 
> do you still want to test it , after I have reported that Herbert patch works?
> 

Hi Anatoly,
Since Herbert's patch fixes it for you here is no need to test this one.
Thanks,
-- 
TS
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread John Paul Adrian Glaubitz
On 05/05/2016 05:31 PM, Anatoly Pugachev wrote:
> do you still want to test it , after I have reported that Herbert patch works?

Maybe you should ack the patch with:

Tested-By: Anatoly Pugachev 

?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Anatoly Pugachev
On Thu, May 5, 2016 at 6:00 PM, Tadeusz Struk  wrote:
> On 05/05/2016 02:40 AM, Anatoly Pugachev wrote:
>> sure, based on your cryptodev git, just tried 4.3 (6a13feb , good)
>> kernel in attempt to find (bisect) when RSA code break, already tested
>> 4.5 (44d1b6d , bad) , 4.4 (afd2ff9 , bad).
>> Going to try your patch soon (when I'm back home).
>> So far 4.3 passes RSA stage without OOPS, but for other reason does
>> not boot to login prompt. Boot log exempt (4.3), this is with
>> CONFIG_CRYPTO_RSA=y :
>
> Anatoly, could you also give this a try please:
> Thanks
>
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index b86883a..770970ff 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -1805,8 +1805,8 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
> goto free_req;
>
> sg_init_table(src_tab, 2);
> -   sg_set_buf(_tab[0], vecs->m, 8);
> -   sg_set_buf(_tab[1], vecs->m + 8, vecs->m_size - 8);
> +   sg_set_buf(_tab[0], vecs->m, 4);
> +   sg_set_buf(_tab[1], vecs->m + 4, vecs->m_size - 4);
> sg_init_one(, outbuf_enc, out_len_max);
> akcipher_request_set_crypt(req, src_tab, , vecs->m_size,
>out_len_max);


Tadeusz,

do you still want to test it , after I have reported that Herbert patch works?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread John Paul Adrian Glaubitz
On 05/05/2016 05:12 PM, Anatoly Pugachev wrote:
> this patch, applied to your cryptodev git kernel, fixes OOPS and my
> debian sparc64 installation boots successfully:

Awesome to hear, thanks for investigating and fixing this :).

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Anatoly Pugachev
On Thu, May 5, 2016 at 11:42 AM, Herbert Xu  wrote:
> On Wed, May 04, 2016 at 05:49:04PM +0300, Anatoly Pugachev wrote:
>>
>> just tested cryptodev (
>> http://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
>> ) kernel, same OOPS, but kernel version is 4.6.0-rc2+ .
>> kernel OOPS message - https://paste.fedoraproject.org/362554/23732641/
>
> Anatoly, could you please test this patch on top of cryptodev?
> Thanks!
>
> ---8<---
> Subject: crypto: testmgr - Use kmalloc memory for RSA input
>
> As akcipher uses an SG interface, you must not use vmalloc memory
> as input for it.  This patch fixes testmgr to copy the vmalloc
> test vectors to kmalloc memory before running the test.
>
> This patch also removes a superfluous sg_virt call in do_test_rsa.


Herbert,

this patch, applied to your cryptodev git kernel, fixes OOPS and my
debian sparc64 installation boots successfully:

[5684721.625447] Unpacking initramfs...
[5684721.858235] Freeing initrd memory: 11720K (fff800203400 -
fff8002034b72000)
[5684721.867127] futex hash table entries: 65536 (order: 9, 4194304 bytes)
[5684721.868551] audit: initializing netlink subsys (disabled)
[5684721.868640] audit: type=2000 audit(0.476:1): initialized
[5684721.868868] Initialise system trusted keyring
[5684721.869765] workingset: timestamp_bits=45 max_order=21 bucket_order=0
[5684721.869879] zbud: loaded
[5684721.920120] Key type asymmetric registered
[5684721.920173] Asymmetric key parser 'x509' registered
[5684721.920582] Block layer SCSI generic (bsg) driver version 0.4
loaded (major 252)
[5684721.921249] io scheduler noop registered
[5684721.921297] io scheduler deadline registered
[5684721.921628] io scheduler cfq registered (default)
[5684721.922101] f029b808: ttyS0 at I/O 0x0 (irq = 1, base_baud =
115200) is a SUN4V HCONS
[5684721.922352] console [ttyHV0] enabled
[5684721.923480] sunvdc.c:v1.2 (November 24, 2014)


Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Tadeusz Struk
On 05/05/2016 02:40 AM, Anatoly Pugachev wrote:
> sure, based on your cryptodev git, just tried 4.3 (6a13feb , good)
> kernel in attempt to find (bisect) when RSA code break, already tested
> 4.5 (44d1b6d , bad) , 4.4 (afd2ff9 , bad).
> Going to try your patch soon (when I'm back home).
> So far 4.3 passes RSA stage without OOPS, but for other reason does
> not boot to login prompt. Boot log exempt (4.3), this is with
> CONFIG_CRYPTO_RSA=y :

Anatoly, could you also give this a try please: 
Thanks

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index b86883a..770970ff 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1805,8 +1805,8 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
goto free_req;
 
sg_init_table(src_tab, 2);
-   sg_set_buf(_tab[0], vecs->m, 8);
-   sg_set_buf(_tab[1], vecs->m + 8, vecs->m_size - 8);
+   sg_set_buf(_tab[0], vecs->m, 4);
+   sg_set_buf(_tab[1], vecs->m + 4, vecs->m_size - 4);
sg_init_one(, outbuf_enc, out_len_max);
akcipher_request_set_crypt(req, src_tab, , vecs->m_size,
   out_len_max);


-- 
TS
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Herbert Xu
On Thu, May 05, 2016 at 12:40:18PM +0300, Anatoly Pugachev wrote:
> 
> sure, based on your cryptodev git, just tried 4.3 (6a13feb , good)
> kernel in attempt to find (bisect) when RSA code break, already tested
> 4.5 (44d1b6d , bad) , 4.4 (afd2ff9 , bad).
> Going to try your patch soon (when I'm back home).
> So far 4.3 passes RSA stage without OOPS, but for other reason does
> not boot to login prompt. Boot log exempt (4.3), this is with
> CONFIG_CRYPTO_RSA=y :

That jibes with this being a problem with the SG list since it
was only added in 4.4.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Anatoly Pugachev
On Thu, May 5, 2016 at 11:42 AM, Herbert Xu  wrote:
> On Wed, May 04, 2016 at 05:49:04PM +0300, Anatoly Pugachev wrote:
>>
>> just tested cryptodev (
>> http://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
>> ) kernel, same OOPS, but kernel version is 4.6.0-rc2+ .
>> kernel OOPS message - https://paste.fedoraproject.org/362554/23732641/
>
> Anatoly, could you please test this patch on top of cryptodev?

Herbert,

sure, based on your cryptodev git, just tried 4.3 (6a13feb , good)
kernel in attempt to find (bisect) when RSA code break, already tested
4.5 (44d1b6d , bad) , 4.4 (afd2ff9 , bad).
Going to try your patch soon (when I'm back home).
So far 4.3 passes RSA stage without OOPS, but for other reason does
not boot to login prompt. Boot log exempt (4.3), this is with
CONFIG_CRYPTO_RSA=y :

[0.00] PROMLIB: Sun IEEE Boot Prom 'OBP 4.38.3 2015/11/11 10:38'
[0.00] PROMLIB: Root node compatible: sun4v
[0.00] Initializing cgroup subsys cpuset
[0.00] Initializing cgroup subsys cpu
[0.00] Initializing cgroup subsys cpuacct
[0.00] Linux version 4.3.0+ (mator@ttip) (gcc version 6.0.1
20160423 (prerelease) (Debian 6.0.1-2) ) #4 SMP Thu May 5 05:26:2
8 EDT 2016
[0.00] debug: skip boot console de-registration.
[0.00] bootconsole [earlyprom0] enabled
[0.00] ARCH: SUN4V
[0.00] Ethernet address: 00:14:4f:f8:be:54
[0.00] MM: PAGE_OFFSET is 0xfff8 (max_phys_bits == 47)
[0.00] MM: VMALLOC [0x0001 --> 0x0006]
[0.00] MM: VMEMMAP [0x0006 --> 0x000c]
[0.00] Kernel: Using 3 locked TLB entries for main kernel image.
[0.00] Remapping the kernel... done.
[0.00] OF stdout device is: /virtual-devices@100/console@1
[0.00] PROM: Built device tree with 76231 bytes of memory.
[0.00] MDESC: Size is 35264 bytes.
[0.00] PLATFORM: banner-name [SPARC T5-2]
[0.00] PLATFORM: name [ORCL,SPARC-T5-2]
[0.00] PLATFORM: hostid [84f8be54]
[0.00] PLATFORM: serial# [0035260e]
[0.00] PLATFORM: stick-frequency [3b9aca00]
[0.00] PLATFORM: mac-address [144ff8be54]
[0.00] PLATFORM: watchdog-resolution [1000 ms]
[0.00] PLATFORM: watchdog-max-timeout [3153600 ms]
[0.00] PLATFORM: max-cpus [1024]
[0.00] Top of RAM: 0x20afff, Total RAM: 0x2ffa06000
[0.00] Memory hole size: 121605MB
[0.00] Allocated 32768 bytes for kernel page tables.
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x3040-0x0020affe]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x3040-0x6fe7]
[0.00]   node   0: [mem 0x6ff0-0x6ff25fff]
[0.00]   node   0: [mem 0x7000-0x0002afff]
[0.00]   node   0: [mem 0x00203000-0x0020aff3]
[0.00]   node   0: [mem 0x0020affc-0x0020affd5fff]
[0.00]   node   0: [mem 0x0020affe6000-0x0020affe]
[0.00] Initmem setup node 0 [mem 0x3040-0x0020affe]
[0.00] Booting Linux...
[0.00] CPU CAPS: [flush,stbar,swap,muldiv,v9,blkinit,n2,mul32]
[0.00] CPU CAPS: [div32,v8plus,popc,vis,vis2,ASIBlkInit,fmaf,vis3]
[0.00] CPU CAPS: [hpc,ima,pause,cbcond,aes,des,kasumi,camellia]
[0.00] CPU CAPS: [md5,sha1,sha256,sha512,mpmul,montmul,montsqr,crc32c]
[0.00] PERCPU: Embedded 8 pages/cpu @fff80020ae40 s28184
r8192 d29160 u65536
[0.00] SUN4V: Mondo queue sizes [cpu(131072) dev(16384) r(8192) nr(256)]
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 1558281
[0.00] Kernel command line: root=/dev/vdiska2 ro keep_bootcon
noresume debug loglevel=7
[0.00] log_buf_len individual max cpu contribution: 4096 bytes
[0.00] log_buf_len total cpu_extra contributions: 1044480 bytes
[0.00] log_buf_len min size: 131072 bytes
[0.00] log_buf_len: 2097152 bytes
[0.00] early log buf free: 126168(96%)
[0.00] PID hash table entries: 4096 (order: 2, 32768 bytes)
[0.00] Dentry cache hash table entries: 2097152 (order: 11,
16777216 bytes)
[0.00] Inode-cache hash table entries: 1048576 (order: 10,
8388608 bytes)
[0.00] Sorting __ex_table...
[0.00] Memory: 12364272K/12576792K available (5381K kernel
code, 702K rwdata, 1424K rodata, 440K init, 747K bss, 212520K rese
rved, 0K cma-reserved)
[0.00] Hierarchical RCU implementation.
[0.00]  Build-time adjustment of leaf fanout to 64.
[0.00] NR_IRQS:2048 nr_irqs:2048 1
[0.00] SUN4V: Using IRQ API major 3, cookie only virqs enabled
[5664484.612319] clocksource: stick: mask: 0x
max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 

Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-05 Thread Herbert Xu
On Wed, May 04, 2016 at 05:49:04PM +0300, Anatoly Pugachev wrote:
>
> just tested cryptodev (
> http://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
> ) kernel, same OOPS, but kernel version is 4.6.0-rc2+ .
> kernel OOPS message - https://paste.fedoraproject.org/362554/23732641/

Anatoly, could you please test this patch on top of cryptodev?
Thanks!

---8<---
Subject: crypto: testmgr - Use kmalloc memory for RSA input

As akcipher uses an SG interface, you must not use vmalloc memory
as input for it.  This patch fixes testmgr to copy the vmalloc
test vectors to kmalloc memory before running the test.

This patch also removes a superfluous sg_virt call in do_test_rsa.

Cc: 
Reported-by: Anatoly Pugachev 
Signed-off-by: Herbert Xu 

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index fcd89fe..c727fb0 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1780,6 +1780,7 @@ static int alg_test_drbg(const struct alg_test_desc 
*desc, const char *driver,
 static int do_test_rsa(struct crypto_akcipher *tfm,
   struct akcipher_testvec *vecs)
 {
+   char *xbuf[XBUFSIZE];
struct akcipher_request *req;
void *outbuf_enc = NULL;
void *outbuf_dec = NULL;
@@ -1788,9 +1789,12 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
int err = -ENOMEM;
struct scatterlist src, dst, src_tab[2];
 
+   if (testmgr_alloc_buf(xbuf))
+   return err;
+
req = akcipher_request_alloc(tfm, GFP_KERNEL);
if (!req)
-   return err;
+   goto free_xbuf;
 
init_completion();
 
@@ -1808,9 +1812,14 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
if (!outbuf_enc)
goto free_req;
 
+   if (WARN_ON(vecs->m_size > PAGE_SIZE))
+   goto free_all;
+
+   memcpy(xbuf[0], vecs->m, vecs->m_size);
+
sg_init_table(src_tab, 2);
-   sg_set_buf(_tab[0], vecs->m, 8);
-   sg_set_buf(_tab[1], vecs->m + 8, vecs->m_size - 8);
+   sg_set_buf(_tab[0], xbuf[0], 8);
+   sg_set_buf(_tab[1], xbuf[0] + 8, vecs->m_size - 8);
sg_init_one(, outbuf_enc, out_len_max);
akcipher_request_set_crypt(req, src_tab, , vecs->m_size,
   out_len_max);
@@ -1829,7 +1838,7 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
goto free_all;
}
/* verify that encrypted message is equal to expected */
-   if (memcmp(vecs->c, sg_virt(req->dst), vecs->c_size)) {
+   if (memcmp(vecs->c, outbuf_enc, vecs->c_size)) {
pr_err("alg: rsa: encrypt test failed. Invalid output\n");
err = -EINVAL;
goto free_all;
@@ -1844,7 +1853,13 @@ static int do_test_rsa(struct crypto_akcipher *tfm,
err = -ENOMEM;
goto free_all;
}
-   sg_init_one(, vecs->c, vecs->c_size);
+
+   if (WARN_ON(vecs->c_size > PAGE_SIZE))
+   goto free_all;
+
+   memcpy(xbuf[0], vecs->c, vecs->c_size);
+
+   sg_init_one(, xbuf[0], vecs->c_size);
sg_init_one(, outbuf_dec, out_len_max);
init_completion();
akcipher_request_set_crypt(req, , , vecs->c_size, out_len_max);
@@ -1871,6 +1886,8 @@ free_all:
kfree(outbuf_enc);
 free_req:
akcipher_request_free(req);
+free_xbuf:
+   testmgr_free_buf(xbuf);
return err;
 }
 
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-04 Thread David Miller
From: Anatoly Pugachev 
Date: Wed, 4 May 2016 22:10:47 +0300

> Here's a quick diff related to crypto for debian kernel configs:
> 
> $ diff -u /boot/config-4.5.0-2-sparc64-smp /boot/config-4.6.0-rc5-sparc64-smp
> @@ -5299,10 +5380,9 @@
>  CONFIG_CRYPTO_RNG=m
>  CONFIG_CRYPTO_RNG2=y
>  CONFIG_CRYPTO_RNG_DEFAULT=m
> -CONFIG_CRYPTO_PCOMP=m
> -CONFIG_CRYPTO_PCOMP2=y
>  CONFIG_CRYPTO_AKCIPHER2=y
> -# CONFIG_CRYPTO_RSA is not set
> +CONFIG_CRYPTO_AKCIPHER=y
> +CONFIG_CRYPTO_RSA=y
>  CONFIG_CRYPTO_MANAGER=y
>  CONFIG_CRYPTO_MANAGER2=y
>  # CONFIG_CRYPTO_USER is not set
> 
> so, I need to compile 4.5.x kernel (or even older kernels) with
> CRYPTO_RSA=y and test how it would act.

Well yes, that would be an absolutely critical datapoint.

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-04 Thread Tadeusz Struk
Hi Anatoly,
On 05/04/2016 12:10 PM, Anatoly Pugachev wrote:
> we're using 4.5.2 debian kernel here without this problem. I'm not
> sure I would be able to bisect, never did it before, but I could
> try...

On 4.5.2 could you try "modprobe rsa"

-- 
TS
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-04 Thread Anatoly Pugachev
On Tue, May 3, 2016 at 7:33 PM, David Miller  wrote:
> From: Anatoly Pugachev 
> Date: Tue, 3 May 2016 16:54:18 +0300
>
>> I have git kernel OOPS (4.6.0-rc6) on sparc64. This OOPS does not
>> happen, if I set the following kernel option:
>>
>> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
>>
>> Can someone please look at 
>> https://bugzilla.kernel.org/show_bug.cgi?id=117551 ?
>
> The lib/mpi/ code hasn't been touched in a long time, so I can only see that 
> it might
> be the crypto/rsa.c changes that happened this release.
>
> Can you possibly bisect this or at least tell us that 4.5 doesn't have this 
> problem?

David,

we're using 4.5.2 debian kernel here without this problem. I'm not
sure I would be able to bisect, never did it before, but I could
try...

Here's a quick diff related to crypto for debian kernel configs:

$ diff -u /boot/config-4.5.0-2-sparc64-smp /boot/config-4.6.0-rc5-sparc64-smp
@@ -5299,10 +5380,9 @@
 CONFIG_CRYPTO_RNG=m
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_RNG_DEFAULT=m
-CONFIG_CRYPTO_PCOMP=m
-CONFIG_CRYPTO_PCOMP2=y
 CONFIG_CRYPTO_AKCIPHER2=y
-# CONFIG_CRYPTO_RSA is not set
+CONFIG_CRYPTO_AKCIPHER=y
+CONFIG_CRYPTO_RSA=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_USER is not set

so, I need to compile 4.5.x kernel (or even older kernels) with
CRYPTO_RSA=y and test how it would act. And if it would not crash, I
could try to bisect.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-04 Thread Anatoly Pugachev
On Wed, May 4, 2016 at 7:07 AM, Herbert Xu  wrote:
> David Miller  wrote:
>> From: Anatoly Pugachev 
>> Date: Tue, 3 May 2016 16:54:18 +0300
>>
>>> I have git kernel OOPS (4.6.0-rc6) on sparc64. This OOPS does not
>>> happen, if I set the following kernel option:
>>>
>>> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
>>>
>>> Can someone please look at 
>>> https://bugzilla.kernel.org/show_bug.cgi?id=117551 ?
>>
>> The lib/mpi/ code hasn't been touched in a long time, so I can only see that 
>> it might
>> be the crypto/rsa.c changes that happened this release.
>>
>> Can you possibly bisect this or at least tell us that 4.5 doesn't have this 
>> problem?
>
> It would also be helpful to test the latest cryptodev tree which
> has a large number of MPI fixes from Nicolai Stange.

Herbert,

just tested cryptodev (
http://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
) kernel, same OOPS, but kernel version is 4.6.0-rc2+ .
kernel OOPS message - https://paste.fedoraproject.org/362554/23732641/
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-03 Thread Herbert Xu
David Miller  wrote:
> From: Anatoly Pugachev 
> Date: Tue, 3 May 2016 16:54:18 +0300
> 
>> I have git kernel OOPS (4.6.0-rc6) on sparc64. This OOPS does not
>> happen, if I set the following kernel option:
>> 
>> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
>> 
>> Can someone please look at 
>> https://bugzilla.kernel.org/show_bug.cgi?id=117551 ?
> 
> The lib/mpi/ code hasn't been touched in a long time, so I can only see that 
> it might
> be the crypto/rsa.c changes that happened this release.
> 
> Can you possibly bisect this or at least tell us that 4.5 doesn't have this 
> problem?

It would also be helpful to test the latest cryptodev tree which
has a large number of MPI fixes from Nicolai Stange.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [crypto / sparc64] cryptomgr_test OOPS

2016-05-03 Thread David Miller
From: Anatoly Pugachev 
Date: Tue, 3 May 2016 16:54:18 +0300

> I have git kernel OOPS (4.6.0-rc6) on sparc64. This OOPS does not
> happen, if I set the following kernel option:
> 
> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
> 
> Can someone please look at https://bugzilla.kernel.org/show_bug.cgi?id=117551 
> ?

The lib/mpi/ code hasn't been touched in a long time, so I can only see that it 
might
be the crypto/rsa.c changes that happened this release.

Can you possibly bisect this or at least tell us that 4.5 doesn't have this 
problem?
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[crypto / sparc64] cryptomgr_test OOPS

2016-05-03 Thread Anatoly Pugachev
Hello!

I have git kernel OOPS (4.6.0-rc6) on sparc64. This OOPS does not
happen, if I set the following kernel option:

CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y

Can someone please look at https://bugzilla.kernel.org/show_bug.cgi?id=117551 ?

Thanks.

There's attached kernel config on bugzilla.

kernel OOPS:


SPARC Enterprise T5120, No Keyboard
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.33.6.f, 16256 MB memory available, Serial #78400024.
Ethernet address 0:14:4f:ac:4a:18, Host ID: 84ac4a18.



Boot device: disk1  File and args:
SILO Version 1.4.14
boot:
LinuxLinuxOLD 6
boot: 6
Allocated 64 Megs of memory at 0x4000 for kernel
Uncompressing image...
Loaded kernel version 4.6.0
Loading initial ramdisk (14627617 bytes at 0xC80 phys, 0x40C0 virt)...
/
[0.00] PROMLIB: Sun IEEE Boot Prom 'OBP 4.33.6.f 2014/07/10 10:23'
[0.00] PROMLIB: Root node compatible: sun4v
[0.00] Linux version 4.6.0-rc6+ (mator@deb4g) (gcc version
6.0.1 20160423 (prerelease) (Debian 6.0.1-2) ) #1 SMP Tue May 3
13:49:36 MSK 2016
[0.00] debug: skip boot console de-registration.
[0.00] bootconsole [earlyprom0] enabled
[0.00] ARCH: SUN4V
[0.00] Ethernet address: 00:14:4f:ac:4a:18
[0.00] MM: PAGE_OFFSET is 0x8000 (max_phys_bits == 39)
[0.00] MM: VMALLOC [0x0001 --> 0x6000]
[0.00] MM: VMEMMAP [0x6000 --> 0xc000]
[0.00] Kernel: Using 3 locked TLB entries for main kernel image.
[0.00] Remapping the kernel... done.
[0.00] OF stdout device is: /virtual-devices@100/console@1
[0.00] PROM: Built device tree with 195069 bytes of memory.
[0.00] MDESC: Size is 61728 bytes.
[0.00] PLATFORM: banner-name [SPARC Enterprise T5120]
[0.00] PLATFORM: name [SUNW,SPARC-Enterprise-T5120]
[0.00] PLATFORM: hostid [84ac4a18]
[0.00] PLATFORM: serial# [00ab4130]
[0.00] PLATFORM: stick-frequency [457646c0]
[0.00] PLATFORM: mac-address [144fac4a18]
[0.00] PLATFORM: watchdog-resolution [1000 ms]
[0.00] PLATFORM: watchdog-max-timeout [3153600 ms]
[0.00] PLATFORM: max-cpus [64]
[0.00] Top of RAM: 0x3ffb16000, Total RAM: 0x3f76ac000
[0.00] Memory hole size: 132MB
[0.00] Allocated 16384 bytes for kernel page tables.
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x0840-0x0003ffb15fff]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x0840-0x0003ffa89fff]
[0.00]   node   0: [mem 0x0003ffa9a000-0x0003ffaadfff]
[0.00]   node   0: [mem 0x0003ffb08000-0x0003ffb15fff]
[0.00] Initmem setup node 0 [mem 0x0840-0x0003ffb15fff]
[0.00] Booting Linux...
[0.00] CPU CAPS: [flush,stbar,swap,muldiv,v9,blkinit,n2,mul32]
[0.00] CPU CAPS: [div32,v8plus,popc,vis,vis2,ASIBlkInit]
[0.00] percpu: Embedded 9 pages/cpu @8003ff00 s29528
r8192 d36008 u131072
[0.00] SUN4V: Mondo queue sizes [cpu(8192) dev(16384) r(8192) nr(256)]
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 2061296
[0.00] Kernel command line: root=/dev/mapper/vg1-root ro
keep_bootcon console=ttyS0
[0.00] log_buf_len individual max cpu contribution: 4096 bytes
[0.00] log_buf_len total cpu_extra contributions: 258048 bytes
[0.00] log_buf_len min size: 131072 bytes
[0.00] log_buf_len: 524288 bytes
[0.00] early log buf free: 127592(97%)
[0.00] PID hash table entries: 4096 (order: 2, 32768 bytes)
[0.00] Dentry cache hash table entries: 2097152 (order: 11,
16777216 bytes)
[0.00] Inode-cache hash table entries: 1048576 (order: 10,
8388608 bytes)
[0.00] Sorting __ex_table...
[0.00] Memory: 16433448K/16636592K available (5565K kernel
code, 733K rwdata, 1392K rodata, 456K init, 742K bss, 203144K
reserved, 0K cma-reserved)
[0.00] Hierarchical RCU implementation.
[0.00]  Build-time adjustment of leaf fanout to 64.
[0.00]  RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=64.
[0.00] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=64
[0.00] NR_IRQS:2048 nr_irqs:2048 1
[0.00] SUN4V: Using IRQ API major 1, cookie only virqs disabled
[ 7218.283063] clocksource: stick: mask: 0x
max_cycles: 0x10cc5ac4c8a, max_idle_ns: 440795218862 ns
[ 7218.283875] clocksource: mult[dbabc5] shift[24]
[ 7218.284206] clockevent: mult[952b25d1] shift[31]
[ 7218.286792] Console: colour dummy device 80x25
[ 7218.364903] Calibrating delay using timer specific routine..
2337.22 BogoMIPS (lpj=4674457)
[ 7218.365869] pid_max: default: 65536 minimum: 512
[ 7218.367733] Security Framework initialized
[