* [linux-next:master 6391/9634] include/linux/ucopysize.h:47:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
@ 2025-03-08 3:39 kernel test robot
2025-03-08 4:42 ` Kees Cook
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-03-08 3:39 UTC (permalink / raw)
To: Kees Cook; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 0a2f889128969dab41861b6e40111aa03dc57014
commit: 808aac63e2bdf9bae08485e072bf3d317a18acbf [6391/9634] uaccess: Introduce ucopysize.h
config: i386-buildonly-randconfig-001-20250308 (https://download.01.org/0day-ci/archive/20250308/202503081120.jyUyb28m-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/20250308/202503081120.jyUyb28m-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/202503081120.jyUyb28m-lkp@intel.com/
Note: the linux-next/master HEAD 0a2f889128969dab41861b6e40111aa03dc57014 builds fine.
It may have been fixed somewhere.
All errors (new ones prefixed by >>):
In file included from include/linux/uaccess.h:10,
from include/linux/sched/task.h:13,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
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:890:6:
>> include/linux/ucopysize.h:47:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
47 | __bad_copy_to();
| ^~~~~~~~~~~~~~~
vim +/__bad_copy_to +47 include/linux/ucopysize.h
36
37 static __always_inline __must_check bool
38 check_copy_size(const void *addr, size_t bytes, bool is_source)
39 {
40 int sz = __builtin_object_size(addr, 0);
41 if (unlikely(sz >= 0 && sz < bytes)) {
42 if (!__builtin_constant_p(bytes))
43 copy_overflow(sz, bytes);
44 else if (is_source)
45 __bad_copy_from();
46 else
> 47 __bad_copy_to();
48 return false;
49 }
50 if (WARN_ON_ONCE(bytes > INT_MAX))
51 return false;
52 check_object_size(addr, bytes, is_source);
53 return true;
54 }
55
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [linux-next:master 6391/9634] include/linux/ucopysize.h:47:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
2025-03-08 3:39 [linux-next:master 6391/9634] include/linux/ucopysize.h:47:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small kernel test robot
@ 2025-03-08 4:42 ` Kees Cook
0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2025-03-08 4:42 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all
On Sat, Mar 08, 2025 at 11:39:28AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 0a2f889128969dab41861b6e40111aa03dc57014
> commit: 808aac63e2bdf9bae08485e072bf3d317a18acbf [6391/9634] uaccess: Introduce ucopysize.h
> config: i386-buildonly-randconfig-001-20250308 (https://download.01.org/0day-ci/archive/20250308/202503081120.jyUyb28m-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/20250308/202503081120.jyUyb28m-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/202503081120.jyUyb28m-lkp@intel.com/
>
> Note: the linux-next/master HEAD 0a2f889128969dab41861b6e40111aa03dc57014 builds fine.
> It may have been fixed somewhere.
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/uaccess.h:10,
> from include/linux/sched/task.h:13,
> from include/linux/sched/signal.h:9,
> from include/linux/rcuwait.h:6,
> from include/linux/percpu-rwsem.h:7,
> from include/linux/fs.h:33,
> 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:890:6:
> >> include/linux/ucopysize.h:47:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small
> 47 | __bad_copy_to();
> | ^~~~~~~~~~~~~~~
It looks like this is an old error that just changed because the name of
the header containing __bad_copy_to changed.
Regardless, I can't reproduce this with GCC 12.3 (Ubuntu). I'm getting a
build image for Debian 12 (GCC 12.2) built to see if there is a
difference...
--
Kees Cook
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-08 4:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-08 3:39 [linux-next:master 6391/9634] include/linux/ucopysize.h:47:25: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small kernel test robot
2025-03-08 4:42 ` Kees Cook
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.