[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212060957.0PKTfajA-lkp@intel.com>
Date: Tue, 6 Dec 2022 09:26:46 +0800
From: kernel test robot <lkp@...el.com>
To: Zhengchao Shao <shaozhengchao@...wei.com>, bpf@...r.kernel.org,
netdev@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com
Cc: oe-kbuild-all@...ts.linux.dev, martin.lau@...ux.dev,
song@...nel.org, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...gle.com, haoluo@...gle.com,
jolsa@...nel.org, syzkaller-bugs@...glegroups.com,
weiyongjun1@...wei.com, yuehaibing@...wei.com,
shaozhengchao@...wei.com
Subject: Re: [PATCH bpf-next] bpf, test_run: fix alignment problem in
bpf_test_init()
Hi Zhengchao,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Zhengchao-Shao/bpf-test_run-fix-alignment-problem-in-bpf_test_init/20221129-122226
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20221129042644.231816-1-shaozhengchao%40huawei.com
patch subject: [PATCH bpf-next] bpf, test_run: fix alignment problem in bpf_test_init()
config: i386-randconfig-m021-20221205
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
smatch warnings:
net/bpf/test_run.c:786 bpf_test_init() warn: inconsistent indenting
vim +786 net/bpf/test_run.c
764
765 static void *bpf_test_init(const union bpf_attr *kattr, u32 user_size,
766 u32 size, u32 headroom, u32 tailroom)
767 {
768 void __user *data_in = u64_to_user_ptr(kattr->test.data_in);
769 unsigned int true_size;
770 void *true_data;
771 void *data;
772
773 if (size < ETH_HLEN || size > PAGE_SIZE - headroom - tailroom)
774 return ERR_PTR(-EINVAL);
775
776 if (user_size > size)
777 return ERR_PTR(-EMSGSIZE);
778
779 data = kzalloc(size + headroom + tailroom, GFP_USER);
780 if (!data)
781 return ERR_PTR(-ENOMEM);
782
783 true_size = ksize(data);
784 if (size + headroom + tailroom < true_size) {
785 true_data = krealloc(data, true_size, GFP_USER | __GFP_ZERO);
> 786 if (!true_data)
787 return ERR_PTR(-ENOMEM);
788 data = true_data;
789 }
790
791 if (copy_from_user(data + headroom, data_in, user_size)) {
792 kfree(data);
793 return ERR_PTR(-EFAULT);
794 }
795
796 return data;
797 }
798
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (140505 bytes)
Powered by blists - more mailing lists