From: kernel test robot <lkp@intel.com>
To: Alexander Aring <aahringo@redhat.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
David Teigland <teigland@redhat.com>
Subject: [linux-next:master 12280/13751] fs/dlm/debug_fs.c:654:15: error: 'sscanf' may overflow; destination buffer in argument 4 has size 64, but the corresponding specifier may require size 65
Date: Fri, 12 Nov 2021 12:17:08 +0800 [thread overview]
Message-ID: <202111121202.VC80jYmH-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2681 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: f2e19fd15bd7cba347ce50be71955f5cd28a6019
commit: 5054e79de99984b4f39a073534526bc7c827b1e0 [12280/13751] fs: dlm: add lkb debugfs functionality
config: hexagon-buildonly-randconfig-r006-20211112 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 63ef0e17e28827eae53133b3467bdac7d9729318)
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=5054e79de99984b4f39a073534526bc7c827b1e0
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 5054e79de99984b4f39a073534526bc7c827b1e0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> fs/dlm/debug_fs.c:654:15: error: 'sscanf' may overflow; destination buffer in argument 4 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
&lkb_id, name, &lkb_flags, &lkb_nodeid, &lkb_status);
^
1 error generated.
vim +/sscanf +654 fs/dlm/debug_fs.c
637
638 static ssize_t table_write2(struct file *file, const char __user *user_buf,
639 size_t count, loff_t *ppos)
640 {
641 struct seq_file *seq = file->private_data;
642 int n, len, lkb_nodeid, lkb_status, error;
643 char name[DLM_RESNAME_MAXLEN] = {};
644 struct dlm_ls *ls = seq->private;
645 unsigned int lkb_flags;
646 char buf[256] = {};
647 uint32_t lkb_id;
648
649 if (copy_from_user(buf, user_buf,
650 min_t(size_t, sizeof(buf) - 1, count)))
651 return -EFAULT;
652
653 n = sscanf(buf, "%x %" __stringify(DLM_RESNAME_MAXLEN) "s %x %d %d",
> 654 &lkb_id, name, &lkb_flags, &lkb_nodeid, &lkb_status);
655 if (n != 5)
656 return -EINVAL;
657
658 len = strnlen(name, DLM_RESNAME_MAXLEN);
659 error = dlm_debug_add_lkb(ls, lkb_id, name, len, lkb_flags,
660 lkb_nodeid, lkb_status);
661 if (error)
662 return error;
663
664 return count;
665 }
666
---
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: 33324 bytes --]
reply other threads:[~2021-11-12 4:18 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=202111121202.VC80jYmH-lkp@intel.com \
--to=lkp@intel.com \
--cc=aahringo@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=teigland@redhat.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