From: Dan Carpenter <dan.carpenter@oracle.com>
To: herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org
Subject: [bug report] crypto: lrw - Convert to skcipher
Date: Thu, 18 Jan 2018 13:44:15 +0300 [thread overview]
Message-ID: <20180118104415.GB21064@mwanda> (raw)
Hello Herbert Xu,
The patch 700cb3f5fe75: "crypto: lrw - Convert to skcipher" from Nov
22, 2016, leads to the following static checker warning:
crypto/lrw.c:316 exit_crypt()
warn: should '(struct rctx)->ext' be freed with kzfree()'
crypto/lrw.c
309 static void exit_crypt(struct skcipher_request *req)
310 {
311 struct rctx *rctx = skcipher_request_ctx(req);
312
313 rctx->left = 0;
314
315 if (rctx->ext)
316 kfree(rctx->ext);
^^^^^^^^^^^^^^^^
I am working on a Smatch check that complains about stuff we should
maybe free with kzfree. It first makes a list of any struct members
which are freed with kzfree() then it does a second pass and complains
if any of them are freed with regular kfree().
317 }
Here is the complete list of warnings from v4.15-rc8. It's not very
long...
crypto/lrw.c:316 exit_crypt() warn: should '(struct rctx)->ext' be freed with kzfree()'
drivers/crypto/virtio/virtio_crypto_core.c:411 virtcrypto_free_unused_reqs() warn: should '(struct virtio_crypto_request)->req_data' be freed with kzfree()'
drivers/net/wireless/intersil/orinoco/wext.c:78 orinoco_set_key() warn: should '(struct key_params)->key' be freed with kzfree()'
drivers/staging/wlan-ng/p80211conv.c:216 skb_ether_to_p80211() warn: should '(struct p80211_metawep)->data' be freed with kzfree()'
fs/cifs/connect.c:1710 cifs_parse_mount_options() warn: should '(struct smb_vol)->password' be freed with kzfree()'
fs/cifs/connect.c:1748 cifs_parse_mount_options() warn: should '(struct smb_vol)->password' be freed with kzfree()'
fs/cifs/connect.c:4238 cifs_construct_tcon() warn: should '(struct smb_vol)->password' be freed with kzfree()'
security/apparmor/crypto.c:102 aa_calc_profile_hash() warn: should '(struct aa_profile)->hash' be freed with kzfree()'
regards,
dan carpenter
reply other threads:[~2018-01-18 10:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180118104415.GB21064@mwanda \
--to=dan.carpenter@oracle.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox