From: kernel test robot <lkp@intel.com>
To: Dan Moulding <dmoulding@me.com>, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-doc@vger.kernel.org,
tglx@linutronix.de, akpm@linux-foundation.org, corbet@lwn.net,
Dan Moulding <dmoulding@me.com>
Subject: Re: [PATCH 1/1] init: Add "hostname" kernel parameter
Date: Fri, 6 May 2022 08:51:44 +0800 [thread overview]
Message-ID: <202205060821.6KCNxZBf-lkp@intel.com> (raw)
In-Reply-To: <20220505180651.22849-2-dmoulding@me.com>
Hi Dan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on hnaz-mm/master linus/master v5.18-rc5 next-20220505]
[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/intel-lab-lkp/linux/commits/Dan-Moulding/Allow-setting-hostname-before-userspace-starts/20220506-023146
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 107c948d1d3e61d10aee9d0f7c3d81bbee9842af
config: riscv-randconfig-r042-20220505 (https://download.01.org/0day-ci/archive/20220506/202205060821.6KCNxZBf-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.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/intel-lab-lkp/linux/commit/1071875b349d9b8307eb0f4d23dda06a2301fe03
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dan-Moulding/Allow-setting-hostname-before-userspace-starts/20220506-023146
git checkout 1071875b349d9b8307eb0f4d23dda06a2301fe03
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
init/version.c: In function 'early_hostname':
>> init/version.c:45:9: warning: 'strncpy' specified bound 65 equals destination size [-Wstringop-truncation]
45 | strncpy(init_uts_ns.name.nodename, arg, bufsize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +45 init/version.c
39
40 static int __init early_hostname(char *arg)
41 {
42 size_t bufsize = sizeof(init_uts_ns.name.nodename);
43 size_t maxlen = bufsize - 1;
44
> 45 strncpy(init_uts_ns.name.nodename, arg, bufsize);
46 if (strlen(arg) > maxlen) {
47 pr_warn("hostname parameter exceeds %zd characters and will be truncated",
48 maxlen);
49 init_uts_ns.name.nodename[maxlen] = '\0';
50 }
51 return 0;
52 }
53 early_param("hostname", early_hostname);
54
--
0-DAY CI Kernel Test Service
https://01.org/lkp
prev parent reply other threads:[~2022-05-06 0:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 18:06 [PATCH 0/1] Allow setting hostname before userspace starts Dan Moulding
2022-05-05 18:06 ` [PATCH 1/1] init: Add "hostname" kernel parameter Dan Moulding
2022-05-06 0:51 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202205060821.6KCNxZBf-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=dmoulding@me.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).