Re: [PATCH 3/3] fs: unicode: Make UTF-8 encoding loadable

From: kernel test robot
Date: Sat Mar 13 2021 - 19:48:47 EST


Hi Shreeya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on f2fs/dev-test linux/master linus/master v5.12-rc2 next-20210312]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Shreeya-Patel/Make-UTF-8-encoding-loadable/20210314-071604
base: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: riscv-randconfig-r022-20210314 (attached as .config)
compiler: riscv64-linux-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://github.com/0day-ci/linux/commit/85f4765787c386a4b949afaf9721046c0e85955a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Shreeya-Patel/Make-UTF-8-encoding-loadable/20210314-071604
git checkout 85f4765787c386a4b949afaf9721046c0e85955a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In function 'utf8_parse_version',
inlined from 'utf8_load' at fs/unicode/utf8mod.c:195:7:
>> fs/unicode/utf8mod.c:175:2: warning: 'strncpy' specified bound 12 equals destination size [-Wstringop-truncation]
175 | strncpy(version_string, version, sizeof(version_string));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +175 fs/unicode/utf8mod.c

164
165 static int utf8_parse_version(const char *version, unsigned int *maj,
166 unsigned int *min, unsigned int *rev)
167 {
168 substring_t args[3];
169 char version_string[12];
170 static const struct match_token token[] = {
171 {1, "%d.%d.%d"},
172 {0, NULL}
173 };
174
> 175 strncpy(version_string, version, sizeof(version_string));
176
177 if (match_token(version_string, token, args) != 1)
178 return -EINVAL;
179
180 if (match_int(&args[0], maj) || match_int(&args[1], min) ||
181 match_int(&args[2], rev))
182 return -EINVAL;
183
184 return 0;
185 }
186

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip