tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.4
head: 6a08a9e7fb1525fa296d810d200954f6c18d07a2
commit: 4e3bc622004d182e7038229c8ffc989df2e3e413 [11/14] squashfs: add more sanity checks
in id lookup
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
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/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-4.4
git checkout 4e3bc622004d182e7038229c8ffc989df2e3e413
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/arc/include/asm/bug.h:32,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/preempt.h:4,
from arch/arc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from include/linux/wait.h:8,
from include/linux/fs.h:5,
from fs/squashfs/id.c:34:
include/linux/cpumask.h: In function 'cpumask_check':
include/linux/cpumask.h:117:19: warning: comparison of integer expressions of different
signedness: 'unsigned int' and 'int' [-Wsign-compare]
117 | WARN_ON_ONCE(cpu >= nr_cpumask_bits);
| ^~
include/asm-generic/bug.h:112:27: note: in definition of macro 'WARN_ON_ONCE'
112 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
In file included from fs/squashfs/id.c:38:
fs/squashfs/squashfs_fs.h: In function 'squashfs_block_size':
fs/squashfs/squashfs_fs.h:135:24: warning: operand of ?: changes signedness from
'int' to 'u32' {aka 'unsigned int'} due to unsignedness of other
operand [-Wsign-compare]
135 | return (size >> 25) ? -EIO : size;
fs/squashfs/id.c: In function 'squashfs_read_id_index_table':
> fs/squashfs/id.c:109:16: warning: comparison of integer
expressions of different signedness: 'int' and 'unsigned int'
[-Wsign-compare]
109 | for (n = 0; n < (indexes - 1); n++) {
| ^
vim +109 fs/squashfs/id.c
68
69
70 /*
71 * Read uncompressed id lookup table indexes from disk into memory
72 */
73 __le64 *squashfs_read_id_index_table(struct super_block *sb,
74 u64 id_table_start, u64 next_table, unsigned short no_ids)
75 {
76 unsigned int length = SQUASHFS_ID_BLOCK_BYTES(no_ids);
77 unsigned int indexes = SQUASHFS_ID_BLOCKS(no_ids);
78 int n;
79 __le64 *table;
80 u64 start, end;
81
82 TRACE("In read_id_index_table, length %d\n", length);
83
84 /* Sanity check values */
85
86 /* there should always be at least one id */
87 if (no_ids == 0)
88 return ERR_PTR(-EINVAL);
89
90 /*
91 * The computed size of the index table (length bytes) should exactly
92 * match the table start and end points
93 */
94 if (length != (next_table - id_table_start))
95 return ERR_PTR(-EINVAL);
96
97 table = squashfs_read_table(sb, id_table_start, length);
98 if (IS_ERR(table))
99 return table;
100
101 /*
102 * table[0], table[1], ... table[indexes - 1] store the locations
103 * of the compressed id blocks. Each entry should be less than
104 * the next (i.e. table[0] < table[1]), and the difference between them
105 * should be SQUASHFS_METADATA_SIZE or less. table[indexes - 1]
106 * should be less than id_table_start, and again the difference
107 * should be SQUASHFS_METADATA_SIZE or less
108 */
109 for (n = 0; n < (indexes - 1); n++) {
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org