tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: b9011c7e671dbbf59bb753283ddfd03f0c9eb865 commit: db243b796439c0caba47865564d8acd18a301d18 [5040/8423] net/ipv4/ipv6: Replace one-element arraya with flexible-array members config: i386-randconfig-r023-20210816 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d) 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=db243b796439c0caba47865564d8acd18a301d18 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 db243b796439c0caba47865564d8acd18a301d18 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All warnings (new ones prefixed by >>): clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument] In file included from net/ipv4/ip_sockglue.c:19: In file included from include/linux/module.h:14: In file included from include/linux/buildid.h:5: In file included from include/linux/mm_types.h:9: In file included from include/linux/spinlock.h:51: In file included from include/linux/preempt.h:78: In file included from arch/x86/include/asm/preempt.h:7: In file included from include/linux/thread_info.h:60: arch/x86/include/asm/thread_info.h:172:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address] oldframe = __builtin_frame_address(1); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/include/asm/thread_info.h:174:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address] frame = __builtin_frame_address(2); ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> net/ipv4/ip_sockglue.c:838:7: warning: taking address of packed member 'gf_group' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] &gf32->gf_group, gf32->gf_slist_flex); ^~~~~~~~~~~~~~ >> net/ipv4/ip_sockglue.c:1509:29: warning: taking address of packed member 'gf_fmode' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_fmode, &p->gf_fmode) || ^~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:221:24: note: expanded from macro 'do_put_user_call' register __typeof__(*(ptr)) __val_pu asm("%"_ASM_AX); \ ^~~ >> net/ipv4/ip_sockglue.c:1509:29: warning: taking address of packed member 'gf_fmode' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_fmode, &p->gf_fmode) || ^~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:230:31: note: expanded from macro 'do_put_user_call' [size] "i" (sizeof(*(ptr))) \ ^~~ >> net/ipv4/ip_sockglue.c:1510:30: warning: taking address of packed member 'gf_numsrc' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_numsrc, &p->gf_numsrc)) ^~~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:221:24: note: expanded from macro 'do_put_user_call' register __typeof__(*(ptr)) __val_pu asm("%"_ASM_AX); \ ^~~ >> net/ipv4/ip_sockglue.c:1510:30: warning: taking address of packed member 'gf_numsrc' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_numsrc, &p->gf_numsrc)) ^~~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:230:31: note: expanded from macro 'do_put_user_call' [size] "i" (sizeof(*(ptr))) \ ^~~ 7 warnings generated. -- clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument] In file included from net/ipv6/ipv6_sockglue.c:21: In file included from include/linux/module.h:14: In file included from include/linux/buildid.h:5: In file included from include/linux/mm_types.h:9: In file included from include/linux/spinlock.h:51: In file included from include/linux/preempt.h:78: In file included from arch/x86/include/asm/preempt.h:7: In file included from include/linux/thread_info.h:60: arch/x86/include/asm/thread_info.h:172:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address] oldframe = __builtin_frame_address(1); ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/include/asm/thread_info.h:174:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address] frame = __builtin_frame_address(2); ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> net/ipv6/ipv6_sockglue.c:1111:29: warning: taking address of packed member 'gf_fmode' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_fmode, &p->gf_fmode) || ^~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:221:24: note: expanded from macro 'do_put_user_call' register __typeof__(*(ptr)) __val_pu asm("%"_ASM_AX); \ ^~~ >> net/ipv6/ipv6_sockglue.c:1111:29: warning: taking address of packed member 'gf_fmode' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_fmode, &p->gf_fmode) || ^~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:230:31: note: expanded from macro 'do_put_user_call' [size] "i" (sizeof(*(ptr))) \ ^~~ >> net/ipv6/ipv6_sockglue.c:1112:30: warning: taking address of packed member 'gf_numsrc' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_numsrc, &p->gf_numsrc)) ^~~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:221:24: note: expanded from macro 'do_put_user_call' register __typeof__(*(ptr)) __val_pu asm("%"_ASM_AX); \ ^~~ >> net/ipv6/ipv6_sockglue.c:1112:30: warning: taking address of packed member 'gf_numsrc' of class or structure 'compat_group_filter::(anonymous union)::(anonymous)' may result in an unaligned pointer value [-Waddress-of-packed-member] put_user(gf.gf_numsrc, &p->gf_numsrc)) ^~~~~~~~~~~~ arch/x86/include/asm/uaccess.h:252:72: note: expanded from macro 'put_user' #define put_user(x, ptr) ({ might_fault(); do_put_user_call(put_user,x,ptr); }) ^~~ arch/x86/include/asm/uaccess.h:230:31: note: expanded from macro 'do_put_user_call' [size] "i" (sizeof(*(ptr))) \ ^~~ 6 warnings generated. vim +838 net/ipv4/ip_sockglue.c 799 800 static int compat_ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, 801 int optlen) 802 { 803 const int size0 = offsetof(struct compat_group_filter, gf_slist_flex); 804 struct compat_group_filter *gf32; 805 unsigned int n; 806 void *p; 807 int err; 808 809 if (optlen < size0) 810 return -EINVAL; 811 if (optlen > sysctl_optmem_max - 4) 812 return -ENOBUFS; 813 814 p = kmalloc(optlen + 4, GFP_KERNEL); 815 if (!p) 816 return -ENOMEM; 817 gf32 = p + 4; /* we want ->gf_group and ->gf_slist_flex aligned */ 818 819 err = -EFAULT; 820 if (copy_from_sockptr(gf32, optval, optlen)) 821 goto out_free_gsf; 822 823 /* numsrc >= (4G-140)/128 overflow in 32 bits */ 824 n = gf32->gf_numsrc; 825 err = -ENOBUFS; 826 if (n >= 0x1ffffff) 827 goto out_free_gsf; 828 829 err = -EINVAL; 830 if (offsetof(struct compat_group_filter, gf_slist_flex[n]) > optlen) 831 goto out_free_gsf; 832 833 /* numsrc >= (4G-140)/128 overflow in 32 bits */ 834 err = -ENOBUFS; 835 if (n > sock_net(sk)->ipv4.sysctl_igmp_max_msf) 836 goto out_free_gsf; 837 err = set_mcast_msfilter(sk, gf32->gf_interface, n, gf32->gf_fmode, > 838 &gf32->gf_group, gf32->gf_slist_flex); 839 out_free_gsf: 840 kfree(p); 841 return err; 842 } 843 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip