lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200911063631.GA19560@gondor.apana.org.au>
Date:   Fri, 11 Sep 2020 16:36:31 +1000
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Corentin Labbe <clabbe@...libre.com>
Cc:     davem@...emloft.net, mripard@...nel.org, wens@...e.org,
        linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-sunxi@...glegroups.com
Subject: Re: [PATCH v6 09/18] crypto: sun8i-ce: split into
 prepare/run/unprepare

On Fri, Sep 04, 2020 at 11:09:54AM +0000, Corentin Labbe wrote:
>
> +static int sun8i_ce_cipher_unprepare(struct crypto_engine *engine, void *async_req)
> +{
> +	struct skcipher_request *areq = container_of(async_req, struct skcipher_request, base);
> +	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq);
> +	struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm);
> +	struct sun8i_ce_dev *ce = op->ce;
> +	struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq);
> +	struct sun8i_ce_flow *chan;
> +	struct ce_task *cet;
> +	unsigned int ivsize, offset;
> +	int nr_sgs = rctx->nr_sgs;
> +	int nr_sgd = rctx->nr_sgd;
> +	int flow;
> +
> +	flow = rctx->flow;
> +	chan = &ce->chanlist[flow];
> +	cet = chan->tl;
> +	ivsize = crypto_skcipher_ivsize(tfm);
> +
> +	if (areq->src == areq->dst) {
> +		dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_BIDIRECTIONAL);
> +	} else {
> +		if (nr_sgs > 0)
> +			dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_TO_DEVICE);
> +		dma_unmap_sg(ce->dev, areq->dst, nr_sgd, DMA_FROM_DEVICE);
> +	}
> +
> +	if (areq->iv && ivsize > 0) {
> +		if (cet->t_iv)
> +			dma_unmap_single(ce->dev, cet->t_iv, rctx->ivlen,
> +					 DMA_TO_DEVICE);

This creates a sparse warning:

  CHECK   ../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25: warning: incorrect type in argument 2 (different base types)
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25:    expected unsigned long long [usertype] addr
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:311:25:    got restricted __le32 [usertype] t_iv
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9: warning: incorrect type in argument 2 (different base types)
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9:    expected unsigned long long [usertype] addr
../drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c:322:9:    got restricted __le32 [usertype] t_key

Please fix.  Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ