From: kernel test robot <lkp@intel.com>
To: Elizabeth Figura <zfigura@codeweavers.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: include/linux/thread_info.h:259:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
Date: Sun, 23 Feb 2025 05:49:54 +0800 [thread overview]
Message-ID: <202502230554.IA0tyUeS-lkp@intel.com> (raw)
Hi Elizabeth,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5cf80612d3f72c46ad53ef5042b4c609c393122f
commit: c301e1fefc2d6c83a2beb47e9cdd7b59a90b0067 ntsync: No longer depend on BROKEN.
date: 6 weeks ago
config: i386-buildonly-randconfig-002-20250221 (https://download.01.org/0day-ci/archive/20250223/202502230554.IA0tyUeS-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250223/202502230554.IA0tyUeS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502230554.IA0tyUeS-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/spinlock.h:60,
from include/linux/wait.h:9,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from drivers/misc/ntsync.c:11:
In function 'check_copy_size',
inlined from 'copy_from_user' at include/linux/uaccess.h:207:7,
inlined from 'setup_wait' at drivers/misc/ntsync.c:888:6:
>> include/linux/thread_info.h:259:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
259 | __bad_copy_to();
| ^~~~~~~~~~~~~~~
vim +/__bad_copy_to +259 include/linux/thread_info.h
b0377fedb65280 Al Viro 2017-06-29 248
9dd819a15162f8 Kees Cook 2019-09-25 249 static __always_inline __must_check bool
b0377fedb65280 Al Viro 2017-06-29 250 check_copy_size(const void *addr, size_t bytes, bool is_source)
b0377fedb65280 Al Viro 2017-06-29 251 {
c80d92fbb67b2c Kees Cook 2021-06-17 252 int sz = __builtin_object_size(addr, 0);
b0377fedb65280 Al Viro 2017-06-29 253 if (unlikely(sz >= 0 && sz < bytes)) {
b0377fedb65280 Al Viro 2017-06-29 254 if (!__builtin_constant_p(bytes))
b0377fedb65280 Al Viro 2017-06-29 255 copy_overflow(sz, bytes);
b0377fedb65280 Al Viro 2017-06-29 256 else if (is_source)
b0377fedb65280 Al Viro 2017-06-29 257 __bad_copy_from();
b0377fedb65280 Al Viro 2017-06-29 258 else
b0377fedb65280 Al Viro 2017-06-29 @259 __bad_copy_to();
b0377fedb65280 Al Viro 2017-06-29 260 return false;
b0377fedb65280 Al Viro 2017-06-29 261 }
6d13de1489b6bf Kees Cook 2019-12-04 262 if (WARN_ON_ONCE(bytes > INT_MAX))
6d13de1489b6bf Kees Cook 2019-12-04 263 return false;
b0377fedb65280 Al Viro 2017-06-29 264 check_object_size(addr, bytes, is_source);
b0377fedb65280 Al Viro 2017-06-29 265 return true;
b0377fedb65280 Al Viro 2017-06-29 266 }
b0377fedb65280 Al Viro 2017-06-29 267
:::::: The code at line 259 was first introduced by commit
:::::: b0377fedb6528087ed319b0d054d6ed82240372c copy_{to,from}_user(): consolidate object size checks
:::::: TO: Al Viro <viro@zeniv.linux.org.uk>
:::::: CC: Al Viro <viro@zeniv.linux.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-02-22 21:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-22 21:49 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-07 12:11 include/linux/thread_info.h:259:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small kernel test robot
2025-02-10 20:39 ` Elizabeth Figura
2025-02-14 8:44 ` Philip Li
2025-02-14 11:22 ` Arnd Bergmann
2025-02-18 2:44 ` Oliver Sang
2025-02-18 6:04 ` Arnd Bergmann
2025-02-18 8:08 ` Geert Uytterhoeven
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=202502230554.IA0tyUeS-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=zfigura@codeweavers.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