[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202209221029.JgAEfhhJ-lkp@intel.com>
Date: Thu, 22 Sep 2022 10:34:33 +0800
From: kernel test robot <lkp@...el.com>
To: cgel.zte@...il.com, richard@....at
Cc: kbuild-all@...ts.01.org, anton.ivanov@...bridgegreys.com,
johannes@...solutions.net, baihaowen@...zu.com,
linux-um@...ts.infradead.org, linux-kernel@...r.kernel.org,
ye xingchen <ye.xingchen@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] um: use strscpy() is more robust and safer
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20220920]
url: https://github.com/intel-lab-lkp/linux/commits/cgel-zte-gmail-com/um-use-strscpy-is-more-robust-and-safer/20220921-173157
base: ef08d387bbbc20df740ced8caee0ffac835869ac
config: um-i386_defconfig
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/e6fc2defb5c99c34a29cdc7f79df8d543e8d30a5
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review cgel-zte-gmail-com/um-use-strscpy-is-more-robust-and-safer/20220921-173157
git checkout e6fc2defb5c99c34a29cdc7f79df8d543e8d30a5
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
arch/um/os-Linux/umid.c: In function 'make_uml_dir':
>> arch/um/os-Linux/umid.c:43:17: error: implicit declaration of function 'strscpy'; did you mean 'strncpy'? [-Werror=implicit-function-declaration]
43 | strscpy(dir, home, sizeof(dir));
| ^~~~~~~
| strncpy
arch/um/os-Linux/umid.c: In function 'is_umdir_used':
arch/um/os-Linux/umid.c:139:23: warning: variable 'err' set but not used [-Wunused-but-set-variable]
139 | int fd, p, n, err;
| ^~~
cc1: some warnings being treated as errors
vim +43 arch/um/os-Linux/umid.c
27
28 static int __init make_uml_dir(void)
29 {
30 char dir[512] = { '\0' };
31 int len, err;
32
33 if (*uml_dir == '~') {
34 char *home = getenv("HOME");
35
36 err = -ENOENT;
37 if (home == NULL) {
38 printk(UM_KERN_ERR
39 "%s: no value in environment for $HOME\n",
40 __func__);
41 goto err;
42 }
> 43 strscpy(dir, home, sizeof(dir));
44 uml_dir++;
45 }
46 strlcat(dir, uml_dir, sizeof(dir));
47 len = strlen(dir);
48 if (len > 0 && dir[len - 1] != '/')
49 strlcat(dir, "/", sizeof(dir));
50
51 err = -ENOMEM;
52 uml_dir = malloc(strlen(dir) + 1);
53 if (uml_dir == NULL) {
54 printk(UM_KERN_ERR "%s : malloc failed, errno = %d\n",
55 __func__, errno);
56 goto err;
57 }
58 strcpy(uml_dir, dir);
59
60 if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
61 printk(UM_KERN_ERR "Failed to mkdir '%s': %s\n",
62 uml_dir, strerror(errno));
63 err = -errno;
64 goto err_free;
65 }
66 return 0;
67
68 err_free:
69 free(uml_dir);
70 err:
71 uml_dir = NULL;
72 return err;
73 }
74
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (42205 bytes)
Powered by blists - more mailing lists