Re: [PATCH] VSOCK: fix Integer Overflow in vmci_transport_recv_dgram_cb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]
[also build test ERROR on net/main linus/master v6.16 next-20250806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/bsdhenrymartin-gmail-com/VSOCK-fix-Integer-Overflow-in-vmci_transport_recv_dgram_cb/20250806-105210
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250805041748.1728098-1-tcs_kernel%40tencent.com
patch subject: [PATCH] VSOCK: fix Integer Overflow in vmci_transport_recv_dgram_cb()
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20250807/202508070446.83Vp7qaK-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250807/202508070446.83Vp7qaK-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508070446.83Vp7qaK-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from net/vmw_vsock/vmci_transport.c:8:
   net/vmw_vsock/vmci_transport.c: In function 'vmci_transport_recv_dgram_cb':
>> include/linux/stddef.h:16:33: error: 'struct vmci_datagram' has no member named 'payload'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   net/vmw_vsock/vmci_transport.c:634:43: note: in expansion of macro 'offsetof'
     634 |         if (dg->payload_size > SIZE_MAX - offsetof(struct vmci_datagram, payload))
         |                                           ^~~~~~~~
--
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from vmci_transport.c:8:
   vmci_transport.c: In function 'vmci_transport_recv_dgram_cb':
>> include/linux/stddef.h:16:33: error: 'struct vmci_datagram' has no member named 'payload'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   vmci_transport.c:634:43: note: in expansion of macro 'offsetof'
     634 |         if (dg->payload_size > SIZE_MAX - offsetof(struct vmci_datagram, payload))
         |                                           ^~~~~~~~


vim +16 include/linux/stddef.h

6e218287432472 Richard Knutsson 2006-09-30  14  
^1da177e4c3f41 Linus Torvalds   2005-04-16  15  #undef offsetof
14e83077d55ff4 Rasmus Villemoes 2022-03-23 @16  #define offsetof(TYPE, MEMBER)	__builtin_offsetof(TYPE, MEMBER)
3876488444e712 Denys Vlasenko   2015-03-09  17  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux