Hi Jens,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 37aeb7e817053fbf532b214aa02858b3c23af0b1
commit: 6c08191286995b0594d2ecf12fe7fca3cea1a5ca [15692/23714] io_uring: add support for pre-mapped user IO buffers
config: arm64-randconfig-001-20240913 (https://download.01.org/0day-ci/archive/20240916/202409161843.Wdlfbwor-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161843.Wdlfbwor-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161843.Wdlfbwor-lkp@intel.com/
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
In file included from include/linux/poll.h:12,
from include/linux/ring_buffer.h:7,
from include/linux/trace_events.h:6,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:86,
from fs/io_uring.c:32:
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'io_copy_iov.isra' at fs/io_uring.c:1457:7:
>> include/linux/uaccess.h:112:17: warning: 'ciov' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/compiler.h:251,
from include/linux/export.h:45,
from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from fs/io_uring.c:29:
include/linux/kasan-checks.h: In function 'io_copy_iov.isra':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
fs/io_uring.c:1454:37: note: 'ciov' declared here
1454 | struct compat_iovec ciov;
| ^~~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'io_uring_setup' at fs/io_uring.c:1960:6:
include/linux/uaccess.h:112:17: warning: 'p' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'io_uring_setup':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
fs/io_uring.c:1956:32: note: 'p' declared here
1956 | struct io_uring_params p;
| ^
In file included from include/linux/uaccess.h:11:
In function 'set_fs',
inlined from 'io_sq_wq_submit_work' at fs/io_uring.c:1114:3:
arch/arm64/include/asm/uaccess.h:59:12: warning: 'old_fs' may be used uninitialized [-Wmaybe-uninitialized]
59 | if (IS_ENABLED(CONFIG_ARM64_UAO) && fs == KERNEL_DS)
| ^
fs/io_uring.c: In function 'io_sq_wq_submit_work':
fs/io_uring.c:1074:22: note: 'old_fs' was declared here
1074 | mm_segment_t old_fs;
| ^~~~~~
vim +/ciov +112 include/linux/uaccess.h
d597580d373774 Al Viro 2017-03-20 104
d597580d373774 Al Viro 2017-03-20 105 #ifdef INLINE_COPY_FROM_USER
d597580d373774 Al Viro 2017-03-20 106 static inline unsigned long
d597580d373774 Al Viro 2017-03-20 107 _copy_from_user(void *to, const void __user *from, unsigned long n)
d597580d373774 Al Viro 2017-03-20 108 {
d597580d373774 Al Viro 2017-03-20 109 unsigned long res = n;
9c5f6908de03a4 Al Viro 2017-06-29 110 might_fault();
4983cb67a383a7 Linus Torvalds 2019-02-14 111 if (likely(access_ok(from, n))) {
9c5f6908de03a4 Al Viro 2017-06-29 @112 kasan_check_write(to, n);
d597580d373774 Al Viro 2017-03-20 113 res = raw_copy_from_user(to, from, n);
9c5f6908de03a4 Al Viro 2017-06-29 114 }
d597580d373774 Al Viro 2017-03-20 115 if (unlikely(res))
d597580d373774 Al Viro 2017-03-20 116 memset(to + (n - res), 0, res);
d597580d373774 Al Viro 2017-03-20 117 return res;
d597580d373774 Al Viro 2017-03-20 118 }
d597580d373774 Al Viro 2017-03-20 119 #else
d597580d373774 Al Viro 2017-03-20 120 extern unsigned long
d597580d373774 Al Viro 2017-03-20 121 _copy_from_user(void *, const void __user *, unsigned long);
d597580d373774 Al Viro 2017-03-20 122 #endif
d597580d373774 Al Viro 2017-03-20 123
:::::: The code at line 112 was first introduced by commit
:::::: 9c5f6908de03a4f52ba7364b11fcd6116225480c copy_{from,to}_user(): move kasan checks and might_fault() out-of-line
:::::: TO: Al Viro <viro(a)zeniv.linux.org.uk>
:::::: CC: Al Viro <viro(a)zeniv.linux.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 37aeb7e817053fbf532b214aa02858b3c23af0b1
commit: 484798bc8218ce6a0f8269675897b870a12c49e2 [8359/23714] gfs2: gfs2_walk_metadata fix
config: x86_64-buildonly-randconfig-006-20240915 (https://download.01.org/0day-ci/archive/20240916/202409161757.QAy2sdT1-lkp@…)
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/20240916/202409161757.QAy2sdT1-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161757.QAy2sdT1-lkp@intel.com/
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
fs/gfs2/bmap.c: In function 'gfs2_iomap_alloc':
fs/gfs2/bmap.c:748:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
748 | if (n == 0)
| ^
fs/gfs2/bmap.c:751:17: note: here
751 | case ALLOC_GROW_DEPTH:
| ^~~~
fs/gfs2/bmap.c:759:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
759 | if (n == 0)
| ^
fs/gfs2/bmap.c:762:17: note: here
762 | case ALLOC_DATA:
| ^~~~
fs/gfs2/bmap.c: In function 'gfs2_iomap_get':
>> fs/gfs2/bmap.c:960:31: warning: 'lblock' may be used uninitialized [-Wmaybe-uninitialized]
960 | ret = gfs2_hole_size(inode, lblock, len, mp, iomap);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/bmap.c:851:18: note: 'lblock' was declared here
851 | sector_t lblock;
| ^~~~~~
fs/gfs2/bmap.c:960:31: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
960 | ret = gfs2_hole_size(inode, lblock, len, mp, iomap);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/bmap.c:855:13: note: 'len' was declared here
855 | u64 len;
| ^~~
fs/gfs2/bmap.c:959:32: warning: 'height' may be used uninitialized [-Wmaybe-uninitialized]
959 | if (pos < size && height == ip->i_height)
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/bmap.c:857:12: note: 'height' was declared here
857 | u8 height;
| ^~~~~~
fs/gfs2/bmap.c:1290: warning: Function parameter or member 'inode' not described in 'gfs2_block_zero_range'
fs/gfs2/bmap.c:1290: warning: Function parameter or member 'from' not described in 'gfs2_block_zero_range'
fs/gfs2/bmap.c:1290: warning: Function parameter or member 'length' not described in 'gfs2_block_zero_range'
fs/gfs2/bmap.c:1493: warning: Function parameter or member 'rd_gh' not described in 'sweep_bh_for_rgrps'
fs/gfs2/bmap.c:1493: warning: Excess function parameter 'rg_gh' description in 'sweep_bh_for_rgrps'
fs/gfs2/bmap.c:1661: warning: Function parameter or member 'sdp' not described in 'find_nonnull_ptr'
fs/gfs2/bmap.c:1661: warning: Function parameter or member 'end_list' not described in 'find_nonnull_ptr'
fs/gfs2/bmap.c:1661: warning: Function parameter or member 'end_aligned' not described in 'find_nonnull_ptr'
vim +/lblock +960 fs/gfs2/bmap.c
7ee66c03e40a57 Christoph Hellwig 2018-06-01 831
3974320ca6aa68 Bob Peterson 2017-02-16 832 /**
628e366df11c0a Andreas Gruenbacher 2018-06-04 833 * gfs2_iomap_get - Map blocks from an inode to disk blocks
3974320ca6aa68 Bob Peterson 2017-02-16 834 * @inode: The inode
3974320ca6aa68 Bob Peterson 2017-02-16 835 * @pos: Starting position in bytes
3974320ca6aa68 Bob Peterson 2017-02-16 836 * @length: Length to map, in bytes
3974320ca6aa68 Bob Peterson 2017-02-16 837 * @flags: iomap flags
3974320ca6aa68 Bob Peterson 2017-02-16 838 * @iomap: The iomap structure
628e366df11c0a Andreas Gruenbacher 2018-06-04 839 * @mp: The metapath
3974320ca6aa68 Bob Peterson 2017-02-16 840 *
3974320ca6aa68 Bob Peterson 2017-02-16 841 * Returns: errno
3974320ca6aa68 Bob Peterson 2017-02-16 842 */
628e366df11c0a Andreas Gruenbacher 2018-06-04 843 static int gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length,
628e366df11c0a Andreas Gruenbacher 2018-06-04 844 unsigned flags, struct iomap *iomap,
628e366df11c0a Andreas Gruenbacher 2018-06-04 845 struct metapath *mp)
b3b94faa5fe596 David Teigland 2006-01-16 846 {
feaa7bba026c18 Steven Whitehouse 2006-06-14 847 struct gfs2_inode *ip = GFS2_I(inode);
feaa7bba026c18 Steven Whitehouse 2006-06-14 848 struct gfs2_sbd *sdp = GFS2_SB(inode);
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 849 loff_t size = i_size_read(inode);
9b8c81d1de4994 Steven Whitehouse 2008-02-22 850 __be64 *ptr;
3974320ca6aa68 Bob Peterson 2017-02-16 851 sector_t lblock;
628e366df11c0a Andreas Gruenbacher 2018-06-04 852 sector_t lblock_stop;
628e366df11c0a Andreas Gruenbacher 2018-06-04 853 int ret;
9b8c81d1de4994 Steven Whitehouse 2008-02-22 854 int eob;
628e366df11c0a Andreas Gruenbacher 2018-06-04 855 u64 len;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 856 struct buffer_head *dibh = NULL, *bh;
9b8c81d1de4994 Steven Whitehouse 2008-02-22 857 u8 height;
7276b3b0c77101 Steven Whitehouse 2006-09-21 858
628e366df11c0a Andreas Gruenbacher 2018-06-04 859 if (!length)
628e366df11c0a Andreas Gruenbacher 2018-06-04 860 return -EINVAL;
b3b94faa5fe596 David Teigland 2006-01-16 861
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 862 down_read(&ip->i_rw_mutex);
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 863
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 864 ret = gfs2_meta_inode_buffer(ip, &dibh);
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 865 if (ret)
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 866 goto unlock;
38084377af4fc8 Andreas Gruenbacher 2018-11-11 867 mp->mp_bh[0] = dibh;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 868
49edd5bf429c40 Andreas Gruenbacher 2018-02-06 869 if (gfs2_is_stuffed(ip)) {
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 870 if (flags & IOMAP_WRITE) {
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 871 loff_t max_size = gfs2_max_stuffed_size(ip);
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 872
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 873 if (pos + length > max_size)
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 874 goto unstuff;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 875 iomap->length = max_size;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 876 } else {
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 877 if (pos >= size) {
49edd5bf429c40 Andreas Gruenbacher 2018-02-06 878 if (flags & IOMAP_REPORT) {
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 879 ret = -ENOENT;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 880 goto unlock;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 881 } else {
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 882 /* report a hole */
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 883 iomap->offset = pos;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 884 iomap->length = length;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 885 goto do_alloc;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 886 }
3974320ca6aa68 Bob Peterson 2017-02-16 887 }
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 888 iomap->length = size;
49edd5bf429c40 Andreas Gruenbacher 2018-02-06 889 }
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 890 iomap->addr = (ip->i_no_addr << inode->i_blkbits) +
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 891 sizeof(struct gfs2_dinode);
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 892 iomap->type = IOMAP_INLINE;
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 893 iomap->inline_data = dibh->b_data + sizeof(struct gfs2_dinode);
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 894 goto out;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 895 }
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 896
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 897 unstuff:
3974320ca6aa68 Bob Peterson 2017-02-16 898 lblock = pos >> inode->i_blkbits;
3974320ca6aa68 Bob Peterson 2017-02-16 899 iomap->offset = lblock << inode->i_blkbits;
628e366df11c0a Andreas Gruenbacher 2018-06-04 900 lblock_stop = (pos + length - 1) >> inode->i_blkbits;
628e366df11c0a Andreas Gruenbacher 2018-06-04 901 len = lblock_stop - lblock + 1;
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 902 iomap->length = len << inode->i_blkbits;
20cdc1931ee8e0 Andreas Gruenbacher 2017-09-22 903
9b8c81d1de4994 Steven Whitehouse 2008-02-22 904 height = ip->i_height;
9a38662ba4e268 Andreas Gruenbacher 2018-04-16 905 while ((lblock + 1) * sdp->sd_sb.sb_bsize > sdp->sd_heightsize[height])
ecc30c79157103 Steven Whitehouse 2008-01-28 906 height++;
628e366df11c0a Andreas Gruenbacher 2018-06-04 907 find_metapath(sdp, lblock, mp, height);
9b8c81d1de4994 Steven Whitehouse 2008-02-22 908 if (height > ip->i_height || gfs2_is_stuffed(ip))
9b8c81d1de4994 Steven Whitehouse 2008-02-22 909 goto do_alloc;
3974320ca6aa68 Bob Peterson 2017-02-16 910
628e366df11c0a Andreas Gruenbacher 2018-06-04 911 ret = lookup_metapath(ip, mp);
e8b43fe0c1e035 Andreas Gruenbacher 2017-12-08 912 if (ret)
628e366df11c0a Andreas Gruenbacher 2018-06-04 913 goto unlock;
3974320ca6aa68 Bob Peterson 2017-02-16 914
628e366df11c0a Andreas Gruenbacher 2018-06-04 915 if (mp->mp_aheight != ip->i_height)
9b8c81d1de4994 Steven Whitehouse 2008-02-22 916 goto do_alloc;
3974320ca6aa68 Bob Peterson 2017-02-16 917
628e366df11c0a Andreas Gruenbacher 2018-06-04 918 ptr = metapointer(ip->i_height - 1, mp);
9b8c81d1de4994 Steven Whitehouse 2008-02-22 919 if (*ptr == 0)
9b8c81d1de4994 Steven Whitehouse 2008-02-22 920 goto do_alloc;
3974320ca6aa68 Bob Peterson 2017-02-16 921
628e366df11c0a Andreas Gruenbacher 2018-06-04 922 bh = mp->mp_bh[ip->i_height - 1];
bcfe94139a45fa Andreas Gruenbacher 2018-05-11 923 len = gfs2_extent_length(bh, ptr, len, &eob);
3974320ca6aa68 Bob Peterson 2017-02-16 924
628e366df11c0a Andreas Gruenbacher 2018-06-04 925 iomap->addr = be64_to_cpu(*ptr) << inode->i_blkbits;
628e366df11c0a Andreas Gruenbacher 2018-06-04 926 iomap->length = len << inode->i_blkbits;
628e366df11c0a Andreas Gruenbacher 2018-06-04 927 iomap->type = IOMAP_MAPPED;
0ed91eca1130e6 Andreas Gruenbacher 2018-07-25 928 iomap->flags |= IOMAP_F_MERGED;
9b8c81d1de4994 Steven Whitehouse 2008-02-22 929 if (eob)
7ee66c03e40a57 Christoph Hellwig 2018-06-01 930 iomap->flags |= IOMAP_F_GFS2_BOUNDARY;
3974320ca6aa68 Bob Peterson 2017-02-16 931
3974320ca6aa68 Bob Peterson 2017-02-16 932 out:
628e366df11c0a Andreas Gruenbacher 2018-06-04 933 iomap->bdev = inode->i_sb->s_bdev;
628e366df11c0a Andreas Gruenbacher 2018-06-04 934 unlock:
628e366df11c0a Andreas Gruenbacher 2018-06-04 935 up_read(&ip->i_rw_mutex);
9b8c81d1de4994 Steven Whitehouse 2008-02-22 936 return ret;
9b8c81d1de4994 Steven Whitehouse 2008-02-22 937
9b8c81d1de4994 Steven Whitehouse 2008-02-22 938 do_alloc:
628e366df11c0a Andreas Gruenbacher 2018-06-04 939 iomap->addr = IOMAP_NULL_ADDR;
628e366df11c0a Andreas Gruenbacher 2018-06-04 940 iomap->type = IOMAP_HOLE;
628e366df11c0a Andreas Gruenbacher 2018-06-04 941 if (flags & IOMAP_REPORT) {
49edd5bf429c40 Andreas Gruenbacher 2018-02-06 942 if (pos >= size)
3974320ca6aa68 Bob Peterson 2017-02-16 943 ret = -ENOENT;
628e366df11c0a Andreas Gruenbacher 2018-06-04 944 else if (height == ip->i_height)
628e366df11c0a Andreas Gruenbacher 2018-06-04 945 ret = gfs2_hole_size(inode, lblock, len, mp, iomap);
49edd5bf429c40 Andreas Gruenbacher 2018-02-06 946 else
49edd5bf429c40 Andreas Gruenbacher 2018-02-06 947 iomap->length = size - pos;
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 948 } else if (flags & IOMAP_WRITE) {
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 949 u64 alloc_size;
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 950
967bcc91b04493 Andreas Gruenbacher 2018-06-19 951 if (flags & IOMAP_DIRECT)
967bcc91b04493 Andreas Gruenbacher 2018-06-19 952 goto out; /* (see gfs2_file_direct_write) */
967bcc91b04493 Andreas Gruenbacher 2018-06-19 953
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 954 len = gfs2_alloc_size(inode, mp, len);
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 955 alloc_size = len << inode->i_blkbits;
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 956 if (alloc_size < iomap->length)
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 957 iomap->length = alloc_size;
64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 958 } else {
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 959 if (pos < size && height == ip->i_height)
d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 @960 ret = gfs2_hole_size(inode, lblock, len, mp, iomap);
3974320ca6aa68 Bob Peterson 2017-02-16 961 }
628e366df11c0a Andreas Gruenbacher 2018-06-04 962 goto out;
628e366df11c0a Andreas Gruenbacher 2018-06-04 963 }
628e366df11c0a Andreas Gruenbacher 2018-06-04 964
:::::: The code at line 960 was first introduced by commit
:::::: d505a96a3b16f46455035dc0296bc2da6014e163 gfs2: Further iomap cleanups
:::::: TO: Andreas Gruenbacher <agruenba(a)redhat.com>
:::::: CC: Andreas Gruenbacher <agruenba(a)redhat.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 37aeb7e817053fbf532b214aa02858b3c23af0b1
commit: a2491968ab51323208d2d1a4d4b28325886d41b8 [15686/23714] Add io_uring IO interface
config: arm64-randconfig-001-20240913 (https://download.01.org/0day-ci/archive/20240916/202409161422.WtkE4KWn-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161422.WtkE4KWn-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161422.WtkE4KWn-lkp@intel.com/
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
In file included from include/linux/poll.h:12,
from include/linux/ring_buffer.h:7,
from include/linux/trace_events.h:6,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:86,
from fs/io_uring.c:31:
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'io_uring_setup' at fs/io_uring.c:1224:6:
>> include/linux/uaccess.h:112:17: warning: 'p' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/compiler.h:251,
from include/linux/export.h:45,
from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from fs/io_uring.c:28:
include/linux/kasan-checks.h: In function 'io_uring_setup':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
fs/io_uring.c:1220:32: note: 'p' declared here
1220 | struct io_uring_params p;
| ^
vim +/p +112 include/linux/uaccess.h
d597580d373774 Al Viro 2017-03-20 104
d597580d373774 Al Viro 2017-03-20 105 #ifdef INLINE_COPY_FROM_USER
d597580d373774 Al Viro 2017-03-20 106 static inline unsigned long
d597580d373774 Al Viro 2017-03-20 107 _copy_from_user(void *to, const void __user *from, unsigned long n)
d597580d373774 Al Viro 2017-03-20 108 {
d597580d373774 Al Viro 2017-03-20 109 unsigned long res = n;
9c5f6908de03a4 Al Viro 2017-06-29 110 might_fault();
4983cb67a383a7 Linus Torvalds 2019-02-14 111 if (likely(access_ok(from, n))) {
9c5f6908de03a4 Al Viro 2017-06-29 @112 kasan_check_write(to, n);
d597580d373774 Al Viro 2017-03-20 113 res = raw_copy_from_user(to, from, n);
9c5f6908de03a4 Al Viro 2017-06-29 114 }
d597580d373774 Al Viro 2017-03-20 115 if (unlikely(res))
d597580d373774 Al Viro 2017-03-20 116 memset(to + (n - res), 0, res);
d597580d373774 Al Viro 2017-03-20 117 return res;
d597580d373774 Al Viro 2017-03-20 118 }
d597580d373774 Al Viro 2017-03-20 119 #else
d597580d373774 Al Viro 2017-03-20 120 extern unsigned long
d597580d373774 Al Viro 2017-03-20 121 _copy_from_user(void *, const void __user *, unsigned long);
d597580d373774 Al Viro 2017-03-20 122 #endif
d597580d373774 Al Viro 2017-03-20 123
:::::: The code at line 112 was first introduced by commit
:::::: 9c5f6908de03a4f52ba7364b11fcd6116225480c copy_{from,to}_user(): move kasan checks and might_fault() out-of-line
:::::: TO: Al Viro <viro(a)zeniv.linux.org.uk>
:::::: CC: Al Viro <viro(a)zeniv.linux.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 37aeb7e817053fbf532b214aa02858b3c23af0b1
commit: 3b7ad71a0a415eb51fb41ddc01ef538a7e163de4 [17815/23714] Intel: EDAC, i10nm: Add a driver for Intel 10nm server processors
config: x86_64-buildonly-randconfig-001-20240915 (https://download.01.org/0day-ci/archive/20240916/202409161418.IlepWryM-lkp@…)
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/20240916/202409161418.IlepWryM-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161418.IlepWryM-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/edac/skx_common.c: In function 'skx_mce_output_error':
drivers/edac/skx_common.c:470:15: warning: variable 'type' set but not used [-Wunused-but-set-variable]
470 | char *type, *optype;
| ^~~~
drivers/edac/skx_common.c: In function 'skx_get_dimm_info':
drivers/edac/skx_common.c:309:79: warning: '_DIMM#' directive output may be truncated writing 6 bytes into a region of size between 0 and 9 [-Wformat-truncation=]
309 | snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
| ^~~~~~
drivers/edac/skx_common.c:309:52: note: using the range [0, 4294967295] for directive argument
309 | snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/skx_common.c:309:9: note: 'snprintf' output between 31 and 53 bytes into a destination of size 32
309 | snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | imc->src_id, imc->lmc, chan, dimmno);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/skx_common.c: In function 'skx_get_nvdimm_info':
drivers/edac/skx_common.c:357:79: warning: '_DIMM#' directive output may be truncated writing 6 bytes into a region of size between 0 and 9 [-Wformat-truncation=]
357 | snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
| ^~~~~~
drivers/edac/skx_common.c:357:52: note: using the range [0, 4294967295] for directive argument
357 | snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/skx_common.c:357:9: note: 'snprintf' output between 31 and 53 bytes into a destination of size 32
357 | snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358 | imc->src_id, imc->lmc, chan, dimmno);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/edac/skx_common.o: warning: objtool: missing symbol for section .init.text
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 37aeb7e817053fbf532b214aa02858b3c23af0b1
commit: 70e6748c08ab45df178269e4e3ae6da56c33af54 [6399/23714] bcache: fix failure in journal relplay
config: x86_64-randconfig-123-20240915 (https://download.01.org/0day-ci/archive/20240916/202409161342.bh5SnmU9-lkp@…)
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/20240916/202409161342.bh5SnmU9-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161342.bh5SnmU9-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/md/bcache/journal.c: note: in included file (through drivers/md/bcache/bcache.h):
include/uapi/linux/bcache.h:294:38: sparse: sparse: array of flexible structures
>> drivers/md/bcache/journal.c:320:6: sparse: sparse: symbol 'is_discard_enabled' was not declared. Should it be static?
drivers/md/bcache/journal.c: note: in included file (through drivers/md/bcache/bcache.h):
drivers/md/bcache/bset.h:231:36: sparse: sparse: array of flexible structures
drivers/md/bcache/journal.c:627:13: sparse: sparse: context imbalance in 'journal_write_unlocked' - different lock contexts for basic block
drivers/md/bcache/journal.c:725:9: sparse: sparse: context imbalance in 'journal_try_write' - different lock contexts for basic block
drivers/md/bcache/journal.c:320:6: warning: no previous prototype for 'is_discard_enabled' [-Wmissing-prototypes]
320 | bool is_discard_enabled(struct cache_set *s)
| ^~~~~~~~~~~~~~~~~~
drivers/md/bcache/journal.o: warning: objtool: journal_read_bucket()+0x157: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: journal_write_work()+0x6f: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: do_journal_discard()+0x4d: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: journal_reclaim()+0x64d: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: journal_wait_for_write()+0x290: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: bch_journal_mark()+0x6a2: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: is_discard_enabled()+0x13e: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: bch_journal_replay()+0x101: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: journal_write_unlocked()+0xeb: sibling call from callable instruction with modified stack frame
drivers/md/bcache/journal.o: warning: objtool: bch_journal()+0x28d: sibling call from callable instruction with modified stack frame
vim +/is_discard_enabled +320 drivers/md/bcache/journal.c
319
> 320 bool is_discard_enabled(struct cache_set *s)
321 {
322 struct cache *ca;
323 unsigned int i;
324
325 for_each_cache(ca, s, i)
326 if (ca->discard)
327 return true;
328
329 return false;
330 }
331
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Chong,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 84404f248a61323e09909849803ea4efce81742f
commit: 8248d42b7c5f4338a54f26d8efebec8614b43466 [1625/13950] fbdev: add ls2k500sfb driver for ls2k500 bmc.
config: loongarch-randconfig-r064-20240916 (https://download.01.org/0day-ci/archive/20240916/202409161114.sOtMxgv1-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161114.sOtMxgv1-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161114.sOtMxgv1-lkp@intel.com/
All errors (new ones prefixed by >>):
loongarch64-linux-ld: drivers/video/fbdev/ls2k500sfb.o: in function `.L152':
>> ls2k500sfb.c:(.text+0xf9c): undefined reference to `fg_console'
>> loongarch64-linux-ld: ls2k500sfb.c:(.text+0xfa0): undefined reference to `fg_console'
loongarch64-linux-ld: net/ipv4/inet_hashtables.o: in function `inet_ehash_nolisten':
inet_hashtables.c:(.text+0x2ff0): undefined reference to `sysctl_local_port_allocation'
loongarch64-linux-ld: inet_hashtables.c:(.text+0x3000): undefined reference to `sysctl_local_port_allocation'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 37aeb7e817053fbf532b214aa02858b3c23af0b1
commit: 2dd8345826607c5d2d6528de872118da554015b6 [5957/23714] vfio: Add support for Shared Virtual Addressing
config: arm64-randconfig-001-20240913 (https://download.01.org/0day-ci/archive/20240916/202409161055.v0wzDm7V-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161055.v0wzDm7V-lkp@…)
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(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409161055.v0wzDm7V-lkp@intel.com/
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
In file included from drivers/vfio/vfio_iommu_type1.c:31:
include/linux/module.h:134:13: warning: 'init_module' specifies less restrictive attribute than its target 'vfio_iommu_type1_init': 'cold' [-Wmissing-attributes]
134 | int init_module(void) __attribute__((alias(#initfn)));
| ^~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2222:1: note: in expansion of macro 'module_init'
2222 | module_init(vfio_iommu_type1_init);
| ^~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2212:19: note: 'init_module' target declared here
2212 | static int __init vfio_iommu_type1_init(void)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/module.h:140:14: warning: 'cleanup_module' specifies less restrictive attribute than its target 'vfio_iommu_type1_cleanup': 'cold' [-Wmissing-attributes]
140 | void cleanup_module(void) __attribute__((alias(#exitfn)));
| ^~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2223:1: note: in expansion of macro 'module_exit'
2223 | module_exit(vfio_iommu_type1_cleanup);
| ^~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2217:20: note: 'cleanup_module' target declared here
2217 | static void __exit vfio_iommu_type1_cleanup(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/compat.h:19,
from drivers/vfio/vfio_iommu_type1.c:27:
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_bind_process' at drivers/vfio/vfio_iommu_type1.c:1933:6:
>> include/linux/uaccess.h:112:17: warning: 'params' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/compiler.h:251,
from include/asm-generic/div64.h:25,
from ./arch/arm64/include/generated/asm/div64.h:1,
from include/linux/math64.h:6,
from include/linux/time64.h:5,
from include/linux/compat_time.h:6,
from include/linux/compat.h:10:
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_bind_process':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:1920:46: note: 'params' declared here
1920 | struct vfio_iommu_type1_bind_process params;
| ^~~~~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_unbind_process' at drivers/vfio/vfio_iommu_type1.c:2021:6:
>> include/linux/uaccess.h:112:17: warning: 'params' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_unbind_process':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2014:46: note: 'params' declared here
2014 | struct vfio_iommu_type1_bind_process params;
| ^~~~~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_ioctl' at drivers/vfio/vfio_iommu_type1.c:2084:7:
include/linux/uaccess.h:112:17: warning: 'info' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_ioctl':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2080:46: note: 'info' declared here
2080 | struct vfio_iommu_type1_info info;
| ^~~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_ioctl' at drivers/vfio/vfio_iommu_type1.c:2104:7:
include/linux/uaccess.h:112:17: warning: 'map' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_ioctl':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2098:49: note: 'map' declared here
2098 | struct vfio_iommu_type1_dma_map map;
| ^~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_ioctl' at drivers/vfio/vfio_iommu_type1.c:2118:7:
include/linux/uaccess.h:112:17: warning: 'unmap' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_ioctl':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2113:51: note: 'unmap' declared here
2113 | struct vfio_iommu_type1_dma_unmap unmap;
| ^~~~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_ioctl' at drivers/vfio/vfio_iommu_type1.c:2136:7:
>> include/linux/uaccess.h:112:17: warning: 'bind' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_ioctl':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2132:46: note: 'bind' declared here
2132 | struct vfio_iommu_type1_bind bind;
| ^~~~
In function '_copy_from_user',
inlined from 'copy_from_user' at include/linux/uaccess.h:144:7,
inlined from 'vfio_iommu_type1_ioctl' at drivers/vfio/vfio_iommu_type1.c:2155:7:
>> include/linux/uaccess.h:112:17: warning: 'bind' may be used uninitialized [-Wmaybe-uninitialized]
112 | kasan_check_write(to, n);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kasan-checks.h: In function 'vfio_iommu_type1_ioctl':
include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here
7 | void kasan_check_write(const volatile void *p, unsigned int size);
| ^~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2151:46: note: 'bind' declared here
2151 | struct vfio_iommu_type1_bind bind;
| ^~~~
vim +/params +112 include/linux/uaccess.h
d597580d373774 Al Viro 2017-03-20 104
d597580d373774 Al Viro 2017-03-20 105 #ifdef INLINE_COPY_FROM_USER
d597580d373774 Al Viro 2017-03-20 106 static inline unsigned long
d597580d373774 Al Viro 2017-03-20 107 _copy_from_user(void *to, const void __user *from, unsigned long n)
d597580d373774 Al Viro 2017-03-20 108 {
d597580d373774 Al Viro 2017-03-20 109 unsigned long res = n;
9c5f6908de03a4 Al Viro 2017-06-29 110 might_fault();
4983cb67a383a7 Linus Torvalds 2019-02-14 111 if (likely(access_ok(from, n))) {
9c5f6908de03a4 Al Viro 2017-06-29 @112 kasan_check_write(to, n);
d597580d373774 Al Viro 2017-03-20 113 res = raw_copy_from_user(to, from, n);
9c5f6908de03a4 Al Viro 2017-06-29 114 }
d597580d373774 Al Viro 2017-03-20 115 if (unlikely(res))
d597580d373774 Al Viro 2017-03-20 116 memset(to + (n - res), 0, res);
d597580d373774 Al Viro 2017-03-20 117 return res;
d597580d373774 Al Viro 2017-03-20 118 }
d597580d373774 Al Viro 2017-03-20 119 #else
d597580d373774 Al Viro 2017-03-20 120 extern unsigned long
d597580d373774 Al Viro 2017-03-20 121 _copy_from_user(void *, const void __user *, unsigned long);
d597580d373774 Al Viro 2017-03-20 122 #endif
d597580d373774 Al Viro 2017-03-20 123
d597580d373774 Al Viro 2017-03-20 124 #ifdef INLINE_COPY_TO_USER
d597580d373774 Al Viro 2017-03-20 125 static inline unsigned long
d597580d373774 Al Viro 2017-03-20 126 _copy_to_user(void __user *to, const void *from, unsigned long n)
d597580d373774 Al Viro 2017-03-20 127 {
9c5f6908de03a4 Al Viro 2017-06-29 128 might_fault();
4983cb67a383a7 Linus Torvalds 2019-02-14 129 if (access_ok(to, n)) {
9c5f6908de03a4 Al Viro 2017-06-29 130 kasan_check_read(from, n);
d597580d373774 Al Viro 2017-03-20 131 n = raw_copy_to_user(to, from, n);
9c5f6908de03a4 Al Viro 2017-06-29 132 }
d597580d373774 Al Viro 2017-03-20 133 return n;
d597580d373774 Al Viro 2017-03-20 134 }
d597580d373774 Al Viro 2017-03-20 135 #else
d597580d373774 Al Viro 2017-03-20 136 extern unsigned long
d597580d373774 Al Viro 2017-03-20 137 _copy_to_user(void __user *, const void *, unsigned long);
d597580d373774 Al Viro 2017-03-20 138 #endif
d597580d373774 Al Viro 2017-03-20 139
d597580d373774 Al Viro 2017-03-20 140 static __always_inline unsigned long __must_check
d597580d373774 Al Viro 2017-03-20 141 copy_from_user(void *to, const void __user *from, unsigned long n)
d597580d373774 Al Viro 2017-03-20 142 {
b0377fedb65280 Al Viro 2017-06-29 143 if (likely(check_copy_size(to, n, false)))
d597580d373774 Al Viro 2017-03-20 @144 n = _copy_from_user(to, from, n);
d597580d373774 Al Viro 2017-03-20 145 return n;
d597580d373774 Al Viro 2017-03-20 146 }
d597580d373774 Al Viro 2017-03-20 147
:::::: The code at line 112 was first introduced by commit
:::::: 9c5f6908de03a4f52ba7364b11fcd6116225480c copy_{from,to}_user(): move kasan checks and might_fault() out-of-line
:::::: TO: Al Viro <viro(a)zeniv.linux.org.uk>
:::::: CC: Al Viro <viro(a)zeniv.linux.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki