From: kernel test robot <lkp@intel.com>
To: Hyunchul Lee <hyc.lee@gmail.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Namjae Jeon <namjae.jeon@samsung.com>,
Christoph Hellwig <hch@lst.de>,
Steve French <stfrench@microsoft.com>
Subject: [linux-next:master 412/2389] fs/ksmbd/ndr.c:70:2: warning: 'strncpy' destination unchanged after copying no bytes
Date: Thu, 22 Jul 2021 10:16:14 +0800 [thread overview]
Message-ID: <202107221005.ttQ8qZdQ-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3449 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b1347210b01daa977ea980268927aa99198ceccc
commit: c2220322b4577fc32ad3b7b4ddb856bd1f8c7461 [412/2389] ksmbd: replace KSMBD_ALIGN with kernel ALIGN macro
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 10.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/next/linux-next.git/commit/?id=c2220322b4577fc32ad3b7b4ddb856bd1f8c7461
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout c2220322b4577fc32ad3b7b4ddb856bd1f8c7461
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=parisc
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 >>):
In function 'ndr_write_string',
inlined from 'ndr_encode_dos_attr' at fs/ksmbd/ndr.c:136:3:
>> fs/ksmbd/ndr.c:70:2: warning: 'strncpy' destination unchanged after copying no bytes [-Wstringop-truncation]
70 | strncpy(PAYLOAD_HEAD(n), value, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'ndr_write_string',
inlined from 'ndr_encode_dos_attr' at fs/ksmbd/ndr.c:134:3:
>> fs/ksmbd/ndr.c:70:2: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
70 | strncpy(PAYLOAD_HEAD(n), value, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/ndr.c: In function 'ndr_encode_dos_attr':
fs/ksmbd/ndr.c:134:3: note: length computed here
134 | ndr_write_string(n, hex_attr, strlen(hex_attr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +70 fs/ksmbd/ndr.c
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 64
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 65 static int ndr_write_string(struct ndr *n, void *value, size_t sz)
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 66 {
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 67 if (n->length <= n->offset + sz)
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 68 try_to_realloc_ndr_blob(n, sz);
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 69
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 @70 strncpy(PAYLOAD_HEAD(n), value, sz);
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 71 sz++;
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 72 n->offset += sz;
c2220322b4577f fs/ksmbd/ndr.c Hyunchul Lee 2021-06-25 73 n->offset = ALIGN(n->offset, 2);
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 74 return 0;
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 75 }
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 76
:::::: The code at line 70 was first introduced by commit
:::::: e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 cifsd: add server-side procedures for SMB3
:::::: TO: Namjae Jeon <namjae.jeon@samsung.com>
:::::: CC: Steve French <stfrench@microsoft.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 68314 bytes --]
reply other threads:[~2021-07-22 2:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202107221005.ttQ8qZdQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=hch@lst.de \
--cc=hyc.lee@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=namjae.jeon@samsung.com \
--cc=stfrench@microsoft.com \
/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