[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202209260155.OyJXn1CY-lkp@intel.com>
Date: Sun, 25 Sep 2022 18:31:21 +0800
From: kernel test robot <lkp@...el.com>
To: Jon Tourville <jon.tourville@...onical.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
John Johansen <john.johansen@...onical.com>
Subject: [jj-apparmor:apparmor-next 4/43]
security/apparmor/apparmorfs.c:1316:34: warning: variable 'ctx' is
uninitialized when used here
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor.git apparmor-next
head: 14cd278924502473f444eaedb45d42c2c2f7f3fd
commit: 52ccc20c652bdb4233c935c82d210c32cf8c98f5 [4/43] apparmor: use zstd compression for profile data
config: x86_64-randconfig-a005
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor.git/commit/?id=52ccc20c652bdb4233c935c82d210c32cf8c98f5
git remote add jj-apparmor https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor.git
git fetch --no-tags jj-apparmor apparmor-next
git checkout 52ccc20c652bdb4233c935c82d210c32cf8c98f5
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash security/apparmor/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> security/apparmor/apparmorfs.c:1316:34: warning: variable 'ctx' is uninitialized when used here [-Wuninitialized]
out_len = zstd_decompress_dctx(ctx, dst, dlen, src, slen);
^~~
security/apparmor/apparmorfs.c:1305:17: note: initialize the variable 'ctx' to silence this warning
zstd_dctx *ctx;
^
= NULL
1 warning generated.
vim +/ctx +1316 security/apparmor/apparmorfs.c
1299
1300 static int decompress_zstd(char *src, size_t slen, char *dst, size_t dlen)
1301 {
1302 #ifdef CONFIG_SECURITY_APPARMOR_EXPORT_BINARY
1303 if (aa_g_rawdata_compression_level == 0) {
1304 const size_t wksp_len = zstd_dctx_workspace_bound();
1305 zstd_dctx *ctx;
1306 void *wksp;
1307 size_t out_len;
1308 int ret = 0;
1309
1310 wksp = kvzalloc(wksp_len, GFP_KERNEL);
1311 if (!wksp) {
1312 ret = -ENOMEM;
1313 goto cleanup;
1314 }
1315
> 1316 out_len = zstd_decompress_dctx(ctx, dst, dlen, src, slen);
1317 if (zstd_is_error(out_len)) {
1318 ret = -EINVAL;
1319 goto cleanup;
1320 }
1321 cleanup:
1322 kvfree(wksp);
1323 return ret;
1324 }
1325 #endif
1326
1327 if (dlen < slen)
1328 return -EINVAL;
1329 memcpy(dst, src, slen);
1330 return 0;
1331 }
1332
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (138688 bytes)
Powered by blists - more mailing lists