Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-23 Thread Stephan Müller
Am Montag, 24. April 2017, 08:16:50 CEST schrieb Stephan Müller: Hi Gilad, > > > > int __des3_ede_setkey(u32 *expkey, u32 *flags, const u8 *key, > > > > unsigned int keylen) > > > > However, this does not check that k1 == k3. In this case DES3 > > becomes 2DES (2-keys TDE

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-23 Thread Stephan Müller
Am Montag, 24. April 2017, 08:06:09 CEST schrieb Gilad Ben-Yossef: Hi Gilad, > > Well, it turns out there is and we do :-) > > This is from crypto/des_generic.c: > > /* > * RFC2451: > * > * For DES-EDE3, there is no known need to reject weak or > * complementation keys. Any weakness is

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-23 Thread Gilad Ben-Yossef
On Sun, Apr 23, 2017 at 12:48 PM, Gilad Ben-Yossef wrote: > Hi, > > Thank you for the review. > > On Thu, Apr 20, 2017 at 4:39 PM, Stephan Müller wrote: > >>> +/* The function verifies that tdes keys are not weak.*/ >>> +static int ssi_fips_verify_3des_keys(const u8 *key, unsigned int keylen) >>>

Re: [PATCH v1 2/8] ASoC: Intel: Skylake: Use recently introduced uuid_le_cmp_p{p}()

2017-04-23 Thread Vinod Koul
On Fri, Apr 21, 2017 at 05:46:39PM +0300, Andy Shevchenko wrote: > Recently introduced helpers take pointers to uuid_{be|le} instead of > reference. Are they in linus's tree, if not it introduces dependency, so we might want to defer after merge window > > Using them makes code less ugly. How s

[PATCH] staging: rtl8192u: Fix sparse warning

2017-04-23 Thread Marcos Paulo de Souza
Fix the following sparse warning: rtl8192u/ieee80211/ieee80211_rx.c:1489:45: warning: incorrect type in assignment (different base types) rtl8192u/ieee80211/ieee80211_rx.c:1489:45:expected restricted __le16 rtl8192u/ieee80211/ieee80211_rx.c:1489:45:got unsigned short [unsigned] [usertyp

Re: [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers

2017-04-23 Thread Winkler, Tomas
On Sun, 2017-04-23 at 15:42 +0300, Andy Shevchenko wrote: > On Sun, Apr 23, 2017 at 1:29 PM, Winkler, Tomas com> wrote: > > > New helpers take pointers to uuid_{be|le} as parameters. > > > > > > When using them on a raw data we don't need to do an ugly > > > dereference and, > > > in some cases,

[PATCH] staging: fbtft: fix open parentheses alignment

2017-04-23 Thread Christophe Colin
Modify the code indentations to fix the checkpatch issues. Signed-off-by: Christophe Colin --- drivers/staging/fbtft/fbtft-sysfs.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c index e

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-23 Thread Stephan Müller
Am Sonntag, 23. April 2017, 11:48:58 CEST schrieb Gilad Ben-Yossef: Hi Gilad, > I do wonder if there is value in alternate behavior of stopping crypto > API on FIPS error rather than a panic though. I will try to get an > explanation why we do it this way. In FIPS, all crypto function must cease

[PATCH] staging: fbtft: fix character limit, trailing ; warning, etc.

2017-04-23 Thread Eric Curtin
checkpatch spits out a warning about the 80 character line limit. Split the parameters of these functions onto different lines. Put the ; with the macro caller instead. Lined up parameters as there was another CHECK warning about that. Signed-off-by: Eric Curtin --- drivers/staging/fbtft/fbtft-b

Re: [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers

2017-04-23 Thread Andy Shevchenko
On Sun, Apr 23, 2017 at 1:29 PM, Winkler, Tomas wrote: >> New helpers take pointers to uuid_{be|le} as parameters. >> >> When using them on a raw data we don't need to do an ugly dereference and, >> in some cases, a type casting. > I think this going overboard, the _pp types are just enough. I l

[PATCH 1/1] staging: wilc1000: fix unchecked return value

2017-04-23 Thread Pan Bian
From: Pan Bian Function dev_alloc_skb() will return a NULL pointer if there is no enough memory. However, in function WILC_WFI_mon_xmit(), its return value is used without validation. This may result in a bad memory access bug. This patch fixes the bug. Signed-off-by: Pan Bian --- drivers/stag

RE: [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers

2017-04-23 Thread Winkler, Tomas
> New helpers take pointers to uuid_{be|le} as parameters. > > When using them on a raw data we don't need to do an ugly dereference and, > in some cases, a type casting. > > Cc: Andrew Morton > Cc: Arnd Bergmann > Cc: Liam Girdwood > Cc: Mark Brown > Cc: Vinod Koul > Cc: Srinivas Pandruvada

[PATCH] staging: android: ion: fix coding style issue

2017-04-23 Thread Adheer Chandravanshi
Use tab instead of spaces for indentation, as reported by checkpatch.pl Signed-off-by: Adheer Chandravanshi --- drivers/staging/android/ion/ion_cma_heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/andro

[PATCH 1/1] staging: comedi: addi_apci_3xxx: check return value

2017-04-23 Thread Pan Bian
From: Pan Bian Function pci_ioremap_bar() will return a NULL pointer if there is no enough memory. However, in function apci3xxx_auto_attach(), the return value of function pci_ioremap_bar() is not validated. This may result in NULL dereference in following access to dev->mmio. This patch fixes t

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-23 Thread Gilad Ben-Yossef
Hi, Thank you for the review. On Thu, Apr 20, 2017 at 4:39 PM, Stephan Müller wrote: >> +/* The function verifies that tdes keys are not weak.*/ >> +static int ssi_fips_verify_3des_keys(const u8 *key, unsigned int keylen) >> +{ >> +#ifdef CCREE_FIPS_SUPPORT >> +tdes_keys_t *tdes_key = (

Re: [PATCH v2 1/9] staging: ccree: introduce CryptoCell HW driver

2017-04-23 Thread Gilad Ben-Yossef
Hi, [ Re sending with all recipients this time ... ] On Thu, Apr 20, 2017 at 5:01 PM, Greg Kroah-Hartman wrote: >> > Oh, I have to ask, do you really mean "any later version" here and >> > elsewhere? >> > >> > If so, then your MODULE_LICENSE() marking is wrong, please fix that up, >> > or fix u

[PATCH v3 13/15] staging: ccree: fix array_size.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot drivers/staging/ccree/ssi_sysfs.c:319:34-35: WARNING: Use ARRAY_SIZE drivers/staging/ccree/ssi_sysfs.c:429:34-35: WARNING: Use ARRAY_SIZE Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Semantic patch information: This makes an effort to find cas

[PATCH v3 07/15] staging: ccree: add TODO list

2017-04-23 Thread Gilad Ben-Yossef
Add TODO list for moving out of staging tree for ccree crypto driver Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 drivers/staging/ccree/TODO diff --git a/drivers/staging/ccree/TODO b/driv

[PATCH v3 15/15] staging: ccree: fix ifnullfree.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot drivers/staging/ccree/ssi_hash.c:317:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. drivers/staging/ccree/ssi_h

[PATCH v3 14/15] staging: ccree: fix ifnullfree.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot drivers/staging/ccree/ssi_buffer_mgr.c:530:3-19: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before

[PATCH v3 10/15] staging: ccree: remove useless NULL test of field

2017-04-23 Thread Gilad Ben-Yossef
Remove kbuild test robot reported NULL check for a struct field address. Signed-off-by: Gilad Ben-Yossef Reported-by: kbuild test robot --- drivers/staging/ccree/ssi_buffer_mgr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/dri

[PATCH v3 11/15] staging: ccree: fix platform_no_drv_owner.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot drivers/staging/ccree/ssi_driver.c:484:6-11: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Gilad Ben-Yossef Signed-off-

[PATCH v3 12/15] staging: ccree: fix semicolon.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot drivers/staging/ccree/ssi_request_mgr.c:623:3-4: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Gilad Ben-Yossef Signed-off-by: Fengguang Wu --- drivers/staging/ccree/ssi_request_mgr.c | 2 +- 1 fil

[PATCH v3 08/15] staging: ccree: add DT bindings for Arm CryptoCell

2017-04-23 Thread Gilad Ben-Yossef
This adds DT bindings for the Arm TrustZone CryptoCell cryptographic accelerator IP. Signed-off-by: Gilad Ben-Yossef --- .../devicetree/bindings/crypto/arm-cryptocell.txt | 27 ++ 1 file changed, 27 insertions(+) create mode 100644 drivers/staging/ccree/Documentation/devic

[PATCH v3 09/15] MAINTAINERS: add Gilad BY as ccree maintainer

2017-04-23 Thread Gilad Ben-Yossef
I work for Arm on maintaining the TrustZone CryptoCell driver. Signed-off-by: Gilad Ben-Yossef --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 676c139..f21caa1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3066,6 +3066,13 @@ F: dr

[PATCH v3 06/15] staging: ccree: add FIPS support

2017-04-23 Thread Gilad Ben-Yossef
Add FIPS mode support to CryptoCell driver Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig |9 + drivers/staging/ccree/Makefile |1 + drivers/staging/ccree/ssi_aead.c|6 + drivers/staging/ccree/ssi_cipher.c | 52 + drivers/staging/c

[PATCH v3 05/15] staging: ccree: add AEAD support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell AEAD support Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig |1 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 21 + drivers/staging/ccree/ssi_aead.c | 2826 driv

[PATCH v3 02/15] staging: ccree: add ahash support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell async. hash and HMAC support. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig |6 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 22 + drivers/staging/ccree/hash_defs.h | 78 + drivers/staging/cc

[PATCH v3 04/15] staging: ccree: add IV generation support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell IV hardware generation support. This patch adds the needed support to drive the HW but does not expose the ability via the kernel crypto API yet. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Makefile | 2 +- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +

[PATCH v3 03/15] staging: ccree: add skcipher support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell skcipher support Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig |8 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 21 + drivers/staging/ccree/ssi_buffer_mgr.c | 147 drivers/staging/ccree/ssi_bu

[PATCH v3 00/15] staging: ccree: add Arm TrustZone CryptoCell REE driver

2017-04-23 Thread Gilad Ben-Yossef
Arm TrustZone CryptoCell 700 is a family of cryptographic hardware accelerators. It is supported by a long lived series of out of tree drivers, which I am now in the process of unifying and upstreaming. This is the first drop, supporting the new CryptoCell 712 REE. The code still needs some cleanu