[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202301032142.1VZ8qVbM-lkp@intel.com>
Date: Tue, 3 Jan 2023 21:57:32 +0800
From: kernel test robot <lkp@...el.com>
To: YunQiang Su <yunqiang.su@...united.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Subject: arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:393:28:
sparse: sparse: incorrect type in argument 1 (different base types)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 69b41ac87e4a664de78a395ff97166f0b2943210
commit: 31b2f3dc851c65fee288612432c4fc956f1a264e MIPS: enable both vmlinux.gz.itb and vmlinuz for generic
date: 1 year ago
config: mips-randconfig-s043-20230103
compiler: mips-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=31b2f3dc851c65fee288612432c4fc956f1a264e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 31b2f3dc851c65fee288612432c4fc956f1a264e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
arch/mips/boot/compressed/decompress.c: note: in included file (through arch/mips/boot/compressed/../../../../lib/decompress_unxz.c):
>> arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: expected restricted __le32 const [usertype] *p
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: got unsigned int const [usertype] *
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: expected restricted __le32 const [usertype] *p
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: got unsigned int const [usertype] *
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: expected restricted __le32 const [usertype] *p
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: got unsigned int const [usertype] *
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: expected restricted __le32 const [usertype] *p
arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: got unsigned int const [usertype] *
arch/mips/boot/compressed/decompress.c:114:57: sparse: sparse: Using plain integer as NULL pointer
arch/mips/boot/compressed/decompress.c:114:60: sparse: sparse: Using plain integer as NULL pointer
arch/mips/boot/compressed/decompress.c:115:57: sparse: sparse: Using plain integer as NULL pointer
vim +393 arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c
24fa0402a9b6a5 Lasse Collin 2011-01-12 385
24fa0402a9b6a5 Lasse Collin 2011-01-12 386 /* Decode the Stream Header field (the first 12 bytes of the .xz Stream). */
24fa0402a9b6a5 Lasse Collin 2011-01-12 387 static enum xz_ret dec_stream_header(struct xz_dec *s)
24fa0402a9b6a5 Lasse Collin 2011-01-12 388 {
24fa0402a9b6a5 Lasse Collin 2011-01-12 389 if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE))
24fa0402a9b6a5 Lasse Collin 2011-01-12 390 return XZ_FORMAT_ERROR;
24fa0402a9b6a5 Lasse Collin 2011-01-12 391
24fa0402a9b6a5 Lasse Collin 2011-01-12 392 if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0)
24fa0402a9b6a5 Lasse Collin 2011-01-12 @393 != get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2))
24fa0402a9b6a5 Lasse Collin 2011-01-12 394 return XZ_DATA_ERROR;
24fa0402a9b6a5 Lasse Collin 2011-01-12 395
24fa0402a9b6a5 Lasse Collin 2011-01-12 396 if (s->temp.buf[HEADER_MAGIC_SIZE] != 0)
24fa0402a9b6a5 Lasse Collin 2011-01-12 397 return XZ_OPTIONS_ERROR;
24fa0402a9b6a5 Lasse Collin 2011-01-12 398
24fa0402a9b6a5 Lasse Collin 2011-01-12 399 /*
24fa0402a9b6a5 Lasse Collin 2011-01-12 400 * Of integrity checks, we support only none (Check ID = 0) and
24fa0402a9b6a5 Lasse Collin 2011-01-12 401 * CRC32 (Check ID = 1). However, if XZ_DEC_ANY_CHECK is defined,
24fa0402a9b6a5 Lasse Collin 2011-01-12 402 * we will accept other check types too, but then the check won't
24fa0402a9b6a5 Lasse Collin 2011-01-12 403 * be verified and a warning (XZ_UNSUPPORTED_CHECK) will be given.
24fa0402a9b6a5 Lasse Collin 2011-01-12 404 */
4f8d7abaa413c3 Lasse Collin 2021-10-11 405 if (s->temp.buf[HEADER_MAGIC_SIZE + 1] > XZ_CHECK_MAX)
4f8d7abaa413c3 Lasse Collin 2021-10-11 406 return XZ_OPTIONS_ERROR;
4f8d7abaa413c3 Lasse Collin 2021-10-11 407
24fa0402a9b6a5 Lasse Collin 2011-01-12 408 s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];
24fa0402a9b6a5 Lasse Collin 2011-01-12 409
:::::: The code at line 393 was first introduced by commit
:::::: 24fa0402a9b6a537e87e38341e78b7da86486846 decompressors: add XZ decompressor module
:::::: TO: Lasse Collin <lasse.collin@...aani.org>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (134725 bytes)
Powered by blists - more mailing lists