From: kbuild test robot <lkp@intel.com>
To: Salvatore Mesoraca <s.mesoraca16@gmail.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
kernel-hardening@lists.openwall.com,
linux-crypto@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Herbert Xu <herbert@gondor.apana.org.au>,
Kees Cook <keescook@chromium.org>,
Salvatore Mesoraca <s.mesoraca16@gmail.com>
Subject: Re: [PATCH] crypto: ctr: avoid VLA use
Date: Thu, 15 Mar 2018 22:41:09 +0800 [thread overview]
Message-ID: <201803152202.brqJ7obV%fengguang.wu@intel.com> (raw)
In-Reply-To: <1521033450-14447-1-git-send-email-s.mesoraca16@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]
Hi Salvatore,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.16-rc5 next-20180314]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Salvatore-Mesoraca/crypto-ctr-avoid-VLA-use/20180315-213008
config: x86_64-randconfig-x014-201810 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
crypto/ctr.c: In function 'crypto_ctr_crypt':
>> crypto/ctr.c:156:3: warning: 'tmp2' may be used uninitialized in this function [-Wmaybe-uninitialized]
kfree(tmp2);
^~~~~~~~~~~
crypto/ctr.c:133:18: note: 'tmp2' was declared here
u8 *keystream, *tmp2;
^~~~
vim +/tmp2 +156 crypto/ctr.c
121
122 static int crypto_ctr_crypt_inplace(struct blkcipher_walk *walk,
123 struct crypto_cipher *tfm)
124 {
125 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) =
126 crypto_cipher_alg(tfm)->cia_encrypt;
127 unsigned int bsize = crypto_cipher_blocksize(tfm);
128 unsigned long alignmask = crypto_cipher_alignmask(tfm);
129 unsigned int nbytes = walk->nbytes;
130 u8 *ctrblk = walk->iv;
131 u8 *src = walk->src.virt.addr;
132 DECLARE_CIPHER_BUFFER(tmp);
133 u8 *keystream, *tmp2;
134
135 if (CHECK_CIPHER_BUFFER(tmp, bsize, alignmask))
136 keystream = tmp;
137 else {
138 tmp2 = kmalloc(bsize + alignmask, GFP_ATOMIC);
139 if (!tmp2)
140 return -ENOMEM;
141 keystream = PTR_ALIGN(tmp2 + 0, alignmask + 1);
142 }
143
144 do {
145 /* create keystream */
146 fn(crypto_cipher_tfm(tfm), keystream, ctrblk);
147 crypto_xor(src, keystream, bsize);
148
149 /* increment counter in counterblock */
150 crypto_inc(ctrblk, bsize);
151
152 src += bsize;
153 } while ((nbytes -= bsize) >= bsize);
154
155 if (unlikely(keystream != tmp))
> 156 kfree(tmp2);
157 return nbytes;
158 }
159
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31983 bytes --]
prev parent reply other threads:[~2018-03-15 14:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 13:17 Salvatore Mesoraca
2018-03-14 13:31 ` Stephan Mueller
2018-03-14 13:46 ` Salvatore Mesoraca
2018-03-14 13:52 ` Stephan Mueller
2018-03-14 18:31 ` Eric Biggers
2018-03-14 19:25 ` Salvatore Mesoraca
2018-03-15 11:55 ` David Laight
2018-03-15 9:54 ` Herbert Xu
2018-03-15 10:42 ` Salvatore Mesoraca
2018-03-15 14:41 ` kbuild test robot [this message]
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=201803152202.brqJ7obV%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kbuild-all@01.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.mesoraca16@gmail.com \
/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
all inboxes | Powered by JetHome®