[patch] crypto: caam - remove duplicate FIFOST_CONT_MASK define

2014-06-09 Thread Dan Carpenter
The FIFOST_CONT_MASK define is cut and pasted twice so we can delete the second instance. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index 7e4500f..d397ff9 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h @@ -321,7

Re: [PATCH] Potential NULL pointer deference in drbg_ctr_df

2014-07-04 Thread Dan Carpenter
e place S4 at the end > > +* of the input data chain > > +*/ > > + S2.next = addtl; > > + tempstr = addtl; > > + while (tempstr->next) > > + tempstr = tempstr->next; > > +

Re: [PATCH 3/4] DRBG: Fix format string for debugging statements

2014-07-04 Thread Dan Carpenter
__must_be_array(arr)) > +#define ARRAY_SIZE(arr) \ > + (sizeof(arr) / sizeof((arr)[0]) + (size_t)__must_be_array(arr)) This change is a no-op isn't it? I think Stephen Rothwell's suggestion is correct. In linux-next this was changed to %lu which also works... Are there arches %zu and %lu are different? regards, dan carpenter -- 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

[patch] crypto: qat - remove an unneeded cast

2014-07-08 Thread Dan Carpenter
The cast to (unsigned int *) doesn't hurt anything but it is pointless. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index 903ca88..28da876 100644 --- a/drivers/crypto/qat/qat_common/qat_hal.c +++ b/drivers/c

re: PKCS#7: Verify internal certificate chain

2014-07-31 Thread Dan Carpenter
7 found_issuer: 238 pr_debug("- issuer %s\n", p->subject); ^^ Also this looks like it should be "subject" instead of "issuer" but maybe they are the same? 239 if (p->seen) {

[patch] crypto: sha-mb - remove a bogus NULL check

2014-11-22 Thread Dan Carpenter
This can't be NULL and we dereferenced it earlier. Smatch used to ignore these things where the pointer was obviously non-NULL but I've found that sometimes the intention was to check something else so we were maybe missing bugs. Signed-off-by: Dan Carpenter diff --git a/arch/x86/cry

re: crypto: qat - Intel(R) QAT transport code

2014-12-02 Thread Dan Carpenter
condition is reversed, so it only enables coalescing on error. Probably this feature has not been tested yet. 413 adf_enable_coalesc(bank, "Accelerator0", bank_num); 414 else 415 bank->irq_coalesc_timer = ADF_COALESCING_MIN_TIME; 41

[patch 2/2] crypto: img-hash - shift wrapping bug in img_hash_hw_init()

2015-03-20 Thread Dan Carpenter
"hdev->req->nbytes" is an unsigned int so we so we lose the upper 3 bytes to the shift wrap bug. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 601ab35..ad47d0d 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/c

[patch 1/2] crypto: img-hash - fix some compile warnings

2015-03-20 Thread Dan Carpenter
GCC complains about that %u is the wrong format string for size_t and also that "ret" is unused. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index fec61fc..601ab35 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/

[patch 2/2 v2] crypto: img-hash - shift wrapping bug in img_hash_hw_init()

2015-03-23 Thread Dan Carpenter
"hdev->req->nbytes" is an unsigned int so we so we lose the upper 3 bits to the shift wrap bug. Signed-off-by: Dan Carpenter --- v2: typo in changelog diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 601ab35..ad47d0d 100644 --- a/drivers/crypto/img-hash

[patch -next] crypto: algif - signedness bug in skcipher_recvmsg_async()

2015-03-26 Thread Dan Carpenter
This needs to be signed because af_alg_make_sg() returns negative error codes. Fixes: a596999b7ddf ('crypto: algif - change algif_skcipher to be asynchronous') Signed-off-by: Dan Carpenter diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 506eb5f..142430f 100644 --

[bug report] chcr: Support for Chelsio's Crypto Hardware

2016-10-12 Thread Dan Carpenter
break; 378 spage = sg_page(sg); ^^^ Unchecked dereference inside function. 379 get_page(spage); 380 page_len = min(sg->length, count); regards, dan carpenter -- To unsubscribe from this list: send

[bug report] crypto: ccp - Let a v5 CCP provide the same function as v3

2016-10-12 Thread Dan Carpenter
0; 57 58 mutex_unlock(&ccp->sb_mutex); 59 60 /* Wait for KSB entries to become available */ 61 if (wait_event_interruptible(ccp->sb_queue, ccp->sb_avail)) 62 return 0; 63 } 64

[bug report] crypto: omap-sham - add support functions for sg based data handling

2016-10-13 Thread Dan Carpenter
return 0; 810 regards, dan carpenter -- 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

[patch] s390/crypto: unlock on error in prng_tdes_read()

2016-11-18 Thread Dan Carpenter
We added some new locking but forgot to unlock on error. Fixes: 57127645d79d ("s390/zcrypt: Introduce new SHA-512 based Pseudo Random Generator.") Signed-off-by: Dan Carpenter diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c index 9cc050f..1113389 100644 --- a/arch/s

[bug report] crypto: chcr - Add AEAD algos.

2016-12-01 Thread Dan Carpenter
2461 pr_err("chcr : %s : No crypto device.\n", __func__); 2462 return -ENXIO; regards, dan carpenter -- 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

[patch] crypto: chcr - checking for IS_ERR() instead of NULL

2016-12-01 Thread Dan Carpenter
The create_hash_wr() function never returns error pointers. It returns NULL on error. Fixes: 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr") Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 32361d

Re: [bug report] crypto: chcr - Add AEAD algos.

2017-01-24 Thread Dan Carpenter
Ping? regards, dan carpenter On Thu, Dec 01, 2016 at 11:48:58PM +0300, Dan Carpenter wrote: > Hello Harsh Jain, > > This is a semi-automatic email about new static checker warnings. > > The patch 2debd3325e55: "crypto: chcr - Add AEAD algos." from Nov 29, > 2016, l

[bug report] crypto: atmel-sha - update request queue management to make it more generic

2017-02-07 Thread Dan Carpenter
L dereference. 674 in_desc->callback_param = dd; 675 676 atmel_sha_write_ctrl(dd, 1); 677 regards, dan carpenter

[bug report] crypto: brcm - Add Broadcom SPU driver

2017-02-13 Thread Dan Carpenter
can deallocate it now */ 2344 crypto_free_shash(ctx->shash->tfm); 2345 kfree(ctx->shash); 2346 return ret; 2347 } regards, dan carpenter

[bug report] crypto: cavium - Add Support for Octeon-tx CPT Engine

2017-02-14 Thread Dan Carpenter
grp].group; 82 cpt_write_csr64(cpt->reg_base, CPTX_PF_QX_CTL(0, q), pf_qx_ctl.u); 83 dev_dbg(dev, "VF %d TYPE %s", q, (mcode[grp].is_ae ? "AE" : "SE")); 84 85 return mcode[grp].is_ae ? AE_TYPES : SE_TYPES; 86 } regards, dan carpenter

[bug report] crypto: cavium - Add the Virtual Function driver for CPT

2017-02-15 Thread Dan Carpenter
if (!info || !cptvf) { ^ Check is too late. 334 dev_err(&pdev->dev, "Input params are incorrect for post processing\n"); 335 return; regards, dan carpenter

[bug report] crypto: cavium - Add the Virtual Function driver for CPT

2017-02-16 Thread Dan Carpenter
897 898 /* Convey DOWN to PF */ 899 if (cptvf_send_vf_down(cptvf)) { ^ Oops inside function. 900 dev_err(&pdev->dev, "PF not responding to DOWN msg"); 901 } else { regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-07-27 Thread Dan Carpenter
that it frees it so you don't have to scroll to the bottom of the function or jump to a different file. regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-07-28 Thread Dan Carpenter
On Fri, Jul 28, 2017 at 09:59:41AM +0530, Suniel Mahesh wrote: > On Friday 28 July 2017 01:18 AM, Dan Carpenter wrote: > > On Thu, Jul 27, 2017 at 05:27:33PM +0300, Gilad Ben-Yossef wrote: > >> + new_drvdata->cc_base = devm_ioremap_re

[bug report] crypto: stm32 - Support for STM32 HASH module

2017-08-09 Thread Dan Carpenter
86 finish: 1087 /*Finish current request */ 1088 stm32_hash_finish_req(hdev->req, err); ^^^ Never initialized. 1089 1090 return IRQ_HANDLED; 1091 } regards, dan carpenter

Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline

2017-08-22 Thread Dan Carpenter
Google for how to send a v2 patch. https://www.google.com/search?q=how+to+send+a+v2+patch https://kernelnewbies.org/FirstKernelPatch regards, dan carpenter

Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline

2017-08-22 Thread Dan Carpenter
, dan carpenter

Re: [PATCH 8/8] staging: ccree: remove BUG macro usage

2017-09-06 Thread Dan Carpenter
te those. I've tried to review locking bugs to see if single returns prevent future programmers from introducing new error paths which don't unlock. They don't really help... regards, dan carpenter

Re: [PATCH] Staging: ccree: ssi_cipher.c: Correct spelling mistake.

2017-09-06 Thread Dan Carpenter
t delete the comment. It's obvious. But really just delete the local inflight_counter variable as well because that's never used. regards, dan carpenter

Re: [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Dan Carpenter
atches, it sometimes still stresses me out. It's like you're disagreeing with the original author and the reviewers are disagreeing with you and everyone's trying to be nice about it but patches are fundamentally points of disagreement and that's stress. regards, dan carpenter

Re: [PATCH v5] Staging: ccree: Remove unused variable.

2017-09-07 Thread Dan Carpenter
Looks good. Thanks! regards, dan carpenter

Re: [PATCH 7/8] staging: ccree: replace noop macro with inline

2017-09-09 Thread Dan Carpenter
g size) {}; Could you put the {} on the next line? Also there is no need for the semi-colon after the end of a function. This is a style thing, so if you want to do it in a follow on patch that's fine regards, dan carpenter

Re: [PATCH] Staging: ccree: Don't use volatile for monitor_lock

2017-09-12 Thread Dan Carpenter
> dma_addr_t dummy_comp_buff_dma; > struct cc_hw_desc monitor_desc; > > - volatile unsigned long monitor_lock; > + unsigned long monitor_lock; The variable seems unused. Try deleting it instead. regards, dan carpenter

Re: [PATCH] staging: ccree: Fix indentation in ssi_buffer_mgr.c

2017-10-27 Thread Dan Carpenter
size_to_skip += crypto_aead_ivsize(tfm); > + if (areq_ctx->is_gcm4543) > + size_to_skip += crypto_aead_ivsize(tfm); > > ssi_buffer_mgr_copy_scatterlist_portion( > dev, areq_ctx->backup_mac, req->src, But then ssi_buffer_mgr_copy_scatterlist_portion() is still not indented correctly. regards, dan carpenter

Re: [PATCH 1/3] staging: ccree: copy IV to DMAable memory

2017-11-01 Thread Dan Carpenter
ctx->iv, info, ivsize); We need to check if kmalloc() fails. regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: handle limiting of DMA masks

2017-11-01 Thread Dan Carpenter
oherent_mask(&plat_dev->dev, dma_mask); > + if (!rc) > + break; The indenting is messed up. > + } > + dma_mask >>= 1; > + } regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: handle limiting of DMA masks

2017-11-01 Thread Dan Carpenter
eir own error messages if needed and return directly. If there is no cleanup then there is no need for a goto. Anyway, that's not related to this patch. Just resend it with goto post_clk_err: in the v2. regards, dan carpenter

Re: [PATCH 2/8] staging: ccree: use more readable func names

2017-11-07 Thread Dan Carpenter
so that's fine. But otherwise try to be strict about the one thing per patch. > + iv_size_to_authenc, is_last, > + &areq_ctx->assoc.mlli_nents); > areq_ctx->assoc_buff_type = SSI_DMA_BUF_MLLI; > } > regards, dan carpenter

Re: [PATCH 3/8] staging: ccree: simplify AEAD using local var

2017-11-07 Thread Dan Carpenter
areq_ctx->dst_offset + > - ctx->authsize), > +areq_ctx->dst_sgl, loc, > +(loc + ctx->authsize), > SSI_SG_FROM_BUF); > } regards, dan carpenter

Re: [PATCH 5/8] staging: ccree: fold common code into function

2017-11-07 Thread Dan Carpenter
areq_ctx->req_authsize), > -(size_to_skip + req->cryptlen), > - SSI_SG_FROM_BUF); > - } > + cc_copy_mac(dev, req, SSI_SG_FROM_BUF); > } regards, dan carpenter

Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-07 Thread Dan Carpenter
struct ssi_drvdata *drvdata = > + (struct ssi_drvdata *)dev_get_drvdata(dev); No need to cast: struct ssi_drvdata *drvdata = dev_get_drvdata(dev); regards, dan carpenter

Re: [PATCH 7/8] staging: ccree: remove compare to none zero

2017-11-07 Thread Dan Carpenter
if (unlikely(rc != 0)) > + if (unlikely(rc)) Where-as for these ones "rc" is not a number we can use for math so the != 0 is just a double negative and slightly confusing, so removing it is the right thing. regards, dan carpenter

[bug report] crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver

2017-11-08 Thread Dan Carpenter
sgmin = min_t(unsigned int, small, CHCR_SRC_SG_SIZE); 564 walk->sgl->len0 = cpu_to_be32(sgmin); regards, dan carpenter

Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-09 Thread Dan Carpenter
On Thu, Nov 09, 2017 at 08:27:28AM +0200, Gilad Ben-Yossef wrote: > On Tue, Nov 7, 2017 at 12:43 PM, Dan Carpenter > wrote: > > On Tue, Nov 07, 2017 at 09:40:02AM +, Gilad Ben-Yossef wrote: > >> --- a/drivers/staging/ccree/ssi_pm.c > >> +++ b/drivers/staging

Re: [PATCH v2 00/10] staging: ccree: fixes and cleanups

2017-11-09 Thread Dan Carpenter
Reviewed-by: Dan Carpenter regards, dan carpenter

[PATCH] crypto: chelsio - Fix an error code in chcr_hash_dma_map()

2017-11-09 Thread Dan Carpenter
The dma_map_sg() function returns zero on error and positive values on success. We want to return -ENOMEM on failure here and zero on success. Fixes: 2f47d5804311 ("crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver") Signed-off-by: Dan Carpenter diff --git a/driv

[PATCH] crypto: s5p-sss - Remove a stray tab

2017-11-09 Thread Dan Carpenter
This code seems correct, but the goto was indented too far. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 142c6020cec7..62830a43d959 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -1461,7 +1461,7 @@ static void

Re: [PATCH 00/24] staging: ccree: more cleanup patches

2017-11-13 Thread Dan Carpenter
These cleanups look nice. Thanks. I hope you do a mass remove of likely/unlikely in a patch soon. Whenever, I see one of those in a + line I always have to remind myself that you're planning to do it in a later patch. regards, dan carpenter

Re: [PATCH 00/24] staging: ccree: more cleanup patches

2017-11-14 Thread Dan Carpenter
On Tue, Nov 14, 2017 at 11:33:20AM +0200, Gilad Ben-Yossef wrote: > On Mon, Nov 13, 2017 at 8:33 PM, Dan Carpenter > wrote: > > These cleanups look nice. Thanks. > > > > I hope you do a mass remove of likely/unlikely in a patch soon. > > Whenever, I see one of thos

Re: [PATCH 00/10] staging: ccree: cleanups & fixes

2017-12-04 Thread Dan Carpenter
Looks good. Thanks! regards, dan carpenter

Re: [PATCH 01/10] staging: ccree: remove inline qualifiers

2017-12-04 Thread Dan Carpenter
inline hints... It probably would make single line functions inline anyway. regards, dan carpenter

[bug report] chcr: Add support for Inline IPSec

2017-12-04 Thread Dan Carpenter
pos = (u8 *)q->q.desc + (key_len - left); But I can't test this. 432 } 433 } 434 /* Copy CPL TX PKT XT */ 435 pos = copy_cpltx_pktxt(skb, dev, pos); regards, dan carpenter

Re: [PATCH 01/10] staging: ccree: remove inline qualifiers

2017-12-07 Thread Dan Carpenter
On Thu, Dec 07, 2017 at 09:00:11AM +0200, Gilad Ben-Yossef wrote: > On Mon, Dec 4, 2017 at 11:36 AM, Dan Carpenter > wrote: > > On Sun, Dec 03, 2017 at 01:58:12PM +, Gilad Ben-Yossef wrote: > >> The ccree drivers was marking a lot of big functions in C file as > >

[patch] crypto: keywrap - memzero the correct memory

2016-01-30 Thread Dan Carpenter
We're clearing the wrong memory. The memory corruption is likely harmless because we weren't going to use that stack memory again but not zeroing is a potential information leak. Fixes: e28facde3c39 ('crypto: keywrap - add key wrapping block chaining mode') Signed-off-by:

[patch] crypto: rsa-pkcs1pad: indent a couple statements

2016-03-08 Thread Dan Carpenter
These if statements aren't indented far enough and it makes static checkers complain. Signed-off-by: Dan Carpenter --- Hopefully GCC6 will start complaining about these as well? diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index 1cea67d..1eb5cbe 100644 --- a/crypto/rsa-pkcs1

[patch] crypto: marvell/cesa - remove unneeded condition

2016-03-21 Thread Dan Carpenter
creq->cache[] is an array inside the struct, it's not a pointer and it can't be NULL. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index 7ca2e0f..7a5058d 100644 --- a/drivers/crypto/marvell/hash.c +++ b/drivers/crypto/m

[patch 1/2] crypto: mxc-scc - signedness bugs in mxc_scc_ablkcipher_req_init()

2016-04-22 Thread Dan Carpenter
->src_nents and ->dst_nents are unsigned so they can't be less than zero. I fixed this by introducing a temporary "nents" variable. Fixes: d293b640ebd5 ('crypto: mxc-scc - add basic driver for the MXC SCC') Signed-off-by: Dan Carpenter diff --git a/drivers/crypto

[patch 2/2] crypto: mxc-scc - fix unwinding in mxc_scc_crypto_register()

2016-04-22 Thread Dan Carpenter
for the MXC SCC') Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/mxc-scc.c b/drivers/crypto/mxc-scc.c index 9b348a7..ff383ef 100644 --- a/drivers/crypto/mxc-scc.c +++ b/drivers/crypto/mxc-scc.c @@ -616,7 +616,7 @@ static struct mxc_scc_crypto_tmpl *scc_crypto_algs

[patch] crypto: omap-sham - potential Oops on error in probe

2016-05-18 Thread Dan Carpenter
This if statement is reversed so we end up either leaking or Oopsing on error. Fixes: dbe246209bc1 ('crypto: omap-sham - Use dma_request_chan() for requesting DMA channel') Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 6eefaa

Re: [patch] crypto: omap-sham - potential Oops on error in probe

2016-05-18 Thread Dan Carpenter
On Wed, May 18, 2016 at 01:42:36PM +0300, Peter Ujfalusi wrote: > On 05/18/16 13:39, Dan Carpenter wrote: > > This if statement is reversed so we end up either leaking or Oopsing on > > error. > > Oops, sorry for that. > Probably the other omap-* crypto drivers have the sa

[patch] crypto: drbg - fix an error code in drbg_init_sym_kernel()

2016-06-17 Thread Dan Carpenter
We accidentally return PTR_ERR(NULL) which is success but we should return -ENOMEM. Fixes: 355912852115 ('crypto: drbg - use CTR AES instead of ECB AES') Signed-off-by: Dan Carpenter diff --git a/crypto/drbg.c b/crypto/drbg.c index ded8638..6872d15 100644 --- a/crypto/drbg.c +++ b/cry

[patch] crypto: sha256-mb - cleanup a || vs | typo

2016-06-29 Thread Dan Carpenter
|| and | behave basically the same here but || is intended. It causes a static checker warning to mix up bitwise and logical operations. Signed-off-by: Dan Carpenter diff --git a/arch/x86/crypto/sha256-mb/sha256_mb.c b/arch/x86/crypto/sha256-mb/sha256_mb.c index c9d5dcc..4ec895a 100644 --- a

[patch] crypto: sha1-mb - cleanup a small | vs || typo

2016-06-29 Thread Dan Carpenter
|| and | behave basically the same here but || was intended. It causes a static checker warning when we mix up logical and bitwise operations. Signed-off-by: Dan Carpenter diff --git a/arch/x86/crypto/sha1-mb/sha1_mb.c b/arch/x86/crypto/sha1-mb/sha1_mb.c index 561b286..96d80ad 100644 --- a

[patch] crypto: tcrypt - add a missing tab

2016-06-29 Thread Dan Carpenter
The "goto out;" line isn't indented far enough. Signed-off-by: Dan Carpenter diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 6ef7815..117f19e 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -629,7 +629,7 @@ static void test_mb_ahash_speed(const char *algo, un

Re: [patch] crypto: sha256-mb - cleanup a || vs | typo

2016-06-30 Thread Dan Carpenter
On Wed, Jun 29, 2016 at 10:05:53AM -0700, H. Peter Anvin wrote: > On 06/29/16 07:42, Dan Carpenter wrote: > > || and | behave basically the same here but || is intended. It causes a > > static checker warning to mix up bitwise and logical operations. > > > > S

Re: [patch] crypto: sha256-mb - cleanup a || vs | typo

2016-06-30 Thread Dan Carpenter
The difference between | and || is that || has ordering constraints. It's from the C standard, and not the compiler version. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More

Re: [patch] crypto: sha256-mb - cleanup a || vs | typo

2016-06-30 Thread Dan Carpenter
On Thu, Jun 30, 2016 at 01:42:19PM -0700, Tim Chen wrote: > On Wed, 2016-06-29 at 10:05 -0700, H. Peter Anvin wrote: > > On 06/29/16 07:42, Dan Carpenter wrote: > > > > > > > > > > > > > > > > > and | behave basically the same here b

[patch] crypto: nx - off by one bug in nx_of_update_msc()

2016-07-15 Thread Dan Carpenter
ion') Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/nx/nx.c b/drivers/crypto/nx/nx.c index 0794f1c..42f0f22 100644 --- a/drivers/crypto/nx/nx.c +++ b/drivers/crypto/nx/nx.c @@ -392,7 +392,7 @@ static void nx_of_update_msc(struct device *dev, ((byte

re: crypto: echainiv - Add encrypted chain IV generator

2015-05-26 Thread Dan Carpenter
d_geniv_free(inst); 450 inst = ERR_PTR(-EINVAL); 451 goto out; Goto out here means return the container_of() an error pointer. This is a class of bugs called a "one err bug" because all the error paths go to the s

Re: [PATCH] crypto-jitterentropy: Delete unnecessary checks before the function call "kzfree"

2015-06-24 Thread Dan Carpenter
lloc() or jent_zfree(). Why are you adding abstractions there? Quite bad ones as well. regards, dan carpenter -- 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: [PATCH] crypto-jitterentropy: Delete unnecessary checks before the function call "kzfree"

2015-06-24 Thread Dan Carpenter
Ah. I should have read the whole thread. I sort of assumed we were just adding abstractions for the fun of it (because I have worked in staging for too long). regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message

re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Dan Carpenter
;n, ptr, ctx->key_sz); 460 return 0; 461 err: 462 ctx->key_sz = 0; 463 ctx->n = NULL; 464 return ret; 465 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a messag

Re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Dan Carpenter
Also: drivers/crypto/qat/qat_common/qat_asym_algs.c:513 qat_rsa_get_d() warn: was && intended here instead of ||? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vg

Re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Dan Carpenter
On Mon, Jul 20, 2015 at 09:13:32AM -0700, Tadeusz Struk wrote: > On 07/20/2015 08:12 AM, Dan Carpenter wrote: > > The patch a990532023b9: "crypto: qat - Add support for RSA algorithm" > > from Jul 15, 2015, leads to the following Smatch warning: > > > &

[patch] crypto: qat - silence a static checker warning

2015-08-21 Thread Dan Carpenter
My static checker assumes that if we are getting numbers as a string using kstrotoint() then that means they come from outside the kernel and are untrustworthy. This may or may not be true in this case, but it seems harmless to add a range check here. Signed-off-by: Dan Carpenter diff --git a

re: crypto: sahara - check return value of sg_nents_for_len

2015-11-18 Thread Dan Carpenter
warn: unsigned 'src_nents' is never less than zero. drivers/crypto/picoxcell_crypto.c:348 spacc_aead_make_ddts() warn: unsigned 'dst_nents' is never less than zero. regards, dan carpenter -- 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

[patch -next] crypto: qat - uint8_t is not large enough for accel_id

2015-12-10 Thread Dan Carpenter
->accel_id has to be large enough to hold ADF_MAX_DEVICES + 1 (which is 1025) so uint8_t is too small. Fixes: 890c55f4dc0e ('crypto: qat - add support for c3xxx accel type') Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/qat/qat_common/adf_accel_devices.h b/drive

re: crypto: qat - add support for new devices to FW loader

2015-12-10 Thread Dan Carpenter
o left shift like we do with ACS_ABO_BITPOS on the next line? 422 (active & (1 << ACS_ABO_BITPOS))) 423 return 1; 424 else 425 return 0; 426 } regards, dan carpenter -- To unsubscribe from this list: send the line "

[patch] crypto: qat - fix some timeout tests

2015-12-15 Thread Dan Carpenter
rt of fw loader') Signed-off-by: Dan Carpenter --- This means we only loop times instead of 1 like before but I figure it probably doesn't matter. diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index 45c1739..2b078a6 100644

Re: [patch] crypto: qat - fix some timeout tests

2015-12-15 Thread Dan Carpenter
if (elapsed_cycles >= 8 && !(csr & (1 << ACS_ABO_BITPOS))) > return 0; > } > - if (!times) { > + if (!(0 < times)) { Oh, wow that's nasty! Why would you write it in such an obfuscated way? Plus it's buggy and wrong... What

re: [PATCH] eCryptfs: Clean up crypto initialization

2016-01-25 Thread Dan Carpenter
1629 "cipher [%s]; rc = [%d]\n", *key_size, full_alg_name, 1630 rc); 1631 rc = -EINVAL; 1632 goto out; 1633 } 1634 out: 1635 kfree(full_alg_name); 1636 return rc;

[PATCH] crypto: zip - Memory corruption in zip_clear_stats()

2017-03-17 Thread Dan Carpenter
There is a typo here. It should be "stats" instead of "state". The impact is that we clear 224 bytes instead of 80 and we zero out memory that we shouldn't. Fixes: 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics") Signed-off-by: Dan Carp

Re: [PATCH] crypto: zip - Memory corruption in zip_clear_stats()

2017-03-18 Thread Dan Carpenter
On Sat, Mar 18, 2017 at 11:24:34AM +0100, walter harms wrote: > > > Am 17.03.2017 21:46, schrieb Dan Carpenter: > > There is a typo here. It should be "stats" instead of "state". The > > impact is that we clear 224 bytes instead of 80 and

[bug report] padata: simplify serialization mechanism

2017-04-11 Thread Dan Carpenter
spin_unlock_bh(&pd->lock); 254 return; 255 } regards, dan carpenter

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Dan Carpenter
)) > chcr_free_shash(base_hash); Ah... Ok. Fine, but redo the first patch anyway because it shouldn't ever be NULL. regards, dan carpenter

Re: [PATCH 1/2] crypto: chcr - Improve error checking

2017-04-13 Thread Dan Carpenter
goto out; Ugh... When you mix NULL and error pointers, it should be because NULL is a valid return. We should change chcr_alloc_shash() to return ERR_PTR(-EINVAL) instead of NULL. Also the "goto out;" is buggy, of course. The problem with magical free everything style error handling is that "base_hash" wasn't allocated so this will oops for both NULL and error pointers. regards, dan carpenter

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Dan Carpenter
On Thu, Apr 13, 2017 at 08:37:50PM +0530, Harsh Jain wrote: > On Thu, Apr 13, 2017 at 8:20 PM, Christophe JAILLET > wrote: > > Le 13/04/2017 à 16:04, Dan Carpenter a écrit : > >> > >> On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: > >&g

[PATCH] crypto: sha512-mb - add some missing unlock on error

2017-04-25 Thread Dan Carpenter
We recently added some new locking but missed the unlocks on these error paths in sha512_ctx_mgr_submit(). Fixes: c459bd7beda0 ("crypto: sha512-mb - Protect sha512 mb ctx mgr access") Signed-off-by: Dan Carpenter diff --git a/arch/x86/crypto/sha512-mb/sha512_mb.c b/arch/x86/crypto

[PATCH] crypto: glue_helper - Delete some dead code

2017-05-09 Thread Dan Carpenter
We checked (nbytes < bsize) inside the loops so it's not possible to hit the "goto done;" here. This code is cut and paste from other slightly different loops where we don't have the check inside the loop. Signed-off-by: Dan Carpenter diff --git a/arch/x86/crypto/g

[PATCH] X.509: Fix error code in x509_cert_parse()

2017-05-23 Thread Dan Carpenter
We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api") Signed-off-by: Dan Carpenter diff --git a/crypto/asymmetric_keys/x509_cer

[PATCH v2] X.509: Fix error code in x509_cert_parse()

2017-05-29 Thread Dan Carpenter
We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api") Signed-off-by: Dan Carpenter --- v2: Style change Sorry for the delay, I&

[PATCH] crypto: cavium/nitrox - dma_mapping_error() returns bool

2017-06-19 Thread Dan Carpenter
We want to return negative error codes here, but we're accidentally propogating the "true" return from dma_mapping_error(). Fixes: 14fa93cdcd9b ("crypto: cavium - Add support for CNN55XX adapters.") Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/cavium/

Re: [PATCH 01/11] Fix coding style of driver/staging/ccree/ssi_aead.c ERROR: space required after that

2017-06-20 Thread Dan Carpenter
_aead.c from 54 errors to 0 error. You could put this into the cover letter. When we put this into the final git log we don't see the series only individual patches. > > The first patch fixed 'ERROR: space required after that'. > This patch fixes ... regards, dan carpenter

Re: [PATCH 02/11] Fix ERROR: spaces required around that

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 01:20:59PM +0800, Jhih-Ming Huang wrote: > From: Jhih-Ming Hunag > > Fixed 'ERROR: spaces required around that' > You're breaking the patches up in a bad way. This one should be combined with the previous patch. regards, dan carpenter

Re: [PATCH 05/11] Fix ERROR: space prohibited after that open parenthesis '('

2017-06-20 Thread Dan Carpenter
d in the series so I see that you do it later, but it should be done here. regards, dan carpenter

Re: [PATCH] staging: ccree: fix coding style error

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 10:51:58PM +0800, Jhih-Ming Huang wrote: > > Hi, > > This patch fix all coding style error in driver/staging/ccree/ssi_aead.c. Much better. Thanks! regards, dan carpenter

Re: [PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13

2017-06-22 Thread Dan Carpenter
de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with > the coding style clean up patches from Jhin-Ming if you take them. > > If you wish me to merge this patch set on top those just let me know. > Yes. Those are fine and will be merged most likely. It's strictly first in, first out. regards, dan carpenter

Re: [PATCH 5/7] staging: ccree: add clock management support

2017-06-22 Thread Dan Carpenter
t cc_clk_on(struct ssi_drvdata *drvdata) { struct clk *clk = drvdata->clk; int rc; if (IS_ERR(clk)) { /* Not all devices have a clock associated with CCREE */ return 0; } rc = clk_prepare_enable(clk); if (rc) return rc; return 0; } regards, dan carpenter

Re: [PATCH 6/7] staging: ccree: add DT bus coherency detection

2017-06-22 Thread Dan Carpenter
= areq_ctx->mac_buf; [ snip ] > @@ -533,7 +539,7 @@ int cc_clk_on(struct ssi_drvdata *drvdata) > struct clk *clk = drvdata->clk; > > if (IS_ERR(clk)) > - /* No all devices have a clock associated with CCREE */ > + /* Not all devices have a clock associated with CCREE */ This is not related. Do unrelated things in different patches. This typo was introduced in an earlier patch. There are a couple ways in git to edit previous patches. > goto out; > > rc = clk_prepare_enable(clk); regards, dan carpenter

  1   2   >